XAM1 - IOS Flashcards
What is AppDelegate?
- where you can override system events
- loaded by Main.cs which normally isn’t touched
- inherits from UIApplicationDelegate
- FinishedLaunching kicks off first view
What does iOS page structure look like?
- starts with UIWindow with a single UIView then hierarchical structure of children
What is First Responder?
- the control that handles a Touch Event
- buttons and labels are not eligible to be First Responder
- making keyboard go away on an event call ResignFirstResponder
Touch events in iOS are handled through what?
- A responder chain
What happens when iOS starts getting low on memory?
- a DidReceiveMemoryWarning
- if received need to start cleaning up memory and killing caches that can be recreated
What is the order of View events?
- LoadView
- ViewDidLoad
- ViewWillAppear
- ViewDidAppear
- ViewWillDisappear
- ViewDidDisappear
What do you use in iOS for positioning?
- Set positioning with Frame using CGRect
- use Bounds to get positioning of elements
What do you use in code to add Views to screen?
- AddSubView or AddSubViews
- adds to array
- order does matter
In iOS what does everything visual build off of?
- UIView
Where do you set the main storyboard?
- info.plist
- under Main Interface
What is naming convention for iOS ViewController?
- [ClassName]ViewController
If manually creating a ViewController cs file what do you need to be sure is added?
- Register attribute to designer file
- [Register (“DetailViewController”)]
- registers that class with iOS
What is required on iOS ViewController?
- custom constructor is required and must always be added
- public MyViewController (IntPtr handle) : base (handle) {}
What does iOS use to map controls to properties in VC class?
- Outlets
How do UI Views send events to VC?
- using Action / IBAction
- pub/sub kind of thing
- event handlers always use “partial” keyword