Catalyst by Tutorials | raywenderlich.com


Run iOS apps Natively on macOS With Catalyst!

Catalyst by Tutorials exhibits you find out how to take all of these nice apps you’ve constructed on iOS and run them proper on macOS. However like all the things else with Apple, it’s not all the time as simple as you’d prefer it to be. This ebook will present you find out how to design your apps to work nicely on macOS, what you may and may’t port between the 2 platforms, and every other “gotchas” to maintain a watch out for when constructing apps below Catalyst.

This ebook is for builders who’ve deal with on constructing iOS apps and wish to discover ways to port these apps to run on macOS as nicely.

What’s Catalyst?

Previously referred to as Marzipan to Apple insiders, Catalyst permits you to lengthen your iPad apps to macOS. Beneath Catalina and Xcode 11, builders can begin constructing their iPad apps with macOS as a goal.

And we’re not simply speaking about grossly super-sized variations of iPad apps in your Mac; Catalyst apps will help native macOS controls and performance, such because the acquainted menu bar, help for mouse and keyboards, window resizing, correct scroll bars, Contact Bar help, and desktop-based drag and drop.

So if you happen to’ve been hesitating to port your iPad apps to macOS since you simply don’t wish to need to be taught to develop for the desktop, then now’s your time to begin!

Earlier than You Start

This part tells you a couple of issues it is advisable to know earlier than you get began, comparable to what you’ll want for {hardware} and software program, the place to search out the mission information for this ebook, and extra.

Part I: Making a Nice iPad App

Catalyst is all about letting you utilize code you’ve written for iOS on macOS. However not simply any code. At the very least for now, you may solely run code that’s written for iPad on a Mac. And since a lot of the code will run on each platforms, earlier than you dive in to working your app in your Mac, there are some things you must do to make your code prepared.

On this part, you’ll take an app written to run on iPhone and adapt it to run on iPad. Then you definitely’ll add some options to make it behave like a first-class iPad citizen. And thru the magic of Catalyst, these options will make your Mac app higher too!

On this chapter, you are getting your first take a look at the pattern app that you’re going to be interacting with on this ebook.
As soon as you become familiar with the essential performance and structure, you may take your first steps towards bringing the app to macOS.

Right here, be taught why you must use Cut up View Controller and achieve Instruction on find out how to migrate from iPhone-style Navigation Controller with master-detail push to Cut up View Controller.

On this chapter, you may discover ways to add help for dragging images from different apps and dropping them into your app. You will additionally discover ways to implement drag and drop for assortment views with clean animations and cell reordering.

On this chapter, you may discover ways to allow a function that has been obtainable because the starting on the Mac, and launched with iOS 13 on the iPad, multi-window help.

On this chapter, you may find out about context menus, including help for long-press menus on iPad and the way these menus robotically port to the Mac.

On this chapter, discover ways to use keyboard instructions to navigate throughout an inventory and delete gadgets, in addition to the UIKeyCommand and setting first responder.

Be taught structure preferences, and override particular person gadgets from darkish mode, just like Mail.app and the reader pane.

Part II: Making a Nice Mac App

The excellent news is that the majority of your code will likely be helpful for each iPad and Mac platforms. However what in regards to the issues which are Mac-specific: like mouse help, Contact Bar help and extra?

On this part, you’ll take your first-rate iPad app and add Mac-specific touches to make it work nicely on macOS.

On this chapter, you are taking issues to the subsequent stage by making some changes that’ll actually make your app shine when working on macOS through Catalyst.
All through the remainder of this part, you may go deeper on a number of different Mac-specific options. If you’re performed, you may have the makings of a world-class Mac app.

On this chapter, you may be taught to implement PointerStyleProvider and UIHoverGestureRecognizer to point out a shadow impact or to vary the default mouse pointer, when hovering over a diary entry within the pattern app. You will additionally be taught to decorate your mouse pointers utilizing UIPointAccessory that is new in iOS 15. You’ll take a look at the variations between iOS/iPadOS and contact targets in macOS.

On this chapter, you’ll be taught all in regards to the menu bar by trimming the default menu bar, in addition to including new gadgets to delete, share and add new diary entries.

On this chapter, you may be taught to customise the toolbar gadgets, together with Add, Share and Delete.

On this chapter you may proceed to develop your app by including the toolbar gadgets to the Contact Bar.

Part III: Distributing Your App

Congratulations! You now have a Mac app. However getting that app, first to your testers after which to your customers could be a little completely different than on iOS.

On this part, you’ll be taught be taught to roll out your app for beta testing utilizing TestFlight. You’ll then be taught the choices for distributing your app and the way these choices work.

On this chapter, you’ll learn in regards to the professionals and cons of distributing on the Mac App Retailer, check your app utilizing TestFlight and discover ways to go from Xcode to a launched app on the App Retailer.

On this chapter, you’ll discover ways to be sure everybody with macOS can run your app,
in addition to find out how to enhance the set up expertise to your potential customers.



Leave a Comment