100 days of OSX Development video tutorials
Learn to build Mac App using Swift
Like learning anything, stay focused and practice regularly are the best ways. This is a story on how I learned OSX Development in the past 4 months.
Reasons of Mac App Development
I spent the past few years in developing iOS apps and teaching web development classes. About 4 months ago, I was given a project to work on a startup idea, where it worked out as a Mac App. At that moment, while I thought it can be built by Swift, and the Cocoa framework should sound similar to Cocoa Touch on iOS. I accepted the project and took a month to create the first Mac App. In the meantime, I was looking for some tutorials on OSX Development. The resources were not as abundant as iOS. I thought it might be a good idea to keep my learnings as sharable resources. Today, I have just created 100 videos on what I learned every day.
Check out my tutorial series on YouTube
What do you need to start Mac App Development?
- Mac OSX
That’s it. The upside of developing Mac App is that you have the device already, the Mac computer. You don’t need to equip yourself with another device, like a iPhone. With the personal certificate available, you might register the Apple developer account later on, when you want to deploy the app to Mac App Store.
Instead, like learning any other things, patient and consistency are really important in working on OSX development. You will see why in a later part of this article.
Why is good to keep an eye on Mac App?
One of the advantages for Apple ecosystem is that developers get paid more by developing useful apps. To compare the same products for its iOS version and Mac version, the later generally charges 3 to 4 times more. Some types like todo list apps, calendars or mailboxes get paid quite well in sustaining their development teams. Some of the Mac apps I really like and use it day-by-day include Toggl, Evernote, Sketch, Dropbox, 1Password, Clear, FantasticCal. Other apps like Bartender, Caffeine, Screenflow, RescueTime are my tools of choice.
Was OSX Dev easy to learn?
I thought it would be similar to iOS development. It was okay if you looked as the basic controls like TextField, Labels or Sliders. When it comes to NSCollectionView (which was updated a lot in WWDC 2015), NSTableView and Data Bindings, there are a lot of differences.
Simply saying, although the class names and the function signatures look similarly, they have quite different structure. In OSX, NSCollectionView and NSTableView are scrollable, but they are NOT subclasses of NSScrollView. Instead, they are subviews (called documentView) in the hierarchy of the scroll view, and then the clip view. (Terminologies start to add up).
Data Binding is another concept used in OSX for a long, long time. It is now regarded as legacy support. (It is shown in the documentation of the revised implementation of NSCollectionView). Indeed, there are still many examples in using Data Binding.
Besides structure difference, another big challenge is the code reference. Like any other programming experience, I found answers in google. It sometimes goes to stackoverflow, but it always goes to some old forums, that might be running since 2000 (16 years ago). Don’t expect to find any syntax highlighting there. Having indentation is already a big thumb up. In such case, don’t even to expect much on coding examples written in Swift. Luckily, I started iOS development as Objective-C developer. I am still able to read Objective-C, but mainly writing Swift code now.
What are some good resources in building Mac App?
I looked up for many resources on OSX Dev. There are a lot of resources. However, many of them are scattered. They appeared across 10–15 years. I knew some OSX developers now (join us here at Cocoa Devs), who have been working in the field for more than 10 years. They are all having better experience than I do, by going ups and downs in these years.
In such case, learning the structure of Cocoa frameworks is quite important. When looking at the resources, you will need to first identify the relevance in terms of time. For example, in NSCollectionView, you may want to make sure the content is relevant to the updates in 2015. I found many people having similar questions as I did, thus I created a separate playlist just for NSCollectionView 2015. In no particular order, these are some other resources I take reference to.
- WWDC — It’s the most direct way to learn about OSX. As an iOS developer, it is best to start with Session 233 Sharing code between iOS and OSX (2014) and the equivalent in 2013. I watched more than 15 OSX sessions between 2011 and 2015.
- The Big Nerd Ranch Guide — This is almost the most structured guide in the market. It updated to Swift 1.x, and has a companion Github repo for latest Swift update. As a port from Objective-C to Swift, you would see many sections are using Nibs instead of Storyboards, together with some other legacy ways.
- Ray Wenderlich — Although the main focus of the blog is iOS, which is trendy, it has some articles that cover some foundation concepts in OSX.
What’s up next?
As I have just made 100 videos, almost doing it every day including holidays, I am looking for new ideas in the video series. Here, I want to try an experiment, inspired by Natasha the Robot.
I will build your Mac App for $500.
How it works?
- First in, first out
- Send me an email to firstname.lastname@example.org
- Write the subject as “I have a Mac App idea”
- Include the app idea in 3 sentences and a wireframe
- I will reply everyone’s email, once I decide to work on your project, I will setup a Skype call with you
- Payment: $250 up front, $250 on completion
- Design: I’ll mainly use the native UI components, open to discuss if you have a design too.
- You own the code, but I will take video and showcase some of the features in my blog.
- I have the right to choose the project to work on.
Let me know if you have any question, I will answer that as responses here.
Topics of the tutorials
To conclude this post, I am going to list the topics I have created.
- Auto Layout
- NSTableView — Add a row
- Array Controller
- Menu Bar
- Menu Bar — Event Monitoring
- NSOutlineView — Drag & Drop
- NSOutlineView — Undo Manager
- NSOutlineView — Delegate Methods
- UI Testing
- Unit Testing
- ContainerView — NSViewController Lifecycle methods
- NSNotification Best Practices
- NSPopover Actions
- NSPopover w/ NSNotification UserInfo
- Window Controller
- Tab View Controller
- Split View Controller
- NSToolbar Transparency
- Cocoa Binding Part 1/3
- Cocoa Binding Part 2/3
- Cocoa Binding Part 3/3
- NSCollectionView 2015 — Flow Layout
- NSCollectionView 2015 — Selection & Highlight
- NSCollectionView 2015 — Grid Layout
- NSCollectionView 2015 — Custom Layout
- NSCollectionView 2015 — Header and Footer
- NSCollectionView 2015 — Custom Title for Header and Footer
- NSCollectionView 2015 — Set Item Value / Move Item
- NSCollectionView 2015 — Insert Item
- NSCollectionView 2015 — Delete Item
- NSCollectionView 2015 — Scrolling
- NSCollectionView 2015 — Modify Text Field inline
- NSCollectionView 2015 — NSTrackingArea
- Event Handling — Key Events
- Event Handling — Mouse Events
- Event Handling — Gesture Recognizer
- Core Animation — 3D Drawing
- Event Handling — Custom Gesture Recognizer
- Font System
- CocoaSwiftPlayer — Get Started
- CocoaSwiftPlayer — Start with Storyboard
- CocoaSwiftPlayer — Setup Controls
- CocoaSwiftPlayer — Start Coding
- CocoaSwiftPlayer — Import Songs
- CocoaSwiftPlayer — Display Songs
- CocoaSwiftPlayer — Play Song
- CocoaSwiftPlayer — Next Rewind
- CocoaSwiftPlayer — Repeat Play
- CocoaSwiftPlayer — Shuffle Play
- CocoaSwiftPlayer — Show Song Progress
- CocoaSwiftPlayer — Show Song Title
- CocoaSwiftPlayer — Playlist
- CocoaSwiftPlayer — Playlist in Realm
- CocoaSwiftPlayer — Add to Playlist
- CocoaSwiftPlayer — Switch & Rename Playlist
- CocoaSwiftPlayer — Delete using Menu
- CocoaSwiftPlayer — Status Bar App
- CocoaSwiftPlayer — Visual Effects
- CocoaSwiftPlayer — Wrapping Up
- CocoaSwiftPlayer — Bonus
- NSOutlineView — Insert/Remove/Move
- CocoaSwiftPlayer — AppIcon & Release
- Multiple Windows
- CocoaSwiftPlayer — Bonus 2
- NSCollectionView 2015 — Drag & Drop
- NSCollectionView 2015 — Insert / Delete
- NSTableView — Sorting
- NSTableView — Searching
- NSCollectionView 2015— Dragging Image
- AutoLayout — NSLayoutConstraint
- AutoLayout — SnapKit
- NSTableView — Searching without ArrayController
- NSCollectionView 2015 — NSScrollView
- NSCollectionView 2015 — NSScrollView Part 2
- NSCollectionView 2015 — Design Tips
- NSCollectionView 2015 — IBDesignable
- NSTextField Subclass
- NSTextField vs NSTextView
- NSControl — NSPopUpButton
- NSControl — NSComboBox
- NSControl — NSTextView
- NSControl — NSSlider
- NSControl — NSDatePicker
- NSControl — NSButton — Radio Button Group
- NSControl — Checkbox and Submit the Form
- Event Handling — More on Gesture Recognizers
P.S. Just realized that this is more than 100 videos. I hope you enjoy it.
P.S. 2 A bit upset that there is no update for OSX in the Apple Special Event, thus hope this post brings some enjoyment to every reader.