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

832ece085bfe2c7c5b0ed6be62d7e675?s=128

Peter Steinberger

June 15, 2018
Tweet

Transcript

  1. 2.

    Highlights of WWDC 2018 » WWDC 2018 » Talk Highlights

    » Marzipan Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  2. 3.

    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. 5.

    iOS 13 Predictions » Application Tabs » Split Screen/Multple Windows

    » New Home Screen » Pinnable Widgets » ... Peter Steinberger - @steipete - PSPDFKit - Highlights of WWDC 2018
  4. 54.
  5. 56.
  6. 62.

    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
  7. 63.

    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
  8. 65.
  9. 67.

    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
  10. 68.

    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
  11. 69.

    AppKit is still there and will haunt you Peter Steinberger

    - @steipete - PSPDFKit - Highlights of WWDC 2018
  12. 74.

    @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
  13. 76.

    @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
  14. 85.

    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
  15. 86.

    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
  16. 88.

    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
  17. 89.

    Window Chrome » No API Peter Steinberger - @steipete -

    PSPDFKit - Highlights of WWDC 2018
  18. 91.
  19. 93.

    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