Slide 1

Slide 1 text

AppKit for iOS Developers

Slide 2

Slide 2 text

@kattrali Delisa Mason

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Pitfalls - assumptions and common pitfalls to cover - frame in common classes to encounter - not necessarily about porting

Slide 5

Slide 5 text

? why? - less constraints on distribution and memory usage - more intensive computation - it is cool

Slide 6

Slide 6 text

- better companion experiences to ios apps

Slide 7

Slide 7 text

Designing Your App - ask how is it most useful to users

Slide 8

Slide 8 text

˒  - something a user wants while in multiple apps? - persistent utility - maybe launches at start up

Slide 9

Slide 9 text

˒  ? TheApp - accomplishes particular task - front and center - may be single use; disappear with the window

Slide 10

Slide 10 text

? - an experience requiring the entire screen all the time - game - system-altering utilities

Slide 11

Slide 11 text

1 2 3 - design a view flow - make a nib

Slide 12

Slide 12 text

@interface MyViewController : NSViewController @end @implementation MyViewController - (void) viewDidLoad { // initialize some stuff } @end - lay out some code - does nothing

Slide 13

Slide 13 text

NSViewController?

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

NSViewController? - not the controller

Slide 16

Slide 16 text

NSViewController

Slide 17

Slide 17 text

NSWindowController •manages a window, usually loaded from a nib •has window loading stage selectors •windowDidLoad •windowWillLoad

Slide 18

Slide 18 text

1 2 3 - change to windows

Slide 19

Slide 19 text

1 2 3 - link them up with nsnavigationcontroller ......?

Slide 20

Slide 20 text

NSNavigationController? where it at?

Slide 21

Slide 21 text

NSNavigationController there’s no nsnavigationcontroller! - how often do you have desktop apps change context entirely? - is it a good experience?

Slide 22

Slide 22 text

 TheApp - focus should remain task or document - taking away context is unexpected

Slide 23

Slide 23 text

 TheApp Subview subviews slide in to add additional functionality while preserving context

Slide 24

Slide 24 text

 TheApp NSPanel nspanels add additional contextual tooling

Slide 25

Slide 25 text

 TheApp Stuff NSMenu maybe no window at all - menus for comprehensive lists of actions

Slide 26

Slide 26 text

 TheApp HUD-style NSWindow huds for ephemeral views, like previewing

Slide 27

Slide 27 text

NSWindow ≠ UIWindow SIDEBAR - nswindows have more sizes, shapes, types - not always full screen - not always focused - people close them, - app keeps running

Slide 28

Slide 28 text

Displays Multiple Sizes, Resolutions, Pixel Densities - windows on many more types of displays - keep in mind when designing interactions - that said, favorite interaction

Slide 29

Slide 29 text

Presenting Users with Choices for which they need to select from big list

Slide 30

Slide 30 text

Making a Selection •Segmented Controls •Sliders •Combo Buttons •Radio Groups •Table Views - several controls suited to users performing a selection - focus on table view

Slide 31

Slide 31 text

Making a Selection •Segmented Controls •Sliders •Combo Buttons •Radio Groups •Table Views - ios use is common - handy and unnecessarily complex flow chart

Slide 32

Slide 32 text

Use NSTableView? Does the list need to be visible for a while? Sure NOPE yes no

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

Bindings favorite things to love and hate

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

General Advice

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

2. Get down with Core Graphics or you will never figure out how to change the background color of an nsview

Slide 41

Slide 41 text

3. Use documentation if nothing else, for naming conventions nsalert, nsmakerect, webview

Slide 42

Slide 42 text

Thank you!