Wednesday, June 1, 2022
HomeProgrammingCatalyst by Tutorials | raywenderlich.com

Catalyst by Tutorials | raywenderlich.com


Run iOS apps Natively on macOS With Catalyst!

Catalyst by Tutorials exhibits you tips on 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 easy as you’d prefer it to be. This guide will present you tips on how to design your apps to work nicely on macOS, what you may and might’t port between the 2 platforms, and every other “gotchas” to maintain an eye fixed out for when constructing apps beneath Catalyst.

This guide is for builders who’ve a very good deal with on constructing iOS apps and need 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 helps you to prolong your iPad apps to macOS. Below 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 assist native macOS controls and performance, such because the acquainted menu bar, assist for mouse and keyboards, window resizing, correct scroll bars, Contact Bar assist, and desktop-based drag and drop.

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

Earlier than You Start

This part tells you a couple of issues it’s worthwhile to know earlier than you get began, resembling what you’ll want for {hardware} and software program, the place to seek out the mission information for this guide, and extra.

Part I: Making a Nice iPad App

Catalyst is all about letting you employ code you’ve written for iOS on macOS. However not simply any code. No less than for now, you may solely run code that’s written for iPad on a Mac. And since many 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 need to 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. You then’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 guide.
As soon as you become familiar with the fundamental performance and structure, you may take your first steps towards bringing the app to macOS.


Right here, be taught why you need to use Cut up View Controller and acquire Instruction on tips on 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 assist for dragging pictures from different apps and dropping them into your app. You may 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 characteristic that has been out there for the reason that starting on the Mac, and launched with iOS 13 on the iPad, multi-window assist.


On this chapter, you may find out about context menus, including assist for long-press menus on iPad and the way these menus routinely 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, much like Mail.app and the reader pane.


Part II: Making a Nice Mac App

The excellent news is that almost all of your code shall be helpful for each iPad and Mac platforms. However what in regards to the issues which might be Mac-specific: like mouse assist, Contact Bar assist 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 following degree 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. Whenever 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 indicate a shadow impact or to vary the default mouse pointer, when hovering over a diary entry within the pattern app. You may 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 is usually a little totally 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, take a look at 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 that everybody with macOS can run your app,
in addition to tips on how to enhance the set up expertise in your potential customers.


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments