AppKit for iOS Developers

B5ff8c85fb809e9966436593b40f1063?s=47 Delisa Mason
September 19, 2013

AppKit for iOS Developers

Pitfalls and tips for working with AppKit for those familiar with building iOS apps

B5ff8c85fb809e9966436593b40f1063?s=128

Delisa Mason

September 19, 2013
Tweet

Transcript

  1. 3.

    AppKit - gui framework for os x - perspective of

    ios developers branching out - familiar to uikit users - refinements and cruft of age - not all UI to NS
  2. 4.

    Pitfalls - assumptions and common pitfalls to cover - frame

    in common classes to encounter - not necessarily about porting
  3. 5.

    ? why? - less constraints on distribution and memory usage

    - more intensive computation - it is cool
  4. 8.

    ˒  - something a user wants while in multiple

    apps? - persistent utility - maybe launches at start up
  5. 9.

    ˒  ? TheApp - accomplishes particular task - front

    and center - may be single use; disappear with the window
  6. 10.

    ? - an experience requiring the entire screen all the

    time - game - system-altering utilities
  7. 12.

    @interface MyViewController : NSViewController @end @implementation MyViewController - (void) viewDidLoad

    { // initialize some stuff } @end - lay out some code - does nothing
  8. 14.

    NSViewController • commitEditingWithDelegate:didCommitSelector:contextInfo: • commitEditing • discardEditing • initWithNibName:bundle: •

    loadView • nibBundle • nibName • representedObject • setRepresentedObject: • setTitle: • setView: • title • view - instance methods - no view loading stage selectors - willLoad, didAppear
  9. 17.

    NSWindowController •manages a window, usually loaded from a nib •has

    window loading stage selectors •windowDidLoad •windowWillLoad
  10. 21.

    NSNavigationController there’s no nsnavigationcontroller! - how often do you have

    desktop apps change context entirely? - is it a good experience?
  11. 22.

     TheApp - focus should remain task or document -

    taking away context is unexpected
  12. 25.

     TheApp Stuff NSMenu maybe no window at all -

    menus for comprehensive lists of actions
  13. 27.

    NSWindow ≠ UIWindow SIDEBAR - nswindows have more sizes, shapes,

    types - not always full screen - not always focused - people close them, - app keeps running
  14. 28.

    Displays Multiple Sizes, Resolutions, Pixel Densities - windows on many

    more types of displays - keep in mind when designing interactions - that said, favorite interaction
  15. 30.

    Making a Selection •Segmented Controls •Sliders •Combo Buttons •Radio Groups

    •Table Views - several controls suited to users performing a selection - focus on table view
  16. 31.

    Making a Selection •Segmented Controls •Sliders •Combo Buttons •Radio Groups

    •Table Views - ios use is common - handy and unnecessarily complex flow chart
  17. 33.

    Use NSTableView? Complex sidebar Persistent lists Spreadsheets - customized sidebar,

    not better served by a source list, a la finder - or central focus on a dataset is purpose of the app
  18. 34.

    NSTableView •Cell-based or view-based content modes •Columns nstableview is well-suited

    to these kinds of functions - cell-based, as in cell in a spreadsheet, plain text - view-based, as in it has subviews, and probably custom layout - different delegate methods by content mode - more than one column, concern for cell population - sometimes easily built by bindings
  19. 36.

    Bindings •Connects data and presentation •Integrates into interface builder •Can

    reduce “glue code” •Alternately invoked via bind:toObject:withKeyPath:options: - reflects changes bidirectionally - content and most interface elements connect controller property or model
  20. 37.

    Bindings key-value observing key-value coding - not magic - layer

    on top of kvo/kvc - good to remember for debugging horribly wrong connections - refer cocoa bindings programming reference
  21. 39.

    1. Read the OS X HIG its a bit lengthy

    - covers usage of interface elements in depth - definitely not the same as the iOS HIG
  22. 40.

    2. Get down with Core Graphics or you will never

    figure out how to change the background color of an nsview