Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Highlights of WWDC 2018 & Hacking Marzipan

Highlights of WWDC 2018 & Hacking Marzipan

The world's biggest gathering of iOS developers organized by Apple is happening just a few days before mDevCamp. Peter will be there and will bring all the hot news we should look at in upcoming weeks and months. The talk featured a first in-depth look at the experience of porting http://pdfviewer.io over to Apple's new iOSMac subsystem ("Marzipan"). Video of PDF Viewer running on macOS: https://twitter.com/steipete/status/1006292370160316418

Peter Steinberger

June 15, 2018
Tweet

More Decks by Peter Steinberger

Other Decks in Technology

Transcript

  1. Highlights of WWDC 2018 » WWDC 2018 » Talk Highlights

    » Marzipan Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  2. What's New for Developers » Swift 4.2 » Xcode 10

    » ARKit 2 & USDZ » Network.framework » Siri Shortcuts » Core ML (Mac) Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  3. iOS 13 Predictions » Application Tabs » Split Screen/Multple Windows

    » New Home Screen » Pinnable Widgets » ... Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  4. DISCLAIMER » Things will break » Don't release Marzipan apps

    just yet » Don't try any of that on your main dev machine » Disabling security is a bad idea » I only had a few days to play with it Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  5. Why bother then? » Get a headstart for 2019 »

    It will make your codebase better » It's fun! Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  6. What's already there? » Both Swift and Objective-C are supported

    » Storyboards/Interface Builder layouts mostly work » Most Frameworks are available » MobileCoreServices: Renamed to CoreServices (new in macOS Mojave) Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  7. Problems » Some parts from iOS 11 are missing »

    Deprecated API is gone (UIWebView is not there) » Auto Layout behaves different » Stuff's weird & undocumented » WINDOW SERVER FREEZES CONSTANTLY Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  8. AppKit is still there and will haunt you Peter Steinberger

    - @steipete - PSPDFKit - Highlights of WWDC 2018
  9. @interface UILabel (PSPDFMarzipan) // Otherwise we get an unrecognized selector

    - (NSUInteger)ns_widgetType; @end @implementation UILabel (PSPDFMarzipan) - (NSUInteger)ns_widgetType { return 0; } @end @interface UITextField (PSPDFMarzipan) // Otherwise we get an unrecognized selector - (NSUInteger)ns_widgetType; @end @implementation UITextField (PSPDFMarzipan) - (NSUInteger)ns_widgetType { return 0; } @end Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  10. @interface UILabel (PSPDFMarzipan) // Otherwise we get an unrecognized selector

    - (NSUInteger)ns_widgetType; @end @implementation UILabel (PSPDFMarzipan) - (NSUInteger)ns_widgetType { return 1; } @end Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  11. UIStackView system spacing - (void)setPspdf_fallbackSpacing:(CGFloat)fallbackSpacing { if (@available(iOS 11.0, *))

    { self.spacing = UIStackViewSpacingUseSystem; } else { self.spacing = fallbackSpacing; } } Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  12. UIStackView system spacing yolo - (void)setPspdf_fallbackSpacing:(CGFloat)fallbackSpacing { //if (@available(iOS 11.0,

    *)) { // self.spacing = UIStackViewSpacingUseSystem; //} else { self.spacing = fallbackSpacing; //} } Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  13. Auto Layout Gotchas » Don't use visual format language (fails

    to match views) » Don't use UIStackViewSpacingUseSystem (introduced in iOS 11) » Some wilder hacks required (ns_widgetType) Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  14. Window Chrome » No API Peter Steinberger - @steipete -

    PSPDFKit - Highlights of WWDC 2018
  15. Thanks! Try pdfviewer.io (iOS and Android, no macOS yet, sorry)

    Want more like that? Follow @steipete on Twitter Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018