Além do Flat Design: O que mudou no iOS 7

841a0284060fa6faa652e95a467dcc69?s=47 Marcelo Fabri
September 28, 2013

Além do Flat Design: O que mudou no iOS 7

Todo mundo está falando do visual do iOS 7. Mas existe muito mais a ser explorado: novas APIs, mudanças de comportamento em APIs existentes e até novos frameworks. Descubra todo esse novo mundo nessa palestra!

Palestra apresentada originalmente no NSNull, em Campinas (28/09/2013).

841a0284060fa6faa652e95a467dcc69?s=128

Marcelo Fabri

September 28, 2013
Tweet

Transcript

  1. Além do Flat Design: O que mudou no iOS 7

  2. Eu sou o Marcelo! marcelofabri.com @marcelofabri_ me@marcelofabri.com

  3. Quem?!

  4. Quem?

  5. None
  6. None
  7. None
  8. 1 [NSArray -firstObject]

  9. 2 UIApplicationUserDidTakeScreenshotNotification

  10. 3 instancetype http://nshipster.com/instancetype/ @interface Person + (instancetype)personWithName:(NSString *)name; @end

  11. 4 NSData(NSDataBase64Encoding) - (id)initWithBase64EncodedString:(NSString *)base64String options:(NSDataBase64DecodingOptions)options; - (NSString *)base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)options; -

    (id)initWithBase64EncodedData:(NSData *)base64Data options:(NSDataBase64DecodingOptions)options; - (NSData *)base64EncodedDataWithOptions:(NSDataBase64EncodingOptions)options; - (id)initWithBase64Encoding:(NSString *)base64String; - (NSString *)base64Encoding;
  12. 5 NSAttributedString (NSAttributedStringDocumentFormats) - (id)initWithData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict

    error:(NSError **)error; Cria NSAttributedString a partir de HTML!
  13. 5 NSDictionary *options = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute:@(NSUTF8StringEncoding)}; NSAttributedString *str =

    [[NSAttributedString alloc] initWithData:data options:options documentAttributes:nil error:nil];
  14. 6 [UIImage -renderingMode] - (UIImage *)imageWithRenderingMode:(UIImageRenderingMode)renderingMode; typedef NS_ENUM(NSInteger, UIImageRenderingMode) {

    UIImageRenderingModeAutomatic, UIImageRenderingModeAlwaysOriginal, UIImageRenderingModeAlwaysTemplate };
  15. 6 WWDC 2013 #214: Customizing Your App’s Appearance for iOS

    7
  16. 7 JavaScriptCore JSContext *context = [[JSContext alloc] init]; JSValue *result

    = [context evaluateScript:@"2 + 2"]; NSLog(@"2 + 2 = %d", [result toInt32]); (JavaScript sem UIWebView!) WWDC 2013 #615: Integrating JavaScript into Native Apps
  17. 8 Descobrir se AirPlay está disponível (MPVolumeView) @property (nonatomic, readonly)

    BOOL wirelessRoutesAvailable; @property (nonatomic, readonly) BOOL wirelessRouteActive; NSString *const MPVolumeViewWirelessRoutesAvailableDidChangeNotification; NSString *const MPVolumeViewWirelessRouteActiveDidChangeNotification;
  18. 9 Descobrir tipo de rede de celular (CTTelephonyNetworkInfo) @property (nonatomic,

    readonly) NSString* currentRadioAccessTechnology; NSString * const CTRadioAccessTechnologyDidChangeNotification;
  19. 9 NSString * const CTRadioAccessTechnologyGPRS; NSString * const CTRadioAccessTechnologyEdge; NSString

    * const CTRadioAccessTechnologyWCDMA; NSString * const CTRadioAccessTechnologyHSDPA; NSString * const CTRadioAccessTechnologyHSUPA; NSString * const CTRadioAccessTechnologyCDMA1x; NSString * const CTRadioAccessTechnologyCDMAEVDORev0; NSString * const CTRadioAccessTechnologyCDMAEVDORevA; NSString * const CTRadioAccessTechnologyCDMAEVDORevB; NSString * const CTRadioAccessTechnologyeHRPD; NSString * const CTRadioAccessTechnologyLTE;
  20. Novos detectores - CoreImage (CIDetector) NSString *const CIDetectorEyeBlink; NSString *const

    CIDetectorSmile; 10
  21. Leitura de QRCodes (e códigos de barra) (AVCaptureMetaDataOutput) 11 https://github.com/kpmiller/ios7-barcode

  22. 12 Seu iPhone fala! (AVSpeechSynthesizer) Quantas LOC? 4

  23. AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; NSString *str = @"A

    palestra do Marcelo é a mais legal do NSNull!"; AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:str]; utterance.rate = AVSpeechUtteranceMaximumSpeechRate / 5.0f; [synthesizer speakUtterance:utterance]; https://gist.github.com/marcelofabri/6665076 12
  24. 13 Sincronizar keychain pelo iCloud (kSecAttrSynchronizable) dictionary[(__bridge id)(kSecAttrSynchronizable)] = @YES;

    https://github.com/soffes/sskeychain
  25. 14 Permissão para acessar o microfone

  26. 15 Blur Não existem APIs para fazer em realtime Tirar

    snapshots e aplicar o blur
  27. 15 -(UIImage *)blurredSnapshot { UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, self.window.screen.scale); [self drawViewHierarchyInRect:self.frame afterScreenUpdates:NO];

    UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext(); UIImage *blurredSnapshotImage = [snapshotImage applyLightEffect]; UIGraphicsEndImageContext(); return blurredSnapshotImage; }
  28. 15 applyLightEffect ? #import "UIImage+ImageEffects.h" (https://developer.apple.com/downloads/index.action) http://damir.me/posts/ios7-blurring-techniques http://stackoverflow.com/a/17041983/1777634

  29. 16 UIScreenEdgePanGestureRecognizer UIScreenEdgePanGestureRecognizer *gr = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self.view action:@selector(userDidPan:)]; gr.edges

    = UIRectEdgeLeft; [self.view addGestureRecognizer:gr];
  30. 17 interactivePopGestureRecognizer (UINavigationController)

  31. keyboardDismissMode (UIScrollView) 18 typedef NS_ENUM(NSInteger, UIScrollViewKeyboardDismissMode) { UIScrollViewKeyboardDismissModeNone, UIScrollViewKeyboardDismissModeOnDrag, UIScrollViewKeyboardDismissModeInteractive

    }
  32. Status bar por ViewController 19 UIViewControllerBasedStatusBarAppearance = NO no plist

    para desativar @property(nonatomic,assign) BOOL modalPresentationCapturesStatusBarAppearance; - (UIStatusBarStyle)preferredStatusBarStyle; - (BOOL)prefersStatusBarHidden; - (UIViewController *)childViewControllerForStatusBarStyle; - (UIViewController *)childViewControllerForStatusBarHidden;
  33. tintColor vs barTintColor 20

  34. A morte dos identificadores únicos 21 -[UIDevice uniqueIdentifier] removido MAC

    address retorna sempre 02:00:00:00:00:00 (afeta ODIN1) +[UIPasteboard pasteboardWithName:create:] e +[UIPasteboard pasteboardWithUniqueName] não são mais compartilhados (afeta OpenUDID)
  35. Cores do sistema depracted 22 + (UIColor *)viewFlipsideBackgroundColor NS_DEPRECATED_IOS(2_0, 7_0);

    + (UIColor *)scrollViewTexturedBackgroundColor NS_DEPRECATED_IOS(3_2, 7_0); + (UIColor *)underPageBackgroundColor NS_DEPRECATED_IOS(5_0, 7_0);
  36. 23 UIButtonTypeSystem UIButtonTypeRoundedRect

  37. Próximos Passos •View Controllers são sempre full screen •Nova validação

    de recibos (IAP) •Mudanças do MapKit •Transições de View Controllers •iBeacons •Text Kit •Modules •64 bits
  38. Próximos Passos •What’s New in iOS 7 •iOS SDK Release

    Notes for iOS 7 •iOS 6.1 to iOS 7.0 API Differences •iOS 7 : NSHipster •Essential iOS 7 Developer’s Guide •iOS7-Sampler •Custom UIViewController Transitions •Wrestling with Status Bars and Navigation Bars on iOS 7 •iOS 7 by Tutorials
  39. None
  40. Obrigado! marcelofabri.com @marcelofabri_ me@marcelofabri.com