ios 7gotocon.com/dl/2013/gotonights/ios 7 - what you need to know.a… · • requires ios7 / os x...

61
iOS 7 What You Need to Know Friday, October 11, 13

Upload: others

Post on 20-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

iOS 7What You Need to Know

Friday, October 11, 13

Page 2: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Friday, October 11, 13

Page 3: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

• GOTO Conference

• GOTO night

• Training

Friday, October 11, 13

Page 4: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Twitter

Friday, October 11, 13

Page 5: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Modules@import

Friday, October 11, 13

Page 6: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 7: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Modules

• Easier to use

• No namespace pollution

• You get it for free

• Performance (build time and indexing)

Friday, October 11, 13

Page 8: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Modules

• Caveats

• Requires iOS7 / OS X 10.9 SDK

• Not available for user frameworks

Friday, October 11, 13

Page 9: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Modules

404 Advances in Objective-C

Friday, October 11, 13

Page 10: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Unit Testing in Xcode 5...finally being taken seriously

Friday, October 11, 13

Page 11: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 12: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

• SenTest- and XCTest can co-exist

• New in Xcode 5

- Migration tool

- Test failure break-point

- Test assistant categories

- Test again command

Friday, October 11, 13

Page 13: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

409 Testing in Xcode 5

More on Unit Testing

Friday, October 11, 13

Page 14: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Test Bots

Friday, October 11, 13

Page 15: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

No Demo! :-(

Friday, October 11, 13

Page 16: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Friday, October 11, 13

Page 17: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

• Test on simulator and physical devices

• Deep integration with Xcode

• Good terminal support

Bots

Friday, October 11, 13

Page 18: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

More on Bots and CI

412 Continuous Integration with Xcode 5

Friday, October 11, 13

Page 19: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Auto LayoutThey fixed it !

Friday, October 11, 13

Page 20: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Springs and Strutswhy not?

Friday, October 11, 13

Page 21: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Springs and Strutswhy not?

Friday, October 11, 13

Page 22: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Auto Layout in iOS6 IBFriday, October 11, 13

Page 23: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 24: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

406 Taking Control of Autolayot in Xcode 5

Friday, October 11, 13

Page 25: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Xcode 5Other enhancements

Friday, October 11, 13

Page 26: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

• Capabilities

• Images.xcassets

Friday, October 11, 13

Page 27: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Sandwich

Friday, October 11, 13

Page 28: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Multitasking

Friday, October 11, 13

Page 29: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

[WWDC 2013: 204 Whats new With Multitasking]

Friday, October 11, 13

Page 30: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

[WWDC 2013: 204 Whats new With Multitasking]

Friday, October 11, 13

Page 31: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

New multitasking APIs

• Background Fetch

• Remote Notifications

• Background Transfer Service

Friday, October 11, 13

Page 32: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Background Fetch

• Update your tweets or Facebook posts while app is backgrounded

Friday, October 11, 13

Page 33: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 34: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Background Fetch

• Update you social media data

• But what else?

• Simulate remote notifications

• What are the constraints ?

Friday, October 11, 13

Page 35: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Background Fetch

• System scheduled (coalesced)

• Adapts from usage pattern

Friday, October 11, 13

Page 36: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Remote NotificationsMotivation

• Update the App Content before the user opens the App.

Friday, October 11, 13

Page 37: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Remote Notifications

1. Set the Background mode

2. Implement the AppDelegate callback

Friday, October 11, 13

Page 38: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Remote Notifications

aps { content-available: 1 alert: {...}} Omit for silent notification

Friday, October 11, 13

Page 39: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Background Transfer ServiceMotivation

• Upload/download large files

• Continue even after app exists

• Enqueue from background and foreground

Friday, October 11, 13

Page 40: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 41: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Use case example

1. New content available

2. Server sends silent push notification

3. App starts background transfer service

4. Transfer completes and App presents a local notification

Friday, October 11, 13

Page 42: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

204 Whats new With Multitasking

Friday, October 11, 13

Page 43: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

JavaScript Core

Friday, October 11, 13

Page 44: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

JSVirtualMachine *vm = [JSVirtualMachine new]JSContext *context = [[JSContext alloc] initWithVirtualMachine:vm];context[@"a"] = @5;

JSValue *aValue = context[@"a"];double a = [aValue toDouble];NSLog(@"%.0f", a); // => 5

[context evaluateScript:@"a = 10"];JSValue *newAValue = context[@"a"];NSLog(@"%.0f", [newAValue toDouble]); // => 10

Friday, October 11, 13

Page 45: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

JavaScript CoreObject Bridging

Person *person = [[Person alloc] init];person.name = @"Søren";context[@"person"] = person;

• Create a PersonExports <JSExports> protocol

• @property => JavaScript getter/setter

• instance method => JavaScript function

Friday, October 11, 13

Page 46: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

UIKit Dynamics

Friday, October 11, 13

Page 47: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

[WWDC 2013: 206 Getting Started With UIKit Dynamics]]

Friday, October 11, 13

Page 48: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

animator = [[UIDynamicAnimator alloc] initWithReferenceView:referenceView];[animator addBehavior:...];[animator addBehavior:...];

Friday, October 11, 13

Page 49: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Predefined Behaviors

• Gravity

• Collision

• Attachments (and Springs)

• Snap

• Forces (Push)

• Item Properties

Friday, October 11, 13

Page 50: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Demo!

Friday, October 11, 13

Page 51: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

206 Getting Started with UIKit Dynamics

Friday, October 11, 13

Page 52: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Sprite Kit

Friday, October 11, 13

Page 53: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"hero.png"];[sprite runAction:[SKAction fadeOutWithDuration:1.0]];

Declarative

[myNode runAction: [SKAction sequence:@[action1, action2, action3]] ];

Composable Actions

[SKVideoNode videoNodeWithVideoFileNamed:@"video.mp4"];Cool

Integrated physicsSKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"ball.png"];sprite.physicsBody = [SKPhysicsBody bodyWithCircleOfRadius:sprite.size.width * 0.5];

Friday, October 11, 13

Page 54: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Friday, October 11, 13

Page 55: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

502 Introduction to Sprite Kit

Friday, October 11, 13

Page 56: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

...and the rest

Friday, October 11, 13

Page 57: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

Other API Goodies• Add attachments to mail

(Message UI Framework)

• Base64Encode NSData

• [NSArray firstObject]

• Barcode Scanner(AVFoundation)

• AVSpeechSynthesizer

• MKDistanceFormatter

• [UIView snapshotView...]

Friday, October 11, 13

Page 58: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

NSURLComponents and NSCharacterSet (NSURLUtilities)

NSURLComponents *components = [NSURLComponents componentsWithString:@"http://nshipster.com"];components.path = @"/iOS7";components.query = @"foo=bar"

//http://nshipster.com/iOS7?foo=bar

Friday, October 11, 13

Page 59: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

NSURLComponents and NSCharacterSet (NSURLUtilities)

NSCharacterSet+ (id)URLUserAllowedCharacterSet+ (id)URLPasswordAllowedCharacterSet+ (id)URLHostAllowedCharacterSet+ (id)URLPathAllowedCharacterSet+ (id)URLQueryAllowedCharacterSet+ (id)URLFragmentAllowedCharacterSet

Friday, October 11, 13

Page 60: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

I’m sorry....

Friday, October 11, 13

Page 61: iOS 7gotocon.com/dl/2013/GOTONights/iOS 7 - What You Need to Know.A… · • Requires iOS7 / OS X 10.9 SDK • Not available for user frameworks Friday, October 11, 13. Modules 404

TextKit Custom ViewController Transition

Core Bluetooth

Multipeer Connectivity

App Transfer

Friday, October 11, 13