Serhii Bykov: macOS development from iOS developer’s perspective
Serhii Bykov shares his experience about switching from iOS development to macOS. Is there a lot of differences? What is similar? How did it feel, did it require much time and effort?
projects were not so big • Most of the time I was the only one iOS developer in a team • I thought there were more challenging tasks in macOS development 5
is big and it keeps growing • 90-95% people of Cocoa community are iOS developers • I am still struggling while developing for macOS • So I’ve decided to provide an easy ramp-up for iOS developers to start developing for macOS 6
is backed by a Core Animation layer • Any drawing done by the view is cached to the underlying layer object • You should never interact directly with the layer 25
contains a Core Animation layer that you intend to manipulate directly • You are responsible for managing the view’s layer • Do not rely on the view for drawing • Do not add subviews 29
a layer-hosting view? • When you need some advanced operations with layer or when you want to configure a hierarchy of layers associated with a single view
trackingArea: NSTrackingArea? override func mouseMoved(with event: NSEvent) { // now this method will be called } override func updateTrackingAreas() { if let area = trackingArea { removeTrackingArea(area) } let options: NSTrackingArea.Options = [.mouseMoved, .activeAlways] let area = NSTrackingArea(rect: bounds, options: options, owner: self, userInfo: nil) addTrackingArea(area) self.trackingArea = area } } 38
one or more image representations • NSImageRep - representations for BMP, EPS, PDF, etc • NSImage will cache the result when it’s drawn to the screen 52
to do with colors is potentially more complicated • A common task is to use a color in your app that your designers have specified for you • Make sure you’re using same color space for Xcode & <your_design_app> 54
process • Apple API are feature-rich, but sometimes all you need is some command line tool • Some apps are just GUI shells for command line tools (e.g. any git clients) 117
27.12% • High Sierra - 17.11% • Sierra - 8.2% • Other - 14.1% Data: https://gs.statcounter.com/macos-version-market-share/desktop/worldwide/#monthly-201911-201911-bar Other 14% Sierra 8% High Sierra 17% Catalina 27% Mojave 33% 123
code written by your colleagues • Despite all the differences between platforms, your daily development process will look pretty close to your iOS tasks, if you’re not doing something extraordinary • Setapp will soon have iOS application, so feel free to apply to us • https://macpaw.com/careers/macos-setapp 126