Presentation given at the Houston iPhone Developers Meetup on October 15th 2013.
This session gave a quick overview of the new iOS 7 SDK features, some tips/tricks on features that are often overlooked, and bugs/compatibility issues.
• Contact me at [email protected] • Founder/Organizer of Houston iPhone Developers Meetup • Organizer of Houston PHP Users Group • Personal iPhone apps on store since 2008 • Personal site at hJp://pessoal.org 2 iOS 7 : Overview and Tips/Tricks Who?
• App Store now allows users with older devices to download old versions of your apps. • If you can’t avoid doing iOS 6 apps, we will discuss some bugs / compa%bility issues. 5 iOS 7 : Overview and Tips/Tricks Moving forward
Kit framework • Game Controller framework • Mul%peer Connec%vity framework • MapKit • 3D perspec%ve with MKMapCamera • Built in support for direc%ons with MKDirections 6 iOS 7 : Overview and Tips/Tricks Major new features • AirDrop • Mul%tasking enhancements • 64-‐bit support • UIKit Dynamics • OpenGL ES 3.0 • iBeacons
text and typography. • Lays out styled text into paragraphs, columns and pages. • Easy to have text flow around regions (such as images). • More informa%on • hJp://www.raywenderlich.com/50151/text-‐kit-‐tutorial • Great tutorial, even includes a bit about Dynamic Type. 7 iOS 7 : Overview and Tips/Tricks Text Kit
size. • Developers can support that by using the new APIs. • Example: • [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] • More informa%on • hJps://www.captechconsul%ng.com/blog/john-‐szumski/ios-‐7-‐tutorial-‐ series-‐dynamic-‐type 8 iOS 7 : Overview and Tips/Tricks Dynamic Type
Cocos2D, but built in to iOS 7. • Strong support in Xcode 5 for par%cles and textures. • Important cons to men%on • Locked to iOS plakorm, no support for custom OpenGL code. 9 iOS 7 : Overview and Tips/Tricks Sprite Kit [1]
• Used together with GCD’s dispatch_source_create and friends to run some code when condi%ons change • Useful to clear caches when necessary, etc. • NSData has base 64 encoding/decoding support now (finally). • -[NSArray firstObject] (similar to -[NSArray lastObject]) iOS 7 : Overview and Tips/Tricks Tips & Tricks 1 12
CMD-‐ and CMD+ keyboard shortcuts • Not super useful, but could be used to surprise your users in a good way. • UISimpleTextPrintFormatter • Easy way to print aJributed strings • Old way of doing this was to render the string into a CG context. 13 iOS 7 : Overview and Tips/Tricks Tips & Tricks 2
- [textView:shouldInteractWithURL:inRange:] • Ability to render images inline with the text as part of its support for NSAttributedString. • Can also respond to touches on the inline images with - [textView:shouldInteractWithTextAttachment:inRange:] iOS 7 : Overview and Tips/Tricks Tips & Tricks 4 15
- YES if a wireless route is ac%ve. • wirelessRoutesAvailable - YES if wireless routes (AirPlay, Bluetooth, etc) are available for user selec%on. • Undocumented proper%es, so look directly in headers instead at <MediaPlayer/MPVolumeView.h> iOS 7 : Overview and Tips/Tricks Tips & Tricks 5 16
value, receive formaJed string in return. • Proper sample code available at NSHipster • hJp://nshipster.com/ios7/ • NSURLComponents • No more messing around with CFURLCreateStringByAddingPercentEscapes to escape URL components. iOS 7 : Overview and Tips/Tricks Tips & Tricks 6 17
for now. • Ability to specify speed/rate, pitch, and pre/post delays. • Demonstra%on. • AJachments support on MFMessageComposeViewController. • Already supported on MFMailComposeViewController, but now also available for MMS/iMessage. iOS 7 : Overview and Tips/Tricks Tips & Tricks 7 18
run%me from Objec%ve-‐C. You can syntax-‐check and execute scripts, access variables, receive callbacks, and share Objec%ve-‐C objects, making possible a wide range of interac%ons.” • Full intro post available on Big Nerd Ranch’s Blog • hJp://blog.bignerdranch.com/3784-‐javascriptcore-‐and-‐ios-‐7/ iOS 7 : Overview and Tips/Tricks Tips & Tricks 8 19
• Set this as the input view of a responder, then add subviews to it. • All subviews will get %n%ng and blur effects automa%cally as needed. • AVCaptureMetaDataOutput • Scan all kinds of barcodes (UPC, QR, etc) with this class. • Example for a QR code available at NSHipster (hJp://nshipster.com/ios7/) iOS 7 : Overview and Tips/Tricks Tips & Tricks 9 20
easy way to add an item to Safari’s Reading List. • Not a full management API (also not documented), just allows you to add a new entry. Read more at <SafariServices/SSReadingList.h> • Transparent table view cells on iOS 6 and iOS 7 • cell.backgroundColor = cell.contentView.backgroundColor = cell.contentView. superview.backgroundColor = [UIColor clearColor]; iOS 7 : Overview and Tips/Tricks Tips & Tricks 10 21
the user is on at that %me. • -[CTTelephonyNetworkInfo currentRadioAccessTechnology] • No%fica%on when cellular connec%on changes • CTRadioAccessTechnologyDidChangeNotification • Undocumented, so look at <CoreTelephony/CTTelephonyNetworkInfo.h> for details. iOS 7 : Overview and Tips/Tricks Tips & Tricks 11 22
programma%cally. • AVPlayer *player = [AVPlayer playerWithURL:testUrl]; • player.volume = 0.0f; // muted • player.volume = 1.0f; // full volume • You can also check if the player is muted with a convenience method • -[AVPlayer muted] iOS 7 : Overview and Tips/Tricks Tips & Tricks 12 23
-[UIApplication preferredContentSizeCategory] • Returns the content size category that the user has selected. • You can use this value to choose the appropriate size for your font. • Regarding Dynamic Text, this is an interes%ng demo of its features: • hJps://github.com/mbigah/BMXContentSizeDemo iOS 7 : Overview and Tips/Tricks Tips & Tricks 13 24
iOS 6.x apps only (Base SDK), but there is a solu%on. • Work around: copy the old 4.6.3 Xcode.app’s iOS 6.1 SDK over to Xcode 5. • More background: hJp://stackoverflow.com/ques%ons/18423896/is-‐it-‐possible-‐to-‐install-‐ios-‐6-‐ sdk-‐on-‐xcode-‐5 iOS 7 : Overview and Tips/Tricks Xcode 5 Tip 25
2013, there is no new contentView property. • hJps://devforums.apple.com/thread/196613?tstart=0 • Exis%ng hacks to add subviews to UIAlertView to display other things in it don’t work anymore. • Alterna%ve: hJps://github.com/mindbrix/TSAlertView iOS 7 : Overview and Tips/Tricks Bugs / CompaIbility issues [1] 26
upon viewDidAppear even though the region has not changed. • Annoying issue to work around. • UITableViewCell • Not really a compa%bility issue per se, but the new iOS 7 design for grouped table views make each content view 320 points wide, not 300pt as before. • You may need to update layout code. iOS 7 : Overview and Tips/Tricks Bugs / CompaIbility issues [3] 28
• Work around here: hJps://devforums.apple.com/message/905368#905368 • UIReferenceLibraryViewController • -[UIReferenceLibraryViewController dictionaryHasDefinitionForTerm:] returns YES on iOS 7 every single %me iOS 7 : Overview and Tips/Tricks Bugs / CompaIbility issues [4] 29
• [[UIDevice currentDevice] _setGraphicsQualityOverride:0x64] • Detect the new iPhone 5s back plate color: • [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"] • Detect if iPhone is black/white: • [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"] • Run Universal app in phone mode: • [[UIApplication sharedApplication] _setIsClassic:YES] Note: hat tip to @stroughtonsmith on these. iOS 7 : Overview and Tips/Tricks Private API hacks 31
u%lity buJons (similar to iOS 7 Mail Applica%on). • hJps://github.com/CEWendel/SWTableViewCell • RESideMenu – side menu with parallax effect. • hJps://github.com/romaonthego/RESideMenu • DAProgressOverlayView – download progress anima%on similar to app download. • hJps://github.com/daria-‐kopaliani/DAProgressOverlayView • RNFrostedSidebar – side menu with blurred background and custom anima%ons. • hJps://github.com/rnystrom/RNFrostedSidebar iOS 7 : Overview and Tips/Tricks Third party libraries 32
with iOS 7's dynamic text sizes. • hJps://github.com/splinesoR/SSDynamicText • SDScreenshotCapture -‐ captures a screenshot of the app window which excludes the iOS status bar. • hJps://github.com/shinydevelopment/SDScreenshotCapture • LLDB-‐QuickLook -‐ debugger command to open images, views, etc. • hJps://github.com/ryanolsonk/LLDB-‐QuickLook • UIKitResources – image assets extracted from iOS 7. • hJps://github.com/youknowone/UIKitResources iOS 7 : Overview and Tips/Tricks Third party libraries [2] 33
make it easier to build wireframes. • hJps://github.com/blakeperdue/ios7-‐wireframe-‐kit • OmniGraffle iOS 7 stencil pack ($19.00) • hJps://www.graffletopia.com/stencils/1102 • Glyphish 5 and 6 ($25.00 each) – 400 icons that match the new iOS 7 style. • hJp://www.glyphish.com/ iOS 7 : Overview and Tips/Tricks Design resources 34
• WWDC 2013 videos • What’s new in Cocoa Touch (session 203) • Building User Interfaces for iOS 7 (session 201) • Customizing Your App’s Appearance for iOS 7 (session 214) • ShinobiControls – Introducing iOS 7 Day by Day • hJp://www.shinobicontrols.com/blog/posts/2013/09/19/introducing-‐ ios7-‐day-‐by-‐day/ 36 iOS 7 : Overview and Tips/Tricks More informaIon [2]