[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

api[ios,UIKit] methods


NSObject
	subclass: #UIResponder
	category: #UIKit!

UIResponder buildGetters: #(
	keyCommands
	textInputContextIdentifier
	reloadInputViews
)!
UIResponder buildBooleanGetters: #(
	becomeFirstResponder
	canBecomeFirstResponder
	canResignFirstResponder
	isFirstResponder
	resignFirstResponder
)!
UIResponder buildTypedGetters: #(
	#( inputAccessoryView #UIView )
	#( inputView #UIView )
	#( textInputMode #UITextInputMode )
	#( undoManager #NSUndoManager )
	#( nextResponder #UIResponder )
)!
"UIResponder buildFunctions: #(
	#( #canPerformAction:withSender: #( action #(sender json) ) )
	#( #motionBegan:withEvent: #( motion #(event json) ) )
	#( #motionCancelled:withEvent: #( motion #(event json) ) )
	#( #motionEnded:withEvent: #( motion #(event json) ) )
	#( #remoteControlReceivedWithEvent: #( #(event json) ) )
	#( #targetForAction:withSender: #( action #(sender json) ) )
	#( #touchesBegan:withEvent: #( #(touches json) #(event json) ) )
	#( #touchesCancelled:withEvent: #( #(touches json) #(event json) ) )
	#( #touchesEnded:withEvent: #( #(touches json) #(event json) ) )
	#( #touchesMoved:withEvent: #( #(touches json) #(event json) ) )
)"!

! UIResponder class methodsFor: #textInput !
clearTextInputContextIdentifier: identifier
	" Clears text input mode information from the app’s user defaults. "

	self nativeClass clearTextInputContextIdentifier: identifier! !

UIResponder subclass: #UIApplication !
UIApplication buildNumberGetters: #(
	applicationState
	backgroundRefreshStatus
	backgroundTimeRemaining
	statusBarOrientationAnimationDuration
	userInterfaceLayoutDirection
)!
UIApplication buildNumberAccessors: #(
	statusBarStyle
	statusBarOrientation
	applicationIconBadgeNumber
)!
UIApplication buildBooleanAccessors: #(
	applicationSupportsShakeToEdit
	networkActivityIndicatorVisible
)!
UIApplication buildBooleanGetters: #(
	isIdleTimerDisabled
	isProtectedDataAvailable
	isStatusBarHidden
	isNetworkActivityIndicatorVisible
)!
UIApplication buildGetters: #(
	scheduledLocalNotifications
	preferredContentSizeCategory
)!
UIApplication buildTypedGetters: #(
	#( delegate #NSObject )
	#( keyWindow #UIWindow )
	#( statusBarFrame #CGRect )
	#( currentUserNotificationSettings #UIUserNotificationSettings )
)!
UIApplication buildTypedAccessors: #(
	#( delegate #NSObject )
)!
UIApplication buildFunctions: #(
	#(#openURL: #( #(url handle)) #Boolean)
	#(#canOpenURL: #( #(url handle)) #Boolean)
	#(#sendEvent: #( #(anUIEvent handle)))
	#(#sendAction:to:from:forEvent: #( selector #(target handle) #(sender handle) #(anUIEvent handle)))
	#beginIgnoringInteractionEvents endIgnoringInteractionEvents
	#(isIgnoringInteractionEvents #() #Boolean)
	#(#registerUserNotificationSettings: #( #(notificationSettings handle)))
	#registerForRemoteNotifications unregisterForRemoteNotifications
	#(isRegisteredForRemoteNotifications #() #Boolean)
	#(#scheduleLocalNotification: #( #(notification handle)))
	#(#presentLocalNotificationNow: #( #(notification handle)))
	#(#cancelLocalNotification: #( #(notification handle)))
	#cancelAllLocalNotifications
	#(#setMinimumBackgroundFetchInterval: #(aNumber))
	#(#beginBackgroundTaskWithName:expirationHandler: #(taskName #(handler handle)))
	#(#beginBackgroundTaskWithExpirationHandler: #( #(handler handle)))
	#(#endBackgroundTask: #(identifier))
	#(#setKeepAliveTimeout:handler: #(timeout #(handler handle)))
	#clearKeepAliveTimeout
	#extendStateRestoration completeStateRestoration
	#ignoreSnapshotOnNextApplicationLaunch
	#beginReceivingRemoteControlEvents endReceivingRemoteControlEvents
	#(#setStatusBarHidden:withAnimation: #(aBoolean animation))
	#(#setStatusBarStyle:animated: #(statusBarStyle aBoolean))
	#(#setNewsstandIconImage: #( #(image handle)))
	#(#supportedInterfaceOrientationsForWindow: #( #(window handle)))
	#(#setStatusBarOrientation:animated: #( orientation animated ))
)!

! UIApplication class methodsFor: #singleton !
sharedApplication
	" Returns the singleton app instance. "

	^self @ (self nativeClass basicAt: #sharedApplication)! !

! UIApplication class methodsFor: #singleton !
shared
	" Returns the singleton app instance. "

	^self sharedApplication! !

! UIApplication class methodsFor: #notification !
registerObjectForStateRestoration: object restorationIdentifier: restorationIdentifier
	" Registers a custom object for use with the state restoration system. "

	self nativeClass
		registerObjectForStateRestoration: object json
		restorationIdentifier: restorationIdentifier! !

! UIApplication class methodsFor: #gui !
rootViewController
	" Returns the root view controller. "

	^self sharedApplication keyWindow rootViewController! !

! UIApplication class methodsFor: #gui !
topMostViewController
	" Returns the topmost(visible) view controller. "

	^self topMostViewControllerFrom: self rootViewController! !

! UIApplication class methodsFor: #gui !
topMostViewControllerFrom: aViewController
	" Private - Returns the topmost(visible) view controller found walking from aViewController. "

	(aViewController isKindOfClass: UITabBarController) ifTrue: [
		^self topMostViewControllerFrom: (aViewController as: UITabBarController) selectedViewController
	].
	(aViewController isKindOfClass: UINavigationController) ifTrue: [
		^self topMostViewControllerFrom: (aViewController as: UINavigationController) visibleViewController
	].
	aViewController presentedViewController notNil ifTrue: [
		^self topMostViewControllerFrom: aViewController presentedViewController
	].
	aViewController view subviews do: [:view| | subViewController |
		subViewController := view nextResponder.
		(subViewController  notNil and: [ subViewController isKindOfClass: UIViewController ]) ifTrue: [
			^self topMostViewControllerFrom: subViewController
		].
	].
	^aViewController ! !

! UIApplication methodsFor: #accessing !
windows
	" Returns the collection of windows associated with the receiver. "

	^(self asArray: (self handle basicAt: #windows)) collect: [:each| UIWindow @ each ]! !

! UIApplication methodsFor: #accessing !
scheduledLocalNotifications
	" Returns the currently scheduled local notifications. "

	^(self asArray: (self handle basicAt: #scheduledLocalNotifications))
		collect: [:each| UILocalNotification @ each ]! !

NSObject
	subclass: #NSLayoutConstraint
	category: #UIKit!
NativeObject
	subclass: #NSLayoutConstraintsArray
	category: #UIKit!
NSLayoutConstraintsArray comment: '
	Opaque constraints array.
	See NSLayoutConstraint class>>#constraintsWithVisualFormat:options:metrics:views:
'!

NSLayoutConstraint buildNumberAccessors: #(
	constant priority
)!
NSLayoutConstraint buildBooleanAccessors: #(
	shouldBeArchived
)!
NSLayoutConstraint buildNumberGetters: #(
	firstAttribute secondAttribute
	multiplier relation
)!
NSLayoutConstraint buildTypedGetters: #(
	#( firstItem  #NSObject )
	#( secondItem #NSObject )
)!

! NSLayoutConstraint class methodsFor: #constants !
layoutAttributes
	" Layout Attributes constants "

	^#(	#NSLayoutAttributeNotAnAttribute 
		#NSLayoutAttributeLeft 
   		#NSLayoutAttributeRight 
   		#NSLayoutAttributeTop 
   		#NSLayoutAttributeBottom 
   		#NSLayoutAttributeLeading 
   		#NSLayoutAttributeTrailing 
   		#NSLayoutAttributeWidth 
   		#NSLayoutAttributeHeight 
   		#NSLayoutAttributeCenterX 
   		#NSLayoutAttributeCenterY 
   		#NSLayoutAttributeBaseline 
   		#NSLayoutAttributeFirstBaseline
  		#NSLayoutAttributeLeftMargin 
  		#NSLayoutAttributeRightMargin
   		#NSLayoutAttributeTopMargin 
  		#NSLayoutAttributeBottomMargin 
   		#NSLayoutAttributeLeadingMargin
   		#NSLayoutAttributeTrailingMargin 
  		#NSLayoutAttributeCenterXWithinMargins 
   		#NSLayoutAttributeCenterYWithinMargins
	)! !

! NSLayoutConstraint class methodsFor: #constants !
layoutAttribute: aString
	" Return the value for the attribute constant "

	^(self layoutAttributes indexOf: aString) - 1! !

! NSLayoutConstraint class methodsFor: #constants !
layoutRelations
	" Layout Attributes constants "

	^#(	#NSLayoutRelationLessThanOrEqual 
		#NSLayoutRelationEqual 
   		#NSLayoutRelationGreaterThanOrEqual 
   	  )! !

! NSLayoutConstraint class methodsFor: #constants !
layoutRelation: aString
	" Return the value for the attribute constant "

	^(self layoutRelations indexOf: aString) - 2! !

! NSLayoutConstraint class methodsFor: #instantiation !
constraintsWithVisualFormat: format options: opts metrics: metrics views: views
	" Create constraints described by an ASCII art-like visual format string. "

	^NSLayoutConstraintsArray @ (
	    self nativeClass
		constraintsWithVisualFormat: format
		options: opts
		metrics: (self asJson: metrics)
		views: (self asJson: views))! !

! NSLayoutConstraint class methodsFor: #instantiation !
constraintsWithVisualFormat: format options: opts views: views
	" Create constraints described by an ASCII art-like visual format string. "

	^self constraintsWithVisualFormat: format options: opts metrics: nil views: views! !

! NSLayoutConstraint class methodsFor: #instantiation !
constraintsWithVisualFormat: format metrics: metrics views: views
	" Create constraints described by an ASCII art-like visual format string. "

	^self constraintsWithVisualFormat: format options: 0 metrics: metrics views: views! !

! NSLayoutConstraint class methodsFor: #instantiation !
constraintsWithVisualFormat: format views: views
	" Create constraints described by an ASCII art-like visual format string. "

	^self constraintsWithVisualFormat: format options: 0 metrics: nil views: views! !

! NSLayoutConstraint class methodsFor: #instantiation !
constraintWithItem: view1 attribute: attr1 relatedBy: relation
	toItem: view2 attribute: attr2 multiplier: multiplier constant: c
	" Create a constraint of the form
		view1.attr1 <relation> view2.attr2 * multiplier + constant
	"

	^self @ (self nativeClass
		constraintWithItem: view1 json
		attribute: attr1 relatedBy: relation
		toItem: view2 json
		attribute: attr2
		multiplier: multiplier constant: c )! !

UIResponder subclass: #UIViewController!
UIViewController buildTypedGetters: #(
	#( bottomLayoutGuide #NSObject )
	#( editButtonItem #UIBarButtonItem )
	#( extensionContext #NSExtensionContext )
	#( navigationController #UINavigationController )
	#( navigationItem #UINavigationItem )
	#( nibBundle #NSBundle )
	#( parentViewController #UIViewController )
	#( popoverPresentationController #UIPopoverPresentationController )
	#( presentedViewController #UIViewController )
	#( presentationController #UIPresentationController )
	#( presentingViewController #UIViewController )
	#( searchDisplayController #UISearchDisplayController )
	#( splitViewController #UISplitViewController )
	#( storyboard #UIStoryboard )
	#( tabBarController #UITabBarController )
	#( tabBarItem #UITabBarItem )
	#( topLayoutGuide #NSObject )
)! 
UIViewController buildTypedAccessors: #(
	#( view #UIView )
	#( tabBarItem #UITabBarItem )
	#( searchDisplayController #UISearchDisplayController )
	#( preferredContentSize #CGSize )
	#( transitioningDelegate #NSObject )
)!
UIViewController buildAccessors: #(
	title restorationIdentifier
	toolbarItems
	edgesForExtendedLayout
)!
UIViewController buildGetters: #(
	nibName
)!
UIViewController buildNumberAccessors: #(
	interfaceOrientation
	modalPresentationStyle
	modalTransitionStyle
)!
UIViewController buildBooleanAccessors: #(
	automaticallyAdjustsScrollViewInsets
	definesPresentationContext
	editing
	extendedLayoutIncludesOpaqueBars
	hidesBottomBarWhenPushed
	modalInPopover
	modalPresentationCapturesStatusBarAppearance
	providesPresentationContextTransitionStyle
)!
UIViewController buildBooleanGetters: #(
	isBeingDismissed isBeingPresented
	isMovingFromParentViewController isMovingToParentViewController
	isViewLoaded
)!
UIViewController buildFunctions: #(
	#( #addChildViewController: #( #(anUIViewController handle) ) )
	#( #beginAppearanceTransition:animated: #( isAppearing animated ) )
	#( #canPerformUnwindSegueAction:fromViewController:withSender: #( selector #(anUIViewController handle) sender ) #Boolean)
	#( #dismissViewControllerAnimated:completion: #( animated #(aBlock json) ) )
	disablesAutomaticKeyboardDismissal
	endAppearanceTransition
	loadView
	#( #performSegueWithIdentifier:sender: #( identifier sender ) )
	#(prefersStatusBarHidden #() #Boolean)
	#( #prepareForSegue:sender: #( segue sender ) )
	#( #presentViewController:animated:completion: #( #(anUIViewController handle) animated #(aBlock json) ) )
	removeFromParentViewController
	#( #setToolbarItems:animated: #( toolbarItems animated ) )
	#( #showViewController:sender: #( #(anUIViewController handle) #(sender handle) ) )
	#( #showDetailViewController:sender: #( #(anUIViewController handle) #(sender handle) ) )
	#( #targetViewControllerForAction:sender: #( action #(sender handle) ) )
	transitionCoordinator
	updateViewConstraints
)!

! UIViewController class methodsFor: #gui !
attemptRotationToDeviceOrientation
	" Attempts to rotate all windows to the orientation of the device. "

	^UIViewController nativeClass attemptRotationToDeviceOrientation! !

! UIViewController class methodsFor: #instantiation !
withNibName: aName bundle: aNSBundle
	" Return an instance of the receiver. "

"self print: '// ',self name,' withNibName: ',aName toString,' bundle: ',aNSBundle toString.
"	^self @ (self nativeClass
		instanceWithNibName: aName
		bundle: aNSBundle json)! !

! UIViewController class methodsFor: #instantiation !
withNibName: aName
	" Return an instance of the receiver. "

	^self withNibName: aName bundle: self bundle! !

! UIViewController class methodsFor: #instantiation !
fromNib
	" Return an instance of the receiver. "

	^self withNibName: self nibName bundle: self bundle! !

! UIViewController class methodsFor: #instantiation !
fromBundle
	" Return an instance of the receiver. "

	^self fromBundle: self bundle! !

! UIViewController class methodsFor: #instantiation !
fromBundle: aBundle
	" Return an instance of the receiver. "

	| storyboard aName |
	storyboard := self storyboardIn: aBundle.
	(storyboard notNil and: [
		aName := self identifier.
		aName notNil ]) ifTrue: [
		^self fromStoryboard: storyboard withIdentifier: aName
	].
	^self withNibName: self nibName bundle: aBundle! !

! UIViewController class methodsFor: #instantiation !
fromStoryboard: storyboard
	" Return an instance of the receiver. "

	| instance |
	instance := storyboard instantiateInitialViewController.
	^instance notNil ifTrue: [ self @ instance handle ]! !

! UIViewController class methodsFor: #instantiation !
fromStoryboard: storyboard withIdentifier: aName
	" Return an instance of the receiver. "

	| instance |
	instance := storyboard instantiateViewControllerWithIdentifier: aName.
	^instance notNil ifTrue: [ self @ instance handle ]! !

! UIViewController class methodsFor: #loading !
storyboardIn: aBundle
	" Private - Return the storyboard of the receiver in aBundle (or nil). "

	| aName |
	aName := self storyboardName.
	^aName notNil ifTrue: [ UIStoryboard withName: aName bundle: aBundle ]! !

! UIViewController class methodsFor: #loading !
identifier
	" Return the identifier of the receiver (in storyboard or nil). "

	^self name! !

! UIViewController class methodsFor: #loading !
storyboardName
	" Return the storyboard name of the receiver (or nil). "

	^nil! !

! UIViewController class methodsFor: #loading !
nibName
	" Return the nib file name of the receiver. "

	^self name! !

! UIViewController class methodsFor: #loading !
bundle
	" Return the bundle of the receiver. "

	^nil! !

! UIViewController methodsFor: #accessing !
childViewControllers
	" Return the child viewControllers of the receiver. "

	^(self asArray: (self handle basicAt: #childViewControllers))
		collect: [:each| UIViewController @ each ]! !

! UIViewController methodsFor: #gui !
presentViewController: aViewController
	^self
		presentViewController: aViewController
		animated: false completion: nil! !

UIViewController subclass: #UINavigationController!
UINavigationController buildTypedAccessors: #(
	#( delegate #NSObject )
	#( navigationBar #UINavigationBar )
	#( toolbar #UIToolbar )
	#( topViewController #UIViewController )
	#( visibleViewController #UIViewController )
)!
UINavigationController buildBooleanAccessors: #(
	#navigationBarHidden #toolbarHidden
)!
UINavigationController buildFunctions: #(
	#( #popToRootViewControllerAnimated: #( aBoolean ) )
	#( #popToRootViewController:animated: #( #( aViewController handle ) aBoolean ) )
	#( #popViewControllerAnimated: #( aBoolean ) )
	#( #pushViewController:animated: #( #( aViewController handle ) aBoolean ) )
	#( #setNavigationBarHidden:animated: #( hidden animated ) )
	#( #setToolbarHidden:animated: #( hidden animated ) )
)!

! UINavigationController class methodsFor: #instantiation !
withNavigationBarClass: navigationBarClass toolbarClass: toolbarClass
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithNavigationBarClass: navigationBarClass nativeClass
		toolbarClass: toolbarClass nativeClass)! !

! UINavigationController class methodsFor: #instantiation !
withRootViewController: aViewController
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithRootViewController: aViewController handle)! !

! UINavigationController methodsFor: #accessing !
viewControllers
	" Return the viewControllers of the receiver. "

	^(self asArray: (self handle basicAt: #viewControllers))
		collect: [:each| UIViewController @ each ]! !

! UINavigationController methodsFor: #accessing !
setViewControllers: anArray animated: animated
	" Set the viewControllers of the receiver. "

	"| handles |
	handles := anArray asArray collect: [:each| each handle ]."
	^self handle
		setViewControllers: anArray asArray handles
		animated: animated! !

UIViewController subclass: #UITabBarController !
UITabBarController buildTypedAccessors: #(
	#( delegate #NSObject )
	#( moreNavigationController #UINavigationController )
	#( selectedViewController #UIViewController )
)!
UITabBarController buildAccessors: #(
	#customizableViewControllers
	#selectedIndex
	#viewControllers
)!

! UITabBarController methodsFor: #accessing !
tabBarItems
	" Return the collection of tabBatItems installed on the receiver. "

	^self viewControllers collect: [:each| each tabBarItem ]! !

! UITabBarController methodsFor: #accessing !
viewControllers
	" Return the viewControllers of the receiver. "

	^(self asArray: (self handle basicAt: #viewControllers))
		collect: [:each| UIViewController @ each ]! !

! UITabBarController methodsFor: #accessing !
customizableViewControllers
	" Return the customizableViewControllers of the receiver. "

	^(self asArray: (self handle basicAt: #customizableViewControllers))
		collect: [:each| UIViewController @ each ]! !

! UITabBarController methodsFor: #accessing !
setViewControllers: anArray animated: animated
	" Set the viewControllers of the receiver. "

	"| handles |
	handles := anArray asArray collect: [:each| each handle ]."
	^self handle
		setViewControllers: anArray asArray handles
		animated: animated! !

UIViewController subclass: #UITableViewController!
UITableViewController buildTypedAccessors: #(
	#( tableView #UITableView )
	#( refreshControl #UIRefreshControl )
)!
UITableViewController buildBooleanAccessors: #(
	#clearsSelectionOnViewWillAppear
)!

! UITableViewController class methodsFor: #instantiation !
withStyle: anInteger
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithStyle: anInteger)! !

NSObject
	subclass: #UIStoryboard
	category: #UIKit!

UIStoryboard buildFunctions: #(
	#( #instantiateInitialViewController #UIViewController )
	#( #instantiateViewControllerWithIdentifier: #( identifier ) #UIViewController )
)!

! UIStoryboard class methodsFor: #instantiation !
withName: aName bundle: aNSBundle
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		storyboardWithName: aName
		bundle: aNSBundle json)! !

! UIStoryboard class methodsFor: #instantiation !
withName: aName
	" Return an instance of the receiver. "

	^self withName: aName bundle: nil! !

UIResponder subclass: #UIColor!

#(	black blue brown clear cyan
	darkGray darkText
	gray green
	groupTableViewBackground
	lightGray lightText
	magenta orange purple
	red white yellow
) do: [:aSelector|
	UIColor class
		implement: aSelector
		comment: 'Return the ' ,aSelector ,' instance.'
		as: '^self @ (self nativeClass basicAt: #' ,aSelector,'Color)'
		category: #constants
]!

! UIColor class methodsFor: #constants !
transparent

	^self clear! !

! UIColor class methodsFor: #instantiation !
red: red green: green blue: blue alpha: alpha
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		colorWithRed: red green: green
		blue: blue alpha: alpha)! !

! UIColor class methodsFor: #instantiation !
red: red green: green blue: blue
	" Return an instance of the receiver. "

	^self red: red green: green blue: blue alpha: 1! !

! UIColor class methodsFor: #instantiation !
hue: hue saturation: saturation brightness: brightness alpha: alpha
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		colorWithHue: hue saturation: saturation
		brightness: brightness alpha: alpha)! !

! UIColor class methodsFor: #instantiation !
white: white alpha: alpha
	" Return an instance of the receiver. "

	^self @ (self nativeClass colorWithWhite: white alpha: alpha)! !

! UIColor class methodsFor: #instantiation !
withPatternImage: anUIImage
	" Return an instance of the receiver. "

	^self @ (self nativeClass colorWithPatternImage: anUIImage handle)! !

! UIColor class methodsFor: #instantiation !
withCGColor: aCGColor
	" Return an instance of the receiver. "

	^self @ (self nativeClass colorWithCGColor: aCGColor handle)! !

NSObject
	subclass: #UIScreen
	category: #UIKit!
UIScreen buildGetters: #(
	#( applicationFrame #CGRect )
	#( bounds #CGRect )
	#( mirroredScreen #UIScreen )
)!
UIScreen buildNumberGetters: #(
	brightness
	scale
)!
UIScreen buildBooleanAccessors: #(
	wantsSoftwareDimming
)!

! UIScreen class methodsFor: #instantiation !
mainScreen
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #mainScreen)! !

! UIScreen class methodsFor: #accessing !
screens
	" Return the existing instances of the receiver. "

	^(self asArray: (self nativeClass basicAt: #screens))
		collect: [:each| self @ each ]! !

! UIScreen class methodsFor: #accessing !
bounds
	" Return the bounds of the main screen. "

	^self mainScreen bounds! !

! UIScreen class methodsFor: #accessing !
boundingBox
	" Return the boundingBox (aRectangle) of the main screen. "

	^self mainScreen boundingBox! !

! UIScreen class methodsFor: #accessing !
boundingRect
	" Return the boundingRect (aCGRect) of the main screen. "

	^self mainScreen boundingRect! !

! UIScreen class methodsFor: #accessing !
applicationBox
	" Return the applicationBox (aRectangle) of the main screen. "

	^self mainScreen applicationBox! !

! UIScreen class methodsFor: #accessing !
applicationRect
	" Return the applicationRect (aCGRect) of the main screen. "

	^self mainScreen applicationRect! !

! UIScreen methodsFor: #accessing !
oriented: aRectangle
	" Return aRectangle corrected to current orientation. "

	| orientation |
	orientation := UIApplication sharedApplication statusBarOrientation.
	(#( 1 2 ) includes: orientation) ifTrue: [ ^aRectangle ].
	^aRectangle left @ aRectangle top extent: aRectangle height @ aRectangle width! !

! UIScreen methodsFor: #accessing !
boundingBox
	" Return the boundingBox (aRectangle) of the receiver. "

	^"self oriented:" self bounds asRectangle! !

! UIScreen methodsFor: #accessing !
applicationBox
	" Return the application frame (aRectangle) of the receiver. "

	^"self oriented:" self applicationFrame asRectangle! !

! UIScreen methodsFor: #accessing !
applicationRect
	" Return the application frame (aCGRect) of the receiver. "

	^CGRect @ self applicationBox asCGRect! !

! UIScreen methodsFor: #accessing !
boundingRect
	" Return the boundingBox (aCGRect) of the receiver. "

	^CGRect @ self boundingBox asCGRect! !

! UIScreen methodsFor: #snapshot !
snapshotViewAfterScreenUpdates: afterUpdates
	" Return a snapshot view based on the current contents. "

	^UIView @ (self handle snapshotViewAfterScreenUpdates: afterUpdates)! !

UIResponder subclass: #UIView!
UIView buildBooleanAccessors: #(
	autoresizesSubviews
	clipsToBounds
	clearsContextBeforeDrawing
	exclusiveTouch
	hidden
	multipleTouchEnabled
	opaque
	userInteractionEnabled
)!
UIView buildAccessors: #(
	restorationIdentifier
	gestureRecognizers
	motionEffects
)!
UIView buildNumberAccessors: #(
	alpha
	autoresizingMask
	contentMode
	contentScaleFactor
	tag
	tintAdjustmentMode
)!
UIView buildTypedGetters: #(
	#( superview #UIView )
)!
UIView buildTypedAccessors: #(
	#( backgroundColor #UIColor )
	#( bounds #CGRect )
	#( center #CGPoint )
	#( frame #CGRect )
	#( tintColor #UIColor )
	#( transform #CGAffineTransform )
	#( window #UIWindow )
)!
UIView buildFunctions: #(
	#( #addConstraint: #( #(constraint json) ) )
	#( #addConstraints: #( #(aNSLayoutConstraintsArray json) ) )
	#( #addGestureRecognizer: #( #(gestureRecognizer json) ) )
	#( #addMotionEffect: #( #(effect json) ) )
	#( #addSubview: #( #(view json) ) )
	#( #insertSubview:aboveSubview: #( #(view json) #(siblingSubview json) ) )
	#( #insertSubview:atIndex: #( #(view json) index ) )
	#( #insertSubview:belowSubview: #( #(view json) #(siblingSubview json) ) )
	#( #intrinsicContentSize #() #CGSize )
	#invalidateIntrinsicContentSize
	#( #isDescendantOfView: #( #(view json) ) )
	#( #pointInside:withEvent: #( #(point json) #(event json) ) )
	#layoutIfNeeded
	#( #removeConstraint: #( #(constraint json) ) )
	#( #removeConstraints: #( #(aNSLayoutConstraintsArray json) ) )
	#removeFromSuperview
	#( #removeGestureRecognizer: #( #(gestureRecognizer json) ) )
	#( #removeMotionEffect: #( #(effect json) ) )
	#( #sendSubviewToBack: #( #(view json) ) )
	#setNeedsDisplay
	#( #setNeedsDisplayInRect: #( #(invalidRect json) ) )
	#setNeedsLayout
	#setNeedsUpdateConstraints
	#( #setTranslatesAutoresizingMaskIntoConstraints: #( aBoolean ) )
	#( #sizeThatFits: #( #(size json) ) #CGSize )
	#sizeToFit
	#( #systemLayoutSizeFittingSize: #( #(targetSize json) ) #CGSize )
	#translatesAutoresizingMaskIntoConstraints
	#updateConstraintsIfNeeded
	#(#viewWithTag: #( tag ) #UIView )
)!

! UIView class methodsFor: #instantiation !
withFrame: aCGRect
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithFrame: (CGRect instance: aCGRect) handle)! !

! UIView class methodsFor: #appearance !
appearance
	" Return the appearance proxy instance of the receiver.
	See UIAppearance Protocol Reference
	"

	^self @ (self nativeClass basicAt: #appearance)! !

! UIView methodsFor: #constraints !
constraints
	" Return the (opaque) constraints array. "

	^NSLayoutConstraintsArray @ (self handle basicAt: #constraints)! !

! UIView methodsFor: #accessing !
subviews
	" Return the subviews of the receiver. "

	^(self asArray: (self handle basicAt: #subviews))
		collect: [:each| UIView @ each ]! !

UIView subclass: #UIWindow!
UIWindow buildBooleanGetters: #(
	keyWindow
)!
UIWindow buildTypedAccessors: #(
	#( rootViewController #UIViewController )
	#( screen #UIScreen )
)!
UIWindow buildNumberAccessors: #(
	windowLevel
)!
UIWindow buildFunctions: #(
	#(#setRootViewController: #( #(aViewController handle) ))
	#makeKeyAndVisible
	#makeKeyWindow
	#(#sendEvent: #( #(anUIEvent handle) ))
)!

! UIWindow methodsFor: #appearance !
convertPoint: aCGPoint fromWindow: anUIWindowOrNil
	" Converts a point from the coordinate system of a given window to that of the receiver. "

	^CGPoint @ (self handle
		convertPoint: aCGPoint handle
		fromWindow: anUIWindowOrNil json)! !

! UIWindow methodsFor: #appearance !
convertPoint: aCGPoint toWindow: anUIWindowOrNil
	" Converts a point from the receiver’s coordinate system to that of another window. "

	^CGPoint @ (self handle
		convertPoint: aCGPoint handle
		toWindow: anUIWindowOrNil json)! !

! UIWindow methodsFor: #appearance !
convertRect: aCGRect fromWindow: anUIWindowOrNil
	" Converts a rectangle from the coordinate system of a given window to that of the receiver. "

	^CGRect @ (self handle
		convertRect: aCGRect handle
		fromWindow: anUIWindowOrNil json)! !

! UIWindow methodsFor: #appearance !
convertRect: aCGRect toWindow: anUIWindowOrNil
	" Converts a rectangle from the receiver’s coordinate system to that of another window. "

	^CGRect @ (self handle
		convertPoint: aCGRect handle
		toWindow: anUIWindowOrNil json)! !

UIView subclass: #UIScrollView!
UIScrollView buildBooleanGetters: #(
	decelerating
)!
UIScrollView buildNumberAccessors: #(
	decelerationRate
)!
UIScrollView buildBooleanAccessors: #(
	alwaysBounceHorizontal alwaysBounceVertical bounces
	bouncesZoom canCancelContentTouches 
)!
UIScrollView buildTypedAccessors: #(
	#(contentInset #UIEdgeInsets)
	#(contentOffset #CGPoint)
	#(contentSize #CGSize)
)!
UIScrollView buildFunctions: #(
	#flashScrollIndicators
)!

UIView subclass: #UIImageView!
UIImageView buildNumberGetters: #(
	animationDuration animationRepeatCount
)!
UIImageView buildBooleanGetters: #(
	highlighted userInteractionEnabled
	isAnimating
)!
UIImageView buildTypedAccessors: #(
	#(highlightedImage #UIImage)
	#(image #UIImage)
	#(tintColor #UIColor)
)!
UIImageView buildFunctions: #(
	#startAnimating
	#stopAnimating
	#( #animationImages: #( #(images handles) ))
	#( #highlightedAnimationImages: #( #(images handles) ))
)!

! UIImageView class methodsFor: #instantiation !
withImage: anUIImage
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithImage: anUIImage handle)! !

! UIImageView class methodsFor: #instantiation !
withImage: image highlightedImage: highlightedImage
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithImage: image handle
		highlightedImage: highlightedImage handle)! !

! UIImageView methodsFor: #accessing !
animationImages

	^(self handle basicAt: #animationImages) collect: [:aHandle| UIImage @ aHandle ]! !

! UIImageView methodsFor: #accessing !
highlightedAnimationImages

	^(self handle basicAt: #highlightedAnimationImages) collect: [:aHandle| UIImage @ aHandle ]! !

UIView subclass: #UITableViewCell!
UITableViewCell buildBooleanGetters: #(
	showingDeleteConfirmation
)!
UITableViewCell buildBooleanAccessors: #(
	editing highlighted selected
	shouldIndentWhileEditing
	showsReorderControl
)!
UITableViewCell buildGetters: #(
	reuseIdentifier
)!
UITableViewCell buildNumberAccessors: #(
	accessoryType
	indentationLevel indentationWidth
)!
UITableViewCell buildTypedAccessors: #(
	#(accessoryView #UIView)
	#(backgroundView #UIView)
	#(contentView #UIView)
	#(detailTextLabel #UILabel)
	#(editingAccessoryView #UIView)
	#(imageView #UIImageView)
	#(multipleSelectionBackgroundView #UIView)
	#(selectedBackgroundView #UIView)
	#(separatorInset #UIEdgeInsets)
	#(textLabel #UILabel)
)!
UITableViewCell buildFunctions: #(
	#(#didTransitionToState: #( state ) )
	#prepareForReuse
	#(#setEditing:animated: #( editing animated ))
	#(#setHighlighted:animated: #( highlighted animated ))
	#(#setSelected:animated: #( selected animated ))
	#(#willTransitionToState: #( state ) )
)!

! UITableViewCell class methodsFor: #instantiation !
withStyle: style reuseIdentifier: identifier
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithStyle: style
		reuseIdentifier: identifier)! !

UIScrollView subclass: #UITableView!
UITableView buildTypedAccessors: #(
	#(delegate #NSObject)
	#(dataSource #NSObject)
	#(indexPathForSelectedRow #NSIndexPath)
	#(separatorColor #UIColor)
	#(separatorEffect #NSObject"UIVisualEffect")
	#(backgroundView #UIView)
	#(separatorInset #UIEdgeInsets)
	#(tableHeaderView #UIView)
	#(tableFooterView #UIView)
	#(sectionIndexColor #UIColor)
	#(sectionIndexBackgroundColor #UIColor)
	#(sectionIndexTrackingBackgroundColor #UIColor)
)!
UITableView buildBooleanAccessors: #(
	allowsSelection allowsMultipleSelection
	allowsSelectionDuringEditing allowsMultipleSelectionDuringEditing
	editing
)!
UITableView buildNumberGetters: #(
	style numberOfSections
	sectionIndexMinimumDisplayRowCount
)!
UITableView buildNumberAccessors: #(
	rowHeight separatorStyle
	sectionHeaderHeight sectionFooterHeight
	estimatedRowHeight estimatedSectionHeaderHeight estimatedSectionFooterHeight
)!
UITableView buildSetters: #(
	#autoresizesSubviews
)!
UITableView buildFunctions: #(
	#( #numberOfRowsInSection: #( section ))
	#( #registerNib:forCellReuseIdentifier: #( #(nib handle) identifier ))
	#( #registerClass:forCellReuseIdentifier: #( #(aClass nativeClass) identifier ))
	#( #dequeueReusableCellWithIdentifier:forIndexPath: #( identifier #(indexPath handle)) #UITableViewCell )
	#( #dequeueReusableCellWithIdentifier: #( identifier ) #UITableViewCell )

	#( #registerNib:forHeaderFooterViewReuseIdentifier: #( #(nib handle) identifier ))
	#( #registerClass:forHeaderFooterViewReuseIdentifier: #( #(aClass nativeClass) identifier ))
	#( #dequeueReusableHeaderFooterViewWithIdentifier: #( identifier ) #UITableViewHeaderFooterView )
	#( #headerViewForSection: #( section ) #UITableViewHeaderFooterView )
	#( #footerViewForSection: #( section ) #UITableViewHeaderFooterView )

	#( #cellForRowAtIndexPath: #( #(indexPath handle) ) #UITableViewCell )
	#( #indexPathForCell: #( #(cell handle) ) #NSIndexPath )
	#( #indexPathForRowAtPoint: #( #(aCGPoint handle) ) #NSIndexPath )

	#( #scrollToRowAtIndexPath:atScrollPosition:animated: #( #(indexPath handle) #(scrollPosition handle) animated ))
	#( #scrollToNearestSelectedRowAtScrollPosition:animated: #( #(scrollPosition handle) animated ))

	#( #selectRowAtIndexPath:animated:scrollPosition: #( #(indexPath handle) animated #(scrollPosition handle)))
	#( #deselectRowAtIndexPath:animated: #( #(indexPath handle) animated))
	beginUpdates endUpdates
	#( #insertRowsAtIndexPaths:withRowAnimation: #( #(anArray handles) animation))
	#( #deleteRowsAtIndexPaths:withRowAnimation: #( #(anArray handles) animation))
	#( #moveRowAtIndexPath:toIndexPath: #( #(sourcePath handle) #(targetPath handle)))
	#( #insertSections:withRowAnimation: #( #(aNSIndexSet handle) animation))
	#( #deleteSections:withRowAnimation: #( #(aNSIndexSet handle) animation))
	#( #moveSection:toSection: #( source target ))

	#( #setEditing:animated: #( aBoolean animated ))

	reloadData reloadSectionIndexTitles
	#( #reloadRowsAtIndexPaths:withRowAnimation: #( #(anArray handles) animation))
	#( #reloadSections:withRowAnimation: #( #(aNSIndexSet handle) animation))

	#( #rectForSection: #( section ) #CGRect )
	#( #rectForRowAtIndexPath: #( #(indexPath handle) ) #CGRect )
	#( #rectForFooterInSection: #( section ) #CGRect )
	#( #rectForHeaderInSection: #( section ) #CGRect )
)!

! UITableView class methodsFor: #instantiation !
withFrame: aCGRect style: style
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithFrame: (CGRect instance: aCGRect) handle
		style: style)! !

! UITableView methodsFor: #update !
updatesDoing: aBlock

	^[	self beginUpdates.
		aBlock evaluate
	] ensure: [
		self endUpdates
	]! !

! UITableView methodsFor: #cells !
dequeueReusableCellWithIdentifier: identifier forIndexPath: aNSIndexPath

	^UITableViewCell @ (self handle
		dequeueReusableCellWithIdentifier: identifier
		forIndexPath: aNSIndexPath handle)! !

! UITableView methodsFor: #accessing !
visibleCells

	^self handle visibleCells collect: [:aHandle| UITableViewCell @ aHandle ]! !

! UITableView methodsFor: #accessing !
indexPathsForRowsInRect: aCGRect

	^(self handle
		indexPathsForRowsInRect: aCGRect handle
		) collect: [:aHandle| NSIndexPath @ aHandle ]! !

! UITableView methodsFor: #accessing !
indexPathsForVisibleRows

	^self handle indexPathsForVisibleRows
		collect: [:aHandle| NSIndexPath @ aHandle ]! !

! UITableView methodsFor: #accessing !
indexPathsForSelectedRows

	^self handle indexPathsForSelectedRows
		collect: [:aHandle| NSIndexPath @ aHandle ]! !

NSObject
	subclass: #UILocalizedIndexedCollation
	category: #UIKit!

UILocalizedIndexedCollation buildGetters: #(
	sectionIndexTitles
	sectionTitles
)!
UILocalizedIndexedCollation buildFunctions: #(
	#( #sectionForObject:collationStringSelector: #( #(object handle) selector ) )
	#( #sectionForSectionIndexTitleAtIndex: #( indexTitleIndex ) )
	#( #sortedArrayFromArray:collationStringSelector: #( array selector ) )
)!

! UILocalizedIndexedCollation class methodsFor: #singleton !
currentCollation
	" Return the instance of the current table view. "

	^self @ (self nativeClass basicAt: #currentCollation)! !

NSObject
	subclass: #UISearchDisplayController
	category: #UIKit!
UISearchDisplayController buildAccessors: #(
	searchResultsTitle
)!
UISearchDisplayController buildBooleanGetters: #(
	isActive displaysSearchBarInNavigationBar
)!
UISearchDisplayController buildTypedAccessors: #(
	#( delegate #NSObject )
	#( searchBar #UISearchBar )
	#( searchContentsController #UIViewController )
	#( searchResultsTableView #UITableView )
	#( searchResultsDataSource #NSObject )
	#( searchResultsDelegate #NSObject )
	#( navigationItem #UINavigationItem )
)!
UISearchDisplayController buildFunctions: #(
	#( #setActive:animated: #( visible animated ) )
)!

! UISearchDisplayController class methodsFor: #singleton !
withSearchBar: searchBar contentsController: viewController
	" Return the instance of the current table view. "

	^self @ (self nativeClass
		instanceWithSearchBar: searchBar handle
		contentsController: viewController handle)! !

UIScrollView subclass: #UITextView!
UITextView buildAccessors: #(
	dataDetectorTypes
	text
	textAlignment
	linkTextAttributes typingAttributes
)!
UITextView buildBooleanAccessors: #(
	allowsEditingTextAttributes
	clearsOnInsertion
	editable selectable
)!
UITextView buildTypedAccessors: #(
	#( attributedText #NSAttributedString )
	#( delegate #NSObject )
	#( font #UIFont )
	#( inputAccessoryView #UIView )
	#( inputView #UIView )
	#( selectedRange #NSRange )
	#( textColor #UIColor )
	#( textContainer #UITextContainer )
	#( textContainerInset #UIEdgeInsets )
	#( textStorage #NSTextStorage )
)!
UITextView buildTypedGetters: #(
	#( #layoutManager #NSLayoutManager )
)!
UITextView buildFunctions: #(
	#( #scrollRangeToVisible: #( #( aNSRange handle ) ) )
)!

! UITextView class methodsFor: #instantiation !
withFrame: aCGRect textContainer: textContainer
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithFrame: (CGRect instance: aCGRect) handle
		textContainer: textContainer handle)! !

"Reference:
	NSIndexPath UIKit Additions
	https://developer.apple.com/library/ios/documentation/UIKit/Reference/NSIndexPath_UIKitAdditions/Reference/Reference.html#//apple_ref/doc/uid/TP40007175
"!

(Smalltalk includesKey: #NSIndexPath) ifFalse: [
	NSObject subclass: #NSIndexPath category: #UIKit
]!
NSIndexPath "buildFastGetters:"buildNumberGetters: #( item row section )!

! NSIndexPath class methodsFor: #instantiation !
indexPathForRow: row inSection: section
	" Return an instance of the receiver. "

	^self @ (self nativeClass indexPathForRow: row inSection: section)! !

! NSIndexPath class methodsFor: #instantiation !
indexPathForItem: item inSection: section
	" Return an instance of the receiver. "

	^self @ (self nativeClass indexPathForItem: item inSection: section)! !

"End of	NSIndexPath UIKit Additions"!

UIView subclass: #UILabel!
UILabel buildAccessors: #(
	text
)!
UILabel buildBooleanAccessors: #(
	adjustsFontSizeToFitWidth
	enabled highlighted
	userInteractionEnabled
)!
UILabel buildNumberAccessors: #(
	numberOfLines
	baselineAdjustment
	lineBreakMode
	minimumScaleFactor
	preferredMaxLayoutWidth
	textAlignment
)!
UILabel buildTypedAccessors: #(
	#(font #UIFont)
	#(highlightedTextColor #UIColor)
	#(shadowColor #UIColor)
	#(textColor #UIColor)
	#(shadowOffset #CGSize)
)!
UILabel buildFunctions: #(
	#( #drawTextInRect: #( #(aCGRect handle) ) )
	#( #textRectForBounds:limitedToNumberOfLines: #( #(aCGRect handle) numberOfLines ) #CGRect )
)!

UIView subclass: #UISearchBar!
UISearchBar buildAccessors: #(
	text prompt placeholder
	seachBarStyle translucent
	scopeButtonTitles
)!
UISearchBar buildNumberAccessors: #(
	selectedScopeButtonIndex barStyle
	autocapitalizationType autocorrectionType
	spellCheckingType keyboardType
)!
UISearchBar buildBooleanAccessors: #(
	showsBookmarkButton
	showsCancelButton
	showsSearchResultsButton
	searchResultsButtonSelected
	showsScopeBar
)!
UISearchBar buildTypedAccessors: #(
	#( delegate #NSObject )
	#( tintColor #UIColor )
	#( barTintColor #UIColor )
	#( inputAccessoryView #UIView )
)!
UISearchBar buildFunctions: #(
	#( #setShowsCancelButton:animated: #( showsCancelButton animated ) )
)!

NSObject
	subclass: #UIBarItem
	category: #UIKit!
UIBarItem buildBooleanGetters: #(
	#enabled
)!
UIBarItem buildTypedAccessors: #(
	#( image #UIImage )
	#( imageInsets #UIEdgeInsets )
	#( landscapeImagePhone #UIImage )
	#( landscapeImagePhoneInsets #UIEdgeInsets )
)!
UIBarItem buildAccessors: #(
	#tag #title
)!

UIBarItem subclass: #UIBarButtonItem !
UIBarButtonItem buildAccessors: #(
	#action #style #width
)!
UIBarButtonItem buildTypedAccessors: #(
	#( customView #UIView )
	#( target #NSObject )
	#( tintColor #UIColor )
)!

! UIBarButtonItem class methodsFor: #instantiation !
withCustomView: anUIView
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithCustomView: anUIView handle)! !

! UIBarButtonItem class methodsFor: #instantiation !
withImage: image landscapeImagePhone: landscapeImagePhone style: style target: target action: action
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithImage: image json
		landscapeImagePhone: landscapeImagePhone json
		style: style
		target: target json
		action: action)! !

! UIBarButtonItem class methodsFor: #instantiation !
withImage: image style: style target: target action: action
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithImage: image json
		style: style
		target: target json
		action: action)! !

! UIBarButtonItem class methodsFor: #instantiation !
withImage: image target: target action: action
	" Return an instance of the receiver. "

	^self	withImage: image style: 0"UIBarButtonItemStylePlain"
		target: target action: action! !

! UIBarButtonItem class methodsFor: #instantiation !
withTitle: title style: style target: target action: action
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithTitle: title
		style: style
		target: target json
		action: action)! !

! UIBarButtonItem class methodsFor: #instantiation !
withTitle: title target: target action: action
	" Return an instance of the receiver. "

	^self	withTitle: title style: 0"UIBarButtonItemStylePlain"
		target: target action: action! !

! UIBarButtonItem class methodsFor: #instantiation !
withBarButtonSystemItem: systemItem target: target action: action
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithBarButtonSystemItem: systemItem
		target: target json
		action: action)! !

! UIBarButtonItem class methodsFor: #constants !
systemSelectors
	" Return the available system selectors. "

	^#(	done cancel
		edit save add
		flexibleSpace fixedSpace
		compose reply
		action organize
		bookmarks search
		refresh stop
		camera trash
		play pause rewind fastForward
		undo redo
		pageCurl
	)! !

! UIBarButtonItem class methodsFor: #constants !
unDocumentedSystemSelectors
	" Return the available system selectors. "

	^#(	locate
 		left right up down 
		arrowLeft arrowRight
		previousSlide nextSlide
	)! !

! UIBarButtonItem class methodsFor: #instantiation !
system: selector target: target action: action
	" Return an instance of the receiver. "

	| index |
	index := self systemSelectors indexOf: selector ifAbsent: [
		100 + (self unDocumentedSystemSelectors indexOf: selector ifAbsent: [
			^ self error: 'Invalid selector #',selector
				,' for system item in ', self name
		]).
	].
	^self	withBarButtonSystemItem: index - 1
		target: target action: action! !

! UIBarButtonItem class methodsFor: #instantiation !
system: selector
	" Return an instance of the receiver. "

	^self system: selector target: nil action: nil json! !

UIBarItem subclass: #UITabBarItem !
UITabBarItem buildAccessors: #(
	#badgeValue
)!
UITabBarItem buildTypedAccessors: #(
	#( selectedImage #UIImage )
)!

! UITabBarItem class methodsFor: #instantiation !
withTitle: title image: anUIImage selectedImage: selectedImage
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithTitle: title
		image: anUIImage json
		selectedImage: selectedImage json)! !

! UITabBarItem class methodsFor: #instantiation !
withTitle: title image: anUIImage tag: anInteger
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithTitle: title
		image: anUIImage json
		tag: anInteger)! !

NSObject
	subclass: #UINavigationItem
	category: #UIKit!
UINavigationItem buildBooleanAccessors: #(
	#hidesBackButton
	#leftItemsSupplementBackButton
)!
UINavigationItem buildTypedAccessors: #(
	#( backBarButtonItem #UIBarButtonItem )
	#( leftBarButtonItem #UIBarButtonItem )
	#( rightBarButtonItem #UIBarButtonItem )
	#( titleView #UIView )
)!
UINavigationItem buildAccessors: #(
	prompt title
)!
UINavigationItem buildFunctions: #(
	#(#setHidesBackButton:animated: #( aBoolean animated ) )
	#(#setLeftBackButtonItem:animated: #( #(item handle) animated ) )
	#(#setRightBackButtonItem:animated: #( #(item handle) animated ) )
)!

! UINavigationItem class methodsFor: #instantiation !
withTitle: title
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithTitle: title)! !

! UINavigationItem methodsFor: #accessing !
leftBarButtonItems
	" Return the leftBarButtonItems of the receiver. "

	^self handle leftBarButtonItems collect: [:each| UIBarButtonItem @ each ]! !

! UINavigationItem methodsFor: #accessing !
setLeftBarButtonItems: anArray animated: animated
	" Set the leftBarButtonItems of the receiver. "

	^self handle
		setLeftBarButtonItems: anArray asArray handles"(anArray asArray collect: [:each| each handle ])"
		animated: animated! !

! UINavigationItem methodsFor: #accessing !
rightBarButtonItems
	" Return the rightBarButtonItems of the receiver. "

	^self handle rightBarButtonItems collect: [:each| UIBarButtonItem @ each ]! !

! UINavigationItem methodsFor: #accessing !
setRightBarButtonItems: anArray animated: animated
	" Set the rightBarButtonItems of the receiver. "

	^self handle
		setRightBarButtonItems: anArray asArray handles"(anArray asArray collect: [:each| each handle ])"
		animated: animated! !

UIView subclass: #UINavigationBar!
UINavigationBar buildAccessors: #(
	#barStyle #items #titleTextAttributes
)!
UINavigationBar buildBooleanAccessors: #(
	#translucent
)!
UINavigationBar buildTypedGetters: #(
	#(topItem #UINavigationItem)
	#(backItem #UINavigationItem)
)!
UINavigationBar buildTypedAccessors: #(
	#( backIndicatorImage #UIImage )
	#( backIndicatorTransitionMaskImage #UIImage )
	#( backItem #UINavigationItem )
	#( barTintColor #UIColor )
	#( shadowImage #UIImage )
	#( tintColor #UIColor )
	#( topItem #UINavigationItem )
	#( delegate #NSObject )
)!
UINavigationBar buildFunctions: #(
	#(#pushNavigationItem:animated: #(#(item handle) animated))
	#(#popNavigationItemAnimated: #(animated) #UINavigationItem )
	#(#setItems:animated: #(#(items handles) animated))
	#(#backgroundImageForBarMetrics: #(metrics) #UIImage )
	#(#setBackgroundImage:forBarMetrics: #(#(image handle) metrics) )
	#(#backgroundImageForBarPosition:barMetrics: #(position metrics) #UIImage )
	#(#setBackgroundImage:forBarPosition:barMetrics: #(#(image handle) position metrics) )
	#(#titleVerticalPositionAdjustmentForBarMetrics: #(metrics))
	#(#setTitleVerticalPositionAdjustment:forBarMetrics: #(adjustment metrics))
	titleTextAttributes
)!

! UINavigationBar methodsFor: #accessing ! 
items
	^self handle itemscollect: [:each| UINavigationItem @ each ]! !

UIView subclass: #UIToolbar !
UIToolbar buildGetters: #(
	#barStyle
)!
UIToolbar buildTypedAccessors: #(
	#( barTintColor #UIColor )
	#( delegate #NSObject )
	#( tintColor #UIColor )
)!
UIToolbar buildBooleanAccessors: #(
	#translucent
)!
UIToolbar buildFunctions: #(
	#( #setBackgroundImage:forToolbarPosition:barMetrics: #( #(backgroundImage handle) topOrBottom barMetrics ))
	#( #setShadowImage:forToolbarPosition: #( #(shadowImage handle) topOrBottom ))
)!

! UIToolbar methodsFor: #accessing !
items
	" Return the items of the receiver. "

	^self handle items collect: [:each| UIBarButtonItem @ each ]! !

! UIToolbar methodsFor: #accessing !
setItems: array animated: aBoolean
	" Set the items of the receiver. "

	^self handle setItems: array handles animated: aBoolean! !

! UIToolbar methodsFor: #accessing !
items: array
	" Set the items of the receiver. "

	^self setItems: array animated: false! !

! UIToolbar methodsFor: #accessing !
backgroundImageForToolbarPosition: topOrBottom barMetrics: barMetrics
	" Return the image of the receiver. "

	^UIImage @ (self handle backgroundImageForToolbarPosition: topOrBottom barMetrics: barMetrics)! !

! UIToolbar methodsFor: #accessing !
shadowImageForToolbarPosition: topOrBottom
	" Return the image of the receiver. "

	^UIImage @ (self handle shadowImageForToolbarPosition: topOrBottom)! !

UIView subclass: #UIControl!
UIControl buildBooleanGetters: #(
	#isEnabled #isSelected
)!
UIControl buildFunctions: #(
	#(#actionsForTarget:forControlEvents: #( #(target handle) controlEvents ) )
	#(#addTarget:action:forControlEvents: #( #(target handle) aSelector controlEvents ) )
	#(#sendActionsForControlEvents: #( controlEvents ) )
	#(#sendAction:to:forEvent: #( aSelector #(target handle) #(event handle) ) )
	#allControlEvents
)!

! UIControl class methodsFor: #constants !
event: selector
	" Return the value for constant. "

	| k |
	k := 0.
	#(	touchDown touchDownRepeat
		touchDragInside touchDragOutside
		touchDragEnter touchDragExit
		touchUpInside touchUpOutside
		touchCancel
		12 valueChanged
		16 editingDidBegin editingChanged
		editingDidEnd editingDidEndOnExit
	) do: [:each|
		each isNumber ifTrue: [ k := each ].
		each = selector ifTrue: [ ^1 << k ].
		k := k + 1.
	].
	#(
		#(allTouchEvents 16r00000FFF)
		#(allEditingEvents 16r000F0000)
		#(applicationReserved 16r0F000000)
		#(systemReserved 16rF0000000)
		#(allEvents 16rFFFFFFFF)
	) do: [:tuple|
		selector = tuple last ifTrue: [ ^tuple first ].
	].
	self error: 'Constant not found UIControlEvent',selector asGlobalName! !

! UIControl class methodsFor: #constants !
state: selector
	" Return the value for constant. "

	| k |
	k := 0.
	#(	normal disabled selected
	) do: [:each|
		each isNumber ifTrue: [ k := each ].
		each = selector ifTrue: [ ^1 << k ].
		k := k + 1.
	].
	#(
		#(highlighted 0)
		#(application 16r00FF0000)
		#(reserved 16rFF000000)
	) do: [:tuple|
		selector = tuple last ifTrue: [ ^tuple first ].
	].
	self error: 'Constant not found UIControlState',selector asGlobalName! !

UIControl subclass: #UISwitch!
UISwitch buildBooleanGetters: #(
	#isOn
)!
UISwitch buildTypedAccessors: #(
	#(offImage #UIImage)
	#(onImage  #UIImage)
	#(tintColor #UIColor)	
	#(onTintColor #UIColor)	
	#(thumbTintColor #UIColor)
)!

UIControl subclass: #UISlider!
UISlider buildAccessors: #(
	#value #minimumValue #maximumValue
)!

UIControl subclass: #UIButton!
UIButton buildTypedGetters: #(
	#(titleLabel #UILabel)
	#(currentAttributedTitle #NSAttributedString)
	#(currentTitleColor #UIColor)
	#(currentTitleShadowColor #UIColor)
	#(currentImage #UIImage)
	#(currentBackgroundImage #UIImage)
	#(imageView #UIImageView)
)!
UIButton buildTypedAccessors: #(
	#(tintColor #UIColor)
	#(contentEdgeInsets #UIEdgeInsets)
	#(titleEdgeInsets #UIEdgeInsets)
	#(imageEdgeInsets #UIEdgeInsets)
)!
UIButton buildNumberGetters: #(
	buttonType
)!
UIButton buildGetters: #(
	currentTitle
)!
UIButton buildBooleanAccessors: #(
	reversesTitleShadowWhenHighlighted
	adjustsImageWhenHighlighted
	adjustsImageWhenDisabled
	showsTouchWhenHighlighted
)!
UIButton buildFunctions: #(
	#(#setImage:forState: #( #(anUIImage handle) state ))
	#(#setTitle:forState: #( aString state ))
	#(#titleForState: #( state ) )
	#(#attributedTitleForState: #( state ) #NSAttributedString)
	#(#setAttributedTitle:forState: #( #(aTitle handle) state ))
	#(#titleColorForState: #( state ) #UIColor)
	#(#setTitleColor:forState: #( #(color handle) state ))
	#(#titleShadowColorForState: #( state ) #UIColor)
	#(#setTitleShadowColor:forState: #( #(color handle) state ))
	#(#backgroundImageForState: #( state ) #UIImage)
	#(#imageForState: #( state ) #UIImage)
	#(#setBackgroundImage:forState: #( #(image handle) state ))
	#(#setImage:forState: #( #(image handle) state ))
	#(#backgroundRectForBounds: #( #(cgRect handle) ) #CGRect)
	#(#contentRectForBounds: #( #(cgRect handle) ) #CGRect)
	#(#titleRectForContentRect: #( #(cgRect handle) ) #CGRect)
	#(#imageRectForContentRect: #( #(cgRect handle) ) #CGRect)
)!

! UIButton class methodsFor: #instantiation !
withType: buttonType
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass buttonWithType: buttonType)! !


UIControl subclass: #UIRefreshControl!
UIRefreshControl buildTypedAccessors: #(
	#( attributedTitle #NSAttributedString )
	#( tintColor #UIColor )
)!
UIRefreshControl buildBooleanGetters: #(
	#refreshing
)!
UIRefreshControl buildFunctions: #(
	#beginRefreshing
	#endRefreshing
)!


UIControl subclass: #UITextField!
UITextField buildAccessors: #(
	text
 placeholder
	textAlignment
	typingAttributes
)!
UITextField buildBooleanAccessors: #(
	allowsEditingTextAttributes

	adjustsFontSizeToFitWidth

	clearsOnBeginEditing
	clearsOnInsertion
	editable
 selectable
)!

UITextField buildBooleanGetters: #(
	editing
)!
UITextField buildTypedAccessors: #(
	#( attributedText #NSAttributedString )
	#( delegate #NSObject )
	#( font #UIFont )
	#( inputAccessoryView #UIView )
	#( inputView #UIView )
	#( textColor #UIColor )
)!
UITextField buildFunctions: #(
	#( #drawTextInRect: #( #( rect handle ) ) )
)! !

NSObject
	subclass: #UIImage
	category: #UIKit!
UIImage class instanceVariableNames: #cache!
UIImage class buildAccessors: #(
	#(cache initialize #PoolDictionary)
)!

UIImage buildGetters: #(
	images
)!
UIImage buildNumberGetters: #(
	duration
	imageOrientation
	renderingMode
	resizingMode
	scale
)!
UIImage buildTypedGetters: #(
	#(alignmentRectInsets #UIEdgeInsets)
	#(capInsets #UIEdgeInsets)
	#(size #CGSize)
)!
UIImage buildFunctions: #(
	#(#drawAsPatternInRect: #( #(cgRect handle) ))
	#(#drawAtPoint: #( #(cgPoint handle) ))
	#(#drawAtPoint:blendMode:alpha: #( #(cgPoint handle) blendMode alpha ))
	#(#drawInRect: #( #(cgRect handle) ))
	#(#drawInRect:blendMode:alpha: #( #(cgRect handle) blendMode alpha ))
)!

! UIImage class methodsFor: #cache !
clearCache
	" Unbind the images in the cache. "

	cache := nil! !

! UIImage class methodsFor: #cache !
register: anInstance as: imageName
	" Private - Save the image in the cache. "

	^anInstance notNil ifTrue: [
		cache at: imageName put: anInstance
	]! !

! UIImage class methodsFor: #accessing !
named: imageName
	" Return an instance of the receiver(or nil).
	Note that the result will be cached in memory.
	"

	^self cache at: imageName ifAbsent: [
		self register: (self
			instanceNamed: imageName)
			as: imageName
	]! !

! UIImage class methodsFor: #instantiation !
instanceNamed: imageName
	" Private - Get the instance of the receiver named imageName(or nil). "

	imageName isNil ifTrue: [ ^nil ].
	imageName isString ifTrue: [
		^self @ (self nativeClass imageNamed: "'',"imageName)
	].
	imageName do: [:each| | result |
		result := self named: each.
		result notNil ifTrue: [ ^result ].
	].
	^nil! !

! UIImage class methodsFor: #instantiation !
withContentsOfFile: path
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass imageWithContentsOfFile: path)! !

! UIImage class methodsFor: #instantiation !
animatedImageNamed: imageName duration: duration
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass animatedImageNamed: imageName duration: duration)! !

! UIImage class methodsFor: #instantiation !
animatedImageWithImages: images duration: duration
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass animatedImageWithImages: images duration: duration)! !

! UIImage class methodsFor: #instantiation !
withData: data
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass imageWithData: data)! !

! UIImage class methodsFor: #instantiation !
withData: data scale: scale
	" Return an instance of the receiver(or nil). "

	^self @ (self nativeClass imageWithData: data scale: scale)! !

NSObject
	subclass: #UIMenuController
	category: #UIKit!
UIMenuController buildBooleanAccessors: #(
	menuVisible
)!
UIMenuController buildAccessors: #(
	arrowDirection 
)!
UIMenuController buildTypedAccessors: #(
	#( menuFrame #CGRect )
)!
UIMenuController buildFunctions: #(
	#( #setMenuVisible:animated: #( visible animated ) )
	#( #setTargetRect:inView: #( #(aCGRect handle) #(aView handle) ) )
	update
)!

! UIMenuController methodsFor: #accessing !
menuItems
	" Return the custom menu items for the editing menu. "

	| items |
	items := self handle menuItems.
	items isNil ifTrue: [ ^Array new ].
	^items collect: [:aHandle| UIMenuItem @ aHandle ]! !

! UIMenuController methodsFor: #accessing !
menuItems: anArray
	" Set the custom menu items for the editing menu. "

	"| handles |
	handles := anArray collect: [:each| each handle ]."
	self handle setMenuItems: anArray asArray handles! !

! UIMenuController class methodsFor: #singleton !
sharedMenuController
	" Return the(singleton) instance of the receiver. "

	^self @ (self nativeClass basicAt: #sharedMenuController)! !

NSObject
	subclass: #UIMenuItem
	category: #UIKit!
UIMenuItem buildAccessors: #(
	action title
)!
! UIMenuItem class methodsFor: #singleton !
withTitle: aTitle action: selector
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithTitle: aTitle action: selector)! !

"
NSObject
	subclass: #UIEvent
	category: #UIKit
"!

NSObject
	subclass: #UITouch
	category: #UIKit!
UITouch buildNumberGetters: #( tapCount )!
UITouch buildTypedGetters: #(
	#(view #UIView)
	#(window #UIWindow)
)!

! UITouch methodsFor: #accessing !
locationInView: anUIView

	^CGPoint @ (self handle locationInView: anUIView handle)! !

! UITouch methodsFor: #accessing !
previousLocationInView: anUIView

	^CGPoint @ (self handle previousLocationInView: anUIView handle)! !

NativeObject
	subclass: #UIKitDataType
	category: #UIKit!
#(	#UIEdgeInsets #UIOffset
) do: [:each| UIKitDataType subclass: each ]!

UIEdgeInsets buildAccessors: #( top left bottom right )!
UIOffset buildAccessors: #( horizontal vertical )!

!UIEdgeInsets class methodsFor: #instantiation !
zero
	^self new zero! !

!UIEdgeInsets class methodsFor: #instantiation !
top: top left: left bottom: bottom right: right
	^self new top: top left: left bottom: bottom right: right! !

!UIEdgeInsets methodsFor: #accessing !
top: top left: left bottom: bottom right: right
	handle := # #UIEdgeInsetsMake: top left: left bottom: bottom right: right! !

!UIEdgeInsets methodsFor: #initialize !
initializeHandle
	" Private - Initialize the handle of the receiver. "

	self top: 0 left: 0 bottom: 0 right: 0! !

!UIEdgeInsets methodsFor: #initialize !
zero
	" Private - Set the receiver to zero. "

	hanle := # #UIEdgeInsetsZero! !

!UIOffset class methodsFor: #instantiation !
zero
	^self new zero! !

!UIOffset methodsFor: #accessing !
horizontal: horizontal vertical: vertical
	handle := # #UIOffsetMake: horizontal vertical: vertical! !

!UIOffset methodsFor: #initialize !
initializeHandle
	" Private - Initialize the handle of the receiver. "

	self horizontal: 0 vertical: 0! !

!UIOffset methodsFor: #initialize !
zero
	" Private - Set the receiver to zero. "

	hanle := # #UIOffsetZero! !


NativeObject
	subclass: #UIKit
	category: #UIKit!
UIKit comment: '
	Implement access to a number of functions, many of them used in graphics and drawing operations.
	https://developer.apple.com/library/ios/documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html
'!

"TODO: We implemented here a minimal set of functions UIKit defines..."
#(	#Image #Movie #Graphics
	#PDF #Conversions
	#Edge #Offset
	#Accessibility
	#TextAlignment
) do: [:section| | clsName |
	clsName := #UIKit ,section.
	UIKit subclass: clsName.
	UIKit class
		implement: (section "asSmalltalkName: false"asLowercase)
		comment: 'Return the class to access UIKit ',section,' functions.'
		as: '^',clsName
		category: #accessing
]!

! UIKitImage class methodsFor: #functions !
jpegRepresentation: anUIImage compressionQuality: compressionQuality
	" Returns the data for the specified image in JPEG format. "

	^# #UIImageJPEGRepresentation: anUIImage handle compressionQuality: compressionQuality! !

! UIKitImage class methodsFor: #functions !
pngRepresentation: anUIImage
	" Returns the data for the specified image in PNG format. "

	^# #UIImagePNGRepresentation: anUIImage handle! !

! UIKitImage class methodsFor: #functions !
writeToSavedPhotosAlbum: anUIImage
	completionTarget: completionTarget
	completionSelector: completionSelector
	contextInfo: contextInfo
	" Add the image to the user’s Camera Roll album. "

	^# #UIImageWriteToSavedPhotosAlbum: anUIImage
		completionTarget: completionTarget
		completionSelector: completionSelector
		contextInfo: contextInfo! !

! UIKitGraphics class methodsFor: #functions !
getCurrentContext
	" Returns the current graphics context. "

	^CGContext @ # #UIGraphicsGetCurrentContext! !

! UIKitGraphics class methodsFor: #functions !
pushContext: aCGContext
	" Set the current graphics context. "

	^# #UIGraphicsPushContext: aCGContext handle! !

! UIKitGraphics class methodsFor: #functions !
popContext
	" Removes the current graphics context from the top of the stack, restoring the previous context. "

	^# #UIGraphicsPopContext! !

NSObject
	subclass: #UIDevice
	category: #UIKit!
UIDevice buildNumberGetters: #(
	batteryLevel
	batteryState
	orientation
	userInterfaceIdiom
)!
UIDevice buildBooleanGetters: #(
	batteryMonitoringEnabled
	generatesDeviceOrientationNotifications
	proximityMonitoringEnabled
	proximityState
	multitaskingSupported
)!
UIDevice buildTypedGetters: #(
	#( identifierForVendor #NSUUID )
)!
UIDevice buildGetters: #(
	model localizedModel
	name systemName systemVersion
)!
UIDevice buildFunctions: #(
	beginGeneratingDeviceOrientationNotifications
	endGeneratingDeviceOrientationNotifications
	playInputClick
)!

! UIDevice class methodsFor: #instantiation !
current
	" Returns the current device. "

	^self @ (self nativeClass basicAt: #currentDevice)! !

UIView subclass: #UIAlertView!
UIAlertView buildNumberGetters: #(
	firstOtherButtonIndex
	numberOfButtons
)!
UIAlertView buildBooleanGetters: #(
	visible
)!
UIAlertView buildNumberAccessors: #(
	alertViewStyle
	cancelButtonIndex
)!
UIAlertView buildAccessors: #(
	message title
)!
UIAlertView buildFunctions: #(
	#(#addButtonWithTitle: #( title ))
	#(#buttonTitleAtIndex: #( index ))
	#(#dismissWithClickedButtonIndex:animated: #( buttonIndex animated ))
	show
	#(#textFieldAtIndex: #( index ) #UITextField)
)!
UIAlertView  buildTypedAccessors: #(
	#( delegate #NSObject )
)!
! UIAlertView class methodsFor: #instantiation !
withTitle: title message: message
	delegate: aDelegate
	cancelButtonTitle: cancelButtonTitle
	otherButtonTitles: otherButtonTitles
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithTitle: title message: message
		delegate: aDelegate json
		cancelButtonTitle: cancelButtonTitle
		otherButtonTitles: otherButtonTitles)! !

! UIAlertView class methodsFor: #instantiation !
withTitle: title message: message
	cancelButtonTitle: cancelButtonTitle
	otherButtonTitles: otherButtonTitles
	" Return an instance of the receiver. "

	^self
		withTitle: title message: message
		delegate: nil
		cancelButtonTitle: cancelButtonTitle
		otherButtonTitles: otherButtonTitles! !

UIView subclass: #UIActionSheet!
UIActionSheet buildNumberGetters: #(
	firstOtherButtonIndex
	numberOfButtons
)!
UIActionSheet buildBooleanGetters: #(
	visible
)!
UIActionSheet buildNumberAccessors: #(
	actionSheetStyle
	cancelButtonIndex
	destructiveButtonIndex
)!
UIActionSheet buildAccessors: #(
	title
)!
UIActionSheet buildTypedAccessors: #(
	#( delegate #NSObject )
)!
UIActionSheet buildFunctions: #(
	#(#addButtonWithTitle: #( title ))
	#(#buttonTitleAtIndex: #( index ))
	#(#dismissWithClickedButtonIndex:animated: #( buttonIndex animated ))
	#(#showFromTabBar: #( #(view handle) ))
	#(#showFromToolbar: #( #(view handle) ))
	#(#showInView: #( #(view handle) ))
	#(#showFromBarButtonItem:animated: #( #(item handle) animated ))
	#(#showFromRect:inView:animated: #( #(rect handle) #(view handle) animated ))
)!

! UIActionSheet class methodsFor: #instantiation !
withTitle: title
	delegate: aDelegate
	cancelButtonTitle: cancelButtonTitle
	destructiveButtonTitle: destructiveButtonTitle
	otherButtonTitles: otherButtonTitles
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithTitle: title
		delegate: aDelegate json
		cancelButtonTitle: cancelButtonTitle json
		destructiveButtonTitle: destructiveButtonTitle json
		otherButtonTitles: otherButtonTitles)! !

! UIActionSheet class methodsFor: #instantiation !
withTitle: title
	cancelButtonTitle: cancelButtonTitle
	destructiveButtonTitle: destructiveButtonTitle
	otherButtonTitles: otherButtonTitles
	" Return an instance of the receiver. "

	^self
		withTitle: title delegate: nil
		cancelButtonTitle: cancelButtonTitle
		destructiveButtonTitle: destructiveButtonTitle
		otherButtonTitles: otherButtonTitles! !

UIView subclass: #UIActivityIndicatorView!
UIActivityIndicatorView buildTypedAccessors: #(
	#( color #UIColor)
)!
UIActivityIndicatorView buildBooleanGetters: #(
	isAnimating
)!
UIActivityIndicatorView buildNumberAccessors: #(
	activityIndicatorViewStyle
)!
UIActivityIndicatorView buildBooleanAccessors: #(
	hidesWhenStopped
)!
UIActivityIndicatorView buildFunctions: #(
	startAnimating
	stopAnimating
)!

! UIActivityIndicatorView class methodsFor: #instantiation !
withActivityIndicatorStyle: style
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithActivityIndicatorStyle: style)! !

UIView subclass: #UIProgressView!
UIProgressView buildTypedAccessors: #(
	#(progressTintColor #UIColor)
	#(progressImage #UIImage)
	#(trackTintColor #UIColor)
	#(trackImage #UIImage)
)!
UIProgressView buildNumberAccessors: #(
	progress
	progressViewStyle
	
)!
UIProgressView buildFunctions: #(
	#(#setProgress:animated: #( progress animated ))
)!

! UIProgressView class methodsFor: #instantiation !
withProgressViewStyle: style
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithProgressViewStyle: style)! !

! UIProgressView class methodsFor: #constants !
styles
	" Return the style constants names. "

	^#(#UIProgressViewStyleDefault #UIProgressViewStyleBar)! !

! UIProgressView class methodsFor: #constants !
style: aString
	" Return the style constant value for the name aString "

	^(self styles indexOf: aString) - 1! !

UIScrollView subclass: #UICollectionView!
UICollectionView buildNumberGetters: #(
	 #numberOfSections
)!
UICollectionView buildTypedAccessors: #(
	#( delegate #NSObject )
	#( dataSource #NSObject )
	#( backgroundView #UIView )
	#( collectionViewLayout #UICollectionViewLayout )
)!
UICollectionView buildBooleanAccessors: #(
	allowsSelection allowsMultipleSelection
)!
UICollectionView buildFunctions: #(
	#( #registerClass:forCellWithReuseIdentifier: #( #(aClass nativeClass) identifier ))
	#( #registerNib:forCellWithReuseIdentifier: #( #(nib handle) identifier ))
	#( #registerClass:forSupplementaryViewOfKind:withReuseIdentifier: #( #(aClass nativeClass) elementKind identifier ))
	#( #registerNib:forSupplementaryViewOfKind:withReuseIdentifier: #( #(nib handle) elementKind identifier ))
	#( #dequeueReusableCellWithReuseIdentifier:forIndexPath: #( identifier #(indexPath handle)) #UICollectionReusableView )
	#( #dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath: #( elementKind identifier #(indexPath handle)) #UICollectionReusableView )
	#( #setCollectionViewLayout:animated: #( #(layout handle) animated ))
	#( #setCollectionViewLayout:animated:completion: #( #(layout handle) animated #(completion handle)))
	#( #startInteractiveTransitionToCollectionViewLayout:completion: #( #(layout handle) #(completion handle)))
	finishInteractiveTransition
	cancelInteractiveTransition
	reloadData
	#( #reloadSections: #( #(sections handle) ))
	#( #reloadItemsAtIndexPaths: #( #(indexPaths handles) ))
	#( #numberOfItemsInSection: #( section ))
	#( #insertItemsAtIndexPaths: #( #(indexPaths handles) ))
	#( #moveItemAtIndexPath:toIndexPath: #( #(sourcePath handle) #(targetPath handle)))
	#( #deleteItemsAtIndexPaths: #( #(indexPaths handles) ))
	#( #insertSections: #( #(sections handle) ))
	#( #moveSection:toSection: #( source target ))
	#( #deleteSections: #( #(sections handle) ))
	#( #selectItemAtIndexPath:animated:scrollPosition: #( #(indexPath handle) animated scrollPosition ))
	#( #deselectItemAtIndexPath:animated: #( #(indexPath handle) animated ))
	#( #indexPathForItemAtPoint: #( #(point handle)) #NSIndexPath )
	#( #indexPathForCell: #( #(cell handle)) #NSIndexPath )
	#( #cellForItemAtIndexPath: #( #(indexPath handle)) #UICollectionViewCell )
	#( #layoutAttributesForItemAtIndexPath: #( #(indexPath handle)) #UICollectionViewLayoutAttributes )
	#( #layoutAttributesForSupplementaryElementOfKind:atIndexPath: #( kind #(indexPath handle)) #UICollectionViewLayoutAttributes )
	#( #scrollToItemAtIndexPath:atScrollPosition:animated: #( #(indexPath handle) scrollPosition animated))
	#( #performBatchUpdates:completion: #( #(updates handle) #(completion handle)))
)!

! UICollectionView class methodsFor: #instantiation !
withFrame: aCGRect collectionViewLayout: layout
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithFrame: (CGRect instance: aCGRect) handle
		collectionViewLayout: layout handle)! !

! UICollectionView methodsFor: #accessing !
visibleCells

	^self handle visibleCells collect: [:aHandle| UICollectionViewCell @ aHandle ]! !

! UICollectionView methodsFor: #accessing !
indexPathsForSelectedItems

	^self handle indexPathsForSelectedItems collect: [:aHandle| NSIndexPath @ aHandle ]! !

! UICollectionView methodsFor: #accessing !
indexPathsForVisibleItems

	^self handle indexPathsForVisibleItems collect: [:aHandle| NSIndexPath @ aHandle ]! !


NSObject
	subclass: #UICollectionViewLayout
	category: #UIKit!
UICollectionViewLayout buildTypedGetters: #(
	#( collectionView #UICollectionView )
	#( collectionViewContentSize #CGSize )
)!
UICollectionViewLayout buildFunctions: #(
	prepareLayout invalidateLayout
	finalizeCollectionViewUpdates finalizeAnimatedBoundsChange finalizeLayoutTransition
	#(#layoutAttributesForItemAtIndexPath: #( #(indexPath handle) ))
	#(#layoutAttributesForSupplementaryViewOfKind:atIndexPath: #( kind #(indexPath handle)) #UICollectionViewLayoutAttributes)
	#(#layoutAttributesForDecorationViewOfKind:atIndexPath: #( kind #(indexPath handle)) #UICollectionViewLayoutAttributes)
	#(#targetContentOffsetForProposedContentOffset: #( #(cgPoint handle)) #CGPoint)
	#(#targetContentOffsetForProposedContentOffset:withScrollingVelocity: #( #(offset handle) #(velocity handle)) #CGPoint)
	#(#prepareForCollectionViewUpdates: #( #(updateItems handles) ))
	#(#initialLayoutAttributesForAppearingItemAtIndexPath: #( #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath: #( kind #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#initialLayoutAttributesForAppearingSupplementaryElementOfKind:atIndexPath: #( kind #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#finalLayoutAttributesForDisappearingItemAtIndexPath: #( #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#finalLayoutAttributesForDisappearingSupplementaryElementOfKind:atIndexPath: #( kind #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#finalLayoutAttributesForDisappearingDecorationElementOfKind:atIndexPath: #( kind #(itemIndexPath handle)) #UICollectionViewLayoutAttributes )
	#(#invalidateLayoutWithContext: #( #(anUICollectionViewLayoutInvalidationContext handle) ))
	#(#shouldInvalidateLayoutForBoundsChange: #( #(newBounds handle) ) #Boolean)
	#(#invalidationContextForBoundsChange: #( #(newBounds handle)) #UICollectionViewLayoutInvalidationContext )
	#(#shouldInvalidateLayoutForPreferredLayoutAttributes:withOriginalAttributes: #( #(preferredAttributes handle) #(originalAttributes handle) ) #Boolean)
	#(#invalidationContextForPreferredLayoutAttributes:withOriginalAttributes: #( #(preferredAttributes handle) #(originalAttributes handle)) #UICollectionViewLayoutInvalidationContext )
	#(#prepareForAnimatedBoundsChange: #(#(oldBounds handle)))
	#(#prepareForTransitionFromLayout: #(#(layout handle)))
	#(#prepareForTransitionToLayout: #(#(layout handle)))
	#(#registerClass:forDecorationViewOfKind: #(#(aClass nativeClass) kind))
	#(#registerNib:forDecorationViewOfKind: #(#(anUINib handle) kind))
)!

! UICollectionViewLayout class methodsFor: #accessing !
invalidationContextClass

	^self nativeClass basicAt: #invalidationContextClass! !

! UICollectionViewLayout class methodsFor: #accessing !
layoutAttributesClass

	^self nativeClass basicAt: #layoutAttributesClass! !

! UICollectionViewLayout methodsFor: #accessing !
layoutAttributesForElementsInRect: aCGRect

	^(self handle
		layoutAttributesForElementsInRect: (CGRect instance: aCGRect) handle
		) collect: [:each| UICollectionViewLayoutAttributes @ each ]! !

! UICollectionViewLayout methodsFor: #accessing !
indexPathsToInsertForSupplementaryViewOfKind: kind

	^(self handle
		indexPathsToInsertForSupplementaryViewOfKind: kind
		) collect: [:each| NSIndexPath @ each ]! !

! UICollectionViewLayout methodsFor: #accessing !
indexPathsToInsertForDecorationViewOfKind: kind

	^(self handle
		indexPathsToInsertForDecorationViewOfKind: kind
		) collect: [:each| NSIndexPath @ each ]! !

! UICollectionViewLayout methodsFor: #accessing !
indexPathsToDeleteForSupplementaryViewOfKind: kind

	^(self handle
		indexPathsToDeleteForSupplementaryViewOfKind: kind
		) collect: [:each| NSIndexPath @ each ]! !

! UICollectionViewLayout methodsFor: #accessing !
indexPathsToDeleteForDecorationViewOfKind: kind

	^(self handle
		indexPathsToDeleteForDecorationViewOfKind: kind
		) collect: [:each| NSIndexPath @ each ]! !

UICollectionViewLayout subclass: #UICollectionViewFlowLayout!
UICollectionViewFlowLayout buildNumberAccessors: #(
	minimumLineSpacing
	minimumInteritemSpacing
	scrollDirection
)!
UICollectionViewFlowLayout buildTypedAccessors: #(
	#(sectionInset #UIEdgeInsets)
	#(headerReferenceSize #CGSize)
	#(footerReferenceSize #CGSize)
	#(itemSize #CGSize)
	#(estimatedItemSize #CGSize)
)!

UICollectionViewLayout subclass: #UICollectionViewTransitionLayout!
UICollectionViewTransitionLayout buildNumberAccessors: #(
	transitionProgress
	
)!
UICollectionViewTransitionLayout buildTypedGetters: #(
	#(currentLayout #UICollectionViewLayout)
	#(nextLayout #UICollectionViewLayout)
)!
UICollectionViewTransitionLayout buildFunctions: #(
	#(#updateValue:forAnimatedKey: #(value key))
	#(#valueForAnimatedKey: #(key))
)!

! UICollectionViewTransitionLayout class methodsFor: #instantiation !
withCurrentLayout: currentLayout nextLayout: newLayout

	^self @ (self nativeClass
		instanceWithCurrentLayout: currentLayout handle
		nextLayout: newLayout handle)! !

UIView subclass: #UICollectionReusableView!
UICollectionReusableView buildGetters: #(
	reuseIdentifier
)!
UICollectionReusableView buildFunctions: #(
	prepareForReuse
	#(#preferredLayoutAttributesFittingAttributes: #(#(layoutAttributes handle)) #UICollectionViewLayoutAttributes)
	#(#applyLayoutAttributes: #(#(layoutAttributes handle)))
	#(#willTransitionFromLayout:toLayout: #(#(oldLayout handle) #(newLayout handle)))
	#(#didTransitionFromLayout:toLayout: #(#(oldLayout handle) #(newLayout handle)))
)!

UICollectionReusableView subclass: #UICollectionViewCell!
UICollectionViewCell buildTypedGetters: #(
	#(contentView #UIView)
	#(backgroundView #UIView)
	#(selectedBackgroundView #UIView)
)!
UICollectionViewCell buildBooleanAccessors: #(
	selected highlighted
)!

NSObject
	subclass: #UICollectionViewLayoutAttributes
	category: #UIKit!
UICollectionViewLayoutAttributes buildTypedAccessors: #(
	#(indexPath #NSIndexPath)
	#(frame #CGRect)
	#(bounds #CGRect)
	#(center #CGPoint)
	#(size   #CGPoint)
	#(transform3D #CATransform3D)
	#(transform #CGAffineTransform)
)!
UICollectionViewLayoutAttributes buildBooleanAccessors: #(
	hidden
)!
UICollectionViewLayoutAttributes buildGetters: #(
	representedElementCategory
	representedElementKind
	alpha
	zIndex
)!

! UICollectionViewLayoutAttributes class methodsFor: #instantiation !
layoutAttributesForCellWithIndexPath: aNSIndexPath
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		layoutAttributesForCellWithIndexPath: aNSIndexPath handle)! !

! UICollectionViewLayoutAttributes class methodsFor: #instantiation !
layoutAttributesForSupplementaryViewOfKind: kind withIndexPath: aNSIndexPath
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		layoutAttributesForSupplementaryViewOfKind: kind
		withIndexPath: aNSIndexPath handle)! !

! UICollectionViewLayoutAttributes class methodsFor: #instantiation !
layoutAttributesForDecorationViewOfKind: kind withIndexPath: aNSIndexPath
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		layoutAttributesForDecorationViewOfKind: kind
		withIndexPath: aNSIndexPath handle)! !

NSObject
	subclass: #UIFont
	instanceVariableNames: ''
	classVariableNames: #StyleNames
	category: #UIKit!
UIFont buildTypedGetters: #(
	#(fontDescriptor #UIFontDescriptor )
)!
UIFont buildGetters: #(
	familyName fontName
	pointSize ascender descender
	leading capHeight xHeight
	lineHeight
)!
UIFont buildFunctions: #(
	#(#fontWithSize: #(fontSize) #UIFont)
)!

! UIFont class methodsFor: #instantiation !
boldSystemFontOfSize: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass boldSystemFontOfSize: fontSize)! !

! UIFont class methodsFor: #instantiation !
fontWithName: fontName size: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass fontWithName: fontName size: fontSize)! !

! UIFont class methodsFor: #accessing !
buttonFontSize
	" Returns the standard font size used for buttons. "

	^self nativeClass basicAt: #buttonFontSize! !

! UIFont class methodsFor: #accessing !
labelFontSize
	" Returns the standard font size used for labels. "

	^self nativeClass basicAt: #labelFontSize! !

! UIFont class methodsFor: #accessing !
smallSystemFontSize
	" Returns the size of the standard small system font. "

	^self nativeClass basicAt: #smallSystemFontSize! !

! UIFont class methodsFor: #accessing !
familyNames
	" Returns an array of font family names available on the system. "

	^self nativeClass basicAt: #familyNames! !

! UIFont class methodsFor: #accessing !
fontNamesForFamilyName: familyName
	" Returns an array of font names available in a particular font family. "

	^self nativeClass fontNamesForFamilyName: familyName! !

! UIFont class methodsFor: #instantiation !
italicSystemFontOfSize: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass italicSystemFontOfSize: fontSize)! !

! UIFont class methodsFor: #instantiation !
systemFontOfSize: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass systemFontOfSize: fontSize)! !

! UIFont class methodsFor: #constants !
styleString: aName
	" Private - Returns the name for constant of style. "

	StyleNames isNil ifTrue: [ StyleNames := PoolDictionary new ].
	^StyleNames at: aName ifAbsentPut: [
		Smalltalk nativeObjectAt: aName ifAbsent: [
			self error: 'Invalid style name ',aName printString
		]
	]! !

! UIFont class methodsFor: #instantiation !
preferredFontForTextStyle: aName
	" Returns an instance of the receiver associated with the text style and scaled appropriately for the users selected content size category. "

	^self @ (self nativeClass preferredFontForTextStyle: (self styleString: aName))! !

! UIFont class methodsFor: #instantiation !
style: style
	" Return an instance of the receiver. "

	style = #headline ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleHeadline ].
	style = #subheadline ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleSubheadline ].
	style = #body ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleBody ].
	style = #footnote ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleFootnote ].
	style = #caption  ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleCaption1 ].
	style = #caption1 ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleCaption1 ].
	style = #caption2 ifTrue: [ ^self preferredFontForTextStyle: #UIFontTextStyleCaption2 ].
	^self error: 'Invalid/unknown style #',style! !

! UIFont class methodsFor: #instantiation !
body
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleBody! !

! UIFont class methodsFor: #instantiation !
headline
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleHeadline! !

! UIFont class methodsFor: #instantiation !
subheadline
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleSubheadline! !

! UIFont class methodsFor: #instantiation !
footnote
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleFootnote! !

! UIFont class methodsFor: #instantiation !
caption
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleCaption1! !

! UIFont class methodsFor: #instantiation !
caption1
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleCaption1! !

! UIFont class methodsFor: #instantiation !
caption2
	" Return an instance of the receiver. "

	^self preferredFontForTextStyle: #UIFontTextStyleCaption2! !

! UIFont class methodsFor: #instantiation !
fontWithName: fontName size: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		fontWithName: fontName
		size: fontSize)! !

! UIFont class methodsFor: #instantiation !
boldSystemFontOfSize: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass boldSystemFontOfSize: fontSize)! !

! UIFont class methodsFor: #instantiation !
italicSystemFontOfSize: fontSize
	" Return an instance of the receiver. "

	^self @ (self nativeClass italicSystemFontOfSize: fontSize)! !

! UIFont class methodsFor: #constants !
familyNames

	^self nativeClass basicAt: #familyNames! !

! UIFont class methodsFor: #constants !
fontNamesForFamilyName: familyName

	^self nativeClass fontNamesForFamilyName: familyName! !

! UIFont class methodsFor: #constants !
labelFontSize

	^self nativeClass basicAt: #labelFontSize! !

! UIFont class methodsFor: #constants !
buttonFontSize

	^self nativeClass basicAt: #buttonFontSize! !

! UIFont class methodsFor: #constants !
smallSystemFontSize

	^self nativeClass basicAt: #smallSystemFontSize! !

! UIFont class methodsFor: #constants !
systemFontSize

	^self nativeClass basicAt: #systemFontSize! !

! UIFont class methodsFor: #constants !
fontWithDescriptor: descriptor size: pointSize

	^self @ (self nativeClass
		fontWithDescriptor: descriptor handle
		size: pointSize)! !


NSObject
	subclass: #UITextInputMode
	category: #UIKit!
UITextInputMode buildGetters: #(
	primaryLanguage
)!

! UITextInputMode class methodsFor: #accessing !
activeInputModes

	^self nativeClass activeInputModes
		collect: [:each| self @ each ]! !


UIViewController subclass: #UISplitViewController!
UISplitViewController buildBooleanAccessors: #(
	presentsWithGesture
)!
UITextInputMode buildNumberAccessors: #(
	preferredDisplayMode
	preferredPrimaryColumnWidthFraction
	minimumPrimaryColumnWidth
	maximumPrimaryColumnWidth
)!
UITextInputMode buildTypedAccessors: #(
	#(displayModeButtonItem #UIBarButtonItem)
	#(delegate #NSObject)
)!
UITextInputMode buildGetters: #(
	displayMode
)!
UITextInputMode buildBooleanGetters: #(
	collapsed
)!
UITextInputMode buildNumberGetters: #(
	primaryColumnWidth
)!
UITextInputMode buildFunctions: #(
	#(#showDetailViewController:sender: #( #(vc handle) #(sender handle) ))
	#(#showViewController:sender: #( #(vc handle) #(sender handle) ))
)!

! UISplitViewController methodsFor: #accessing !
viewControllers

	^self handle viewControllers collect: [:each| UIViewController @ each ]! !


UIView subclass: #UITableViewHeaderFooterView!
UITableViewHeaderFooterView buildGetters: #(
	reuseIdentifier
)!
UITableViewHeaderFooterView buildTypedGetters: #(
	#(contentView #UIView)
	#(backgroundView #UIView)
	#(textLabel #UILabel)
	#(detailTextLabel #UILabel)
)!
UITableViewHeaderFooterView buildTypedAccessors: #(
	#(tintColor #UIColor)
)!
UITableViewHeaderFooterView buildFunctions: #(
	prepareForReuse
)!

! UITableViewHeaderFooterView class methodsFor: #instantiation !
withReuseIdentifier: reuseIdentifier
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithReuseIdentifier: reuseIdentifier)! !

NSObject
	subclass: #UICollectionViewLayoutInvalidationContext
	category: #UIKit!
UICollectionViewLayoutInvalidationContext buildBooleanGetters: #(
	invalidateEverything
	invalidateDataSourceCounts
)!
UICollectionViewLayoutInvalidationContext buildTypedAccessors: #(
	#(contentOffsetAdjustment #CGPoint)
)!
UICollectionViewLayoutInvalidationContext buildFunctions: #(
	#(#invalidateItemsAtIndexPaths: #( #(indexPaths handles) ))
	#(#invalidateSupplementaryElementsOfKind:atIndexPaths: #( king #(indexPaths handles) ))
	#(#invalidateDecorationElementsOfKind:atIndexPaths: #( king #(indexPaths handles) ))
)!

! UICollectionViewLayoutInvalidationContext methodsFor: #accessing !
invalidatedItemIndexPaths

	^self handle invalidatedItemIndexPaths collect: [:each| NSIndexPath @ each ]! !

NSMutableAttributedString subclass: #NSTextStorage!
NSTextStorage buildBooleanGetters: #(
	fixesAttributesLazily
)!
NSTextStorage buildTypedAccessors: #(
	#(delegate #NSObject)
	#(editedRange #NSRange)
)!
NSTextStorage buildNumberAccessors: #(
	editedMask
	changeInLength
)!
NSTextStorage buildFunctions: #(
	#(#edited:range:changeInLength: #(editedMask #(editedRange handle) delta) )
	#(#ensureAttributesAreFixedInRange: #( #(range handle) ) )
	#(#invalidateAttributesInRange: #( #(range handle) ) )
        processEditing
	#(#addLayoutManager: #( #(aLayoutManager handle) ) )
	#(#removeLayoutManager: #( #(aLayoutManager handle) ) )
)!

! NSTextStorage methodsFor: #accessing !
invalidatedItemIndexPaths

	^self handle layoutManagers collect: [:each| NSLayoutManager @ each ]! !

NSObject
	subclass: #UIGestureRecognizer
	category: #UIKit!

UIGestureRecognizer buildGetters: #(
	state
)!
UIGestureRecognizer buildNumberAccessors: #(
	numberOfTouches
)!
UIGestureRecognizer buildBooleanAccessors: #(
	enabled
	cancelsTouchesInView
	delaysTouchesBegan
	delaysTouchesEnded
)!
UIGestureRecognizer buildTypedGetters: #(
	#( view #UIView )
)!
UIGestureRecognizer buildTypedAccessors: #(
	#( delegate #NSObject )
)!
UIGestureRecognizer buildFunctions: #(
	#(#addTarget:action: #(#(target handle) action ))
	#(#removeTarget:action: #(#(target handle) #(actionOrNil json)))
	#(#locationInView: #(#(view handle)) #CGPoint)
	#(#locationOfTouch:inView: #(index #(view handle)) #CGPoint)
	#(#requireGestureRecognizerToFail: #(#(otherGestureRecognizer handle)))
)!

! UIGestureRecognizer class methodsFor: #instantiation !
withTarget: target action: selector

	^self @ (self nativeClass
		instanceWithTarget: target handle
		action: selector)! !

UIGestureRecognizer subclass: #UILongPressGestureRecognizer!
UILongPressGestureRecognizer buildNumberAccessors: #(
	minimumPressDuration
	numberOfTouchesRequired
	numberOfTapsRequired
	allowableMovement
)!

UIGestureRecognizer subclass: #UIPanGestureRecognizer!
UIPanGestureRecognizer buildNumberAccessors: #(
	maximumNumberOfTouches
	minimumNumberOfTouches
)!
UIPanGestureRecognizer buildFunctions: #(
	#(#translationInView: #(#(view handle)) #CGPoint)
	#(#velocityInView: #(#(view handle)) #CGPoint)
	#(#setTranslation:inView: #(#(translation handle) #(view handle)) )
)!

UIPanGestureRecognizer subclass: #UIScreenEdgePanGestureRecognizer!
UIScreenEdgePanGestureRecognizer buildNumberAccessors: #(
	edges
)!

UIGestureRecognizer subclass: #UIPinchGestureRecognizer!
UIPinchGestureRecognizer buildNumberAccessors: #(
	scale
	velocity
)!

UIGestureRecognizer subclass: #UIRotationGestureRecognizer!
UIRotationGestureRecognizer buildNumberAccessors: #(
	rotation
	velocity
)!

UIGestureRecognizer subclass: #UISwipeGestureRecognizer!
UISwipeGestureRecognizer buildNumberAccessors: #(
	direction
	numberOfTouchesRequired
)!

UIGestureRecognizer subclass: #UITapGestureRecognizer!
UITapGestureRecognizer buildNumberAccessors: #(
	numberOfTapsRequired
	numberOfTouchesRequired
)!

NSObject
	subclass: #UIPresentationController
	category: #UIKit!
UIPresentationController buildTypedAccessors: #(
	#( delegate #NSObject )
)!
UIPresentationController buildTypedGetters: #(
	#( presentingViewController #UIViewController )
	#( presentedViewController #UIViewController )
	#( containerView #UIView )
	#( presentedView #UIView )
)!
UIPresentationController buildTypedAccessors: #(
	#( frameOfPresentedViewInContainerView #CGRect )
	#( overrideTraitCollection #UITraitCollection )
)!
UIPresentationController buildNumberGetters: #(
	presentationStyle
)!
UIPresentationController buildFunctions: #(
	adaptivePresentationStyle
	containerViewWillLayoutSubviews
	containerViewDidLayoutSubviews
	dismissalTransitionWillBegin
	presentationTransitionWillBegin
	#(#dismissalTransitionDidEnd: #(completed))
	#(#presentationTransitionDidEnd: #(completed))
	#(shouldPresentInFullscreen #() #Boolean)
	#(shouldRemovePresentersView #() #Boolean)
)!

! UIPresentationController class methodsFor: #instantiation !
withPresentedViewController: presentedViewController
	presentingViewController: presentingViewController
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithPresentedViewController: presentedViewController handle
		presentingViewController: presentingViewController handle)! !

UIPresentationController subclass: #UIPopoverPresentationController!
UIPopoverPresentationController buildTypedAccessors: #(
	#( delegate #NSObject )
	#( popoverLayoutMargins #UIEdgeInsets )
	#( backgroundColor #UIColor )
	#( barButtonItem #UIBarButtonItem )
	#( sourceView #UIView )
	#( sourceRect #CGRect )
)!
UIPopoverPresentationController buildAccessors: #(
	passthroughViews
	popoverBackgroundViewClass
)!
UIPopoverPresentationController buildNumberAccessors: #(
	permittedArrowDirections
)!
UIPopoverPresentationController buildNumberGetters: #(
	arrowDirection
)!

UIViewController subclass: #UIActivityViewController !
UIActivityViewController buildAccessors: #(
	excludedActivityTypes
)!

! UIActivityViewController class methodsFor: #instantiation !
withActivityItems: activityItems applicationActivities: applicationActivities
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithActivityItems: activityItems
		applicationActivities: applicationActivities handles)! !

NSObject
	subclass: #UIActivity
	category: #UIKit!
UIActivity buildAccessors: #(
	activityType
	activityTitle
)!
UIActivity buildTypedAccessors: #(
	#( activityImage #UIImage )
)!
UIActivity buildFunctions: #(
	#(#canPerformWithActivityItems: #( #(activityItems handles) ) #Boolean)
	#(#prepareWithActivityItems: #( #(activityItems handles) ))
	#(#activityViewController #() #UIViewController )
	#performActivity
	#(#activityDidFinish: #( completed ))
)!

! UIActivity class methodsFor: #accessing !
activityCategory
	" Returns the category(enum) of the receiver, which may be used to group activities in the UI. "

	^self nativeClass basicAt: #activityCategory! !

! UIActivity class methodsFor: #constants !
types: literal
	" Returns a collection with constants for types in literal. "

	| map |
	literal isString ifTrue: [
		^self types: literal asArrayOfSubstrings
	].
	map := self appleActivityTypes.
	^literal asArray collect: [:each|
		map at: each asLowercase ifAbsent: [ each ]
	]! !

! UIActivity class methodsFor: #constants !
appleActivityTypes
	" Private - Return the activity types constants registered by Apple. "

	| apple |
	apple := 'com.apple.UIKit.activity.'.
	^PoolDictionary fromTuples: (#(
		#PostToFacebook #PostToTwitter #PostToWeibo
		#Message #Mail #Print #CopyToPasteboard
		#AssignToContact #SaveToCameraRoll #AddToReadingList
		#PostToFlickr #PostToVimeo #PostToTencentWeibo
		#AirDrop
	) collect: [:each| Array with: each asLowercase with: apple,each ])! !

NSOperation
	subclass: #UIActivityItemProvider
	category: #UIKit!
UIActivityItemProvider buildTypedAccessors: #(
	#( item #NSObject )
)!
UIActivityItemProvider buildTypedGetters: #(
	#( placeholderItem #NSObject )
)!
UIActivityItemProvider buildGetters: #(
	activityType
)!

! UIActivityItemProvider class methodsFor: #instantiation !
withPlaceholderItem: placeholderItem
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithPlaceholderItem: (self handleOf: placeholderItem))! !


UIView subclass: #UIWebView!

UIWebView buildTypedAccessors: #(
	#(delegate #NSObject)
)!
UIWebView buildTypedGetters: #(
	#(request #NSURLRequest)
	#(scrollView #UIScrollView)
)!
UIWebView buildFunctions: #(
	"#(#loadData:MIMEType:textEncodingName:baseURL: #( #(data handle) mimeType encodingName #(baseURL handle) ))
	"#(#loadHTMLString:baseURL: #( string #(baseURL handle) ))
	#(#loadRequest: #( #(request handle) ))
	reload stopLoading
	goBack goForward
	#(#stringByEvaluatingJavaScriptFromString: #(string))
)!
UIWebView buildBooleanGetters: #(
	isLoading
	canGoBack canGoForward
)!
UIWebView buildBooleanAccessors: #(
	scalesPageToFit
	suppressesIncrementalRendering
	keyboardDisplayRequiresUserAction
	allowsInlineMediaPlayback
	mediaPlaybackRequiresUserAction
	mediaPlaybackAllowsAirPlay
)!
UIWebView buildNumberAccessors: #(
	dataDetectorTypes
	paginationMode paginationBreakingMode gapBetweenPages
	pageCount pageLength
)!

! UIWebView methodsFor: #loading !
loadData: nsData mimeType: mimeType textEncodingName: encodingName baseURL: baseURL

	^(self handle
		basicAt: #loadData:MIMEType:textEncodingName:baseURL:)
		value: nsData handle value: mimeType
		value: encodingName value: baseURL handle! !

"UITextInputTraits protocol
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/
"
(Array with: UITextField with: UITextView) do: [:cls|
	cls buildNumberAccessors: #(
		autocapitalizationType
		autocorrectionType
		spellCheckingType
		keyboardAppearance
		keyboardType
		returnKeyType
	);buildBooleanAccessors: #(
		enablesReturnKeyAutomatically
	);buildIsBooleanAccessors: #(
		secureTextEntry
	)
]!


UIControl subclass: #UIPickerView !
UIPickerView buildTypedAccessors: #(
	#( delegate #NSObject )
	#( dataSource #NSObject )
)!
UIPickerView buildFunctions: #(
	#(#selectRow:inComponent:animated #( rowIndex component animated ))
)!

UIControl subclass: #UIDatePicker !
UIDatePicker buildTypedAccessors: #(
	#(date #NSDate)
)!

UITextField buildBooleanAccessors: #(
	enabled
)!