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

Porting iOS app to the Mac. Catalyst: Where to ...

Porting iOS app to the Mac. Catalyst: Where to begin? by Yevhenii Peteliev

Yevhenii Peteliev has covered the basics of porting iPad apps to Mac, talked about common issues and situations when you definitely should think twice before porting the application.

MacPaw Tech Talks

August 08, 2019
Tweet

More Decks by MacPaw Tech Talks

Other Decks in Programming

Transcript

  1. Porting iOS app to the Mac. Catalyst: Where to begin?

    !" 1 Yevhenii Peteliev Mac Software Engineer, MacPaw Inc.
  2. Agenda: # Is Mac App Store dying? $ What is

    Marzipan? % Introduction to Catalyst & Why do we need to use it? ' System features in macOS " How to port iOS App to the Mac? ( Understanding pitfalls ) Tips for beginners 2
  3. Marzipan 4 10 5 With macOS Mojave, Apple is adding

    support to run UIKit apps on macOS without the requirement of rewriting the UI in AppKit $ It allows iOS developers to build apps for macOS
  4. Problems 13 The glaring difference between Mac and iOS is

    the user interface While Macs use keyboard, mouse, and a growing number of trackpad gestures, iOS devices are touch-based. Both platforms use different UI code: AppKit on Mac and UIKit on iOS
  5. Marzipan < 14 , It is in some ways an

    evolution of the Simulator 
 5 It doesn’t use the Simulator architecture 4 It includes support for adding buttons to the window, menu bar, focus rings, and much more
  6. Support 15 Trackpad and mouse input App window stoplights Window

    resizing Scroll bars Copy & paste Drag & drop
  7. Marzipan S 30 , While Marzipan is in use on

    macOS Mojave, Apple has opted not to make it available for developers because of its relative instability , Developers have already managed to create tools to bring iOS apps to macOS using Marzipan thanks to the Apple apps that were ported
  8. Soo… 32 iOSMac is disappointingly limited in its compatibility with

    existing libraries due to its missing frameworks and classes, but surprisingly usable for simple apps
  9. Catalyst 34 Catalyst is Apple’s framework that lets developers easily

    port their iPad apps across to the Mac. It consists of new tools within Xcode and built-in Mac support for a huge number of APIs that will let your iOS apps run natively.
  10. 38 The Mac version of your iPad app supports many

    system features found in macOS without requiring any effort from you System Features
  11. System features 39 A default menu bar for your app

    Support for trackpad, mouse, and keyboard input Support for window resizing and full-screen display Mac-style scroll bars
  12. System features 40 Rich text interaction, including copy and paste

    and contextual menus for editing Support for system Touch Bar controls System Preferences Drag-and-drop support
  13. System features 41 Many system-provided UI elements automatically convert from

    iOS to macOS You get macOS-appropriate versions of the following iOS-provided items: Split view File browser Activity view Contextual actions
  14. App Configuration l 45 When you select Mac as a

    supported device, Xcode makes the following changes to your project
  15. App Configuration m 46 Adds a bundle identifier for the

    Mac version of your app Adds the App Sandbox Entitlement to your project Adds My Mac to the list of destinations that you can choose when running your app from Xcode Excludes incompatible frameworks, app extensions, and other embedded content
  16. 49 q Compile project on iOS13 r Add iPad support,

    then add macOS s Remove incompatible frameworks t Enclose incompatible embedded content u Setup your .plist Steps to port iOS App to the Mac s
  17. 58 z Incompatible frameworks and embedded content & Highly sophisticated

    interface { AppSandbox | .plist y ... Pitfalls }
  18. 59 z You may need to manually exclude other content.

    Go to the Frameworks, Libraries, and Embedded Content list under the General tab for your iOS target. Then select iOS as the platform setting for the item Incompatible frameworks
  19. 62 & Your project likely contains code that no longer

    compiles because of frameworks or API that are unavailable to the Mac version of your app Incompatible code
  20. 63 • App Sandbox is an access control technology provided

    in macOS, enforced at the kernel level € It is designed to contain damage to the system and the user’s data if an app becomes compromised. Apps distributed through the Mac App Store must adopt App Sandbox AppSandbox •
  21. 64 z The sandbox is enabled automatically once you enable

    a Catalyst target on your iPad app & Sandbox is not mandatory on macOS. You can disable it and then your app has much more leeway in what it can do on a users system. However, it is required if you want to ship your app on the macOS App Store AppSandbox ‚
  22. 69 z Use technology properly & Take risks into account

    7 Don't be afraid to be a discoverer … Start using new features and concepts Conclusion l„
  23. Links: ! https://pspdfkit.com/blog/2018/porting-ios-apps-to- mac-marzipan-iosmac-uikit-appkit/ " https://github.com/steventroughtonsmith/marzipanify † https://speakerdeck.com/steipete/hacking-marzipan $ https://kirb.me/2018/06/07/iosmac-research.html

    ‡ https://developer.apple.com/design/human-interface- guidelines/ios/overview/ipad-apps-for-mac/ 4 https://developer.apple.com/documentation/uikit/ creating_a_mac_version_of_your_ipad_app 4 https://appventure.me/guides/catalyst/features.html 70