![]() ![]() Open Xcode and create a new macOS project. We will also be doing this in Xcode 9 because that is the latest and greatest version at the time of writing. In fact, if you have any ideas for enhancements of your own, please leave them in the comments at the bottom!įor this tutorial, you’ll need a basic understanding of Swift development and familiarity with storyboards. For our purpose, this is enough, and it leaves open room for plenty of enhancements in future iterations of the project. This will work on only one screen (for now) and will not work as is over full-screen apps. We will be making an app that draws over the entire screen. There are some caveats to this project that I want to get out of the way before we start. How long before macOS supports iOS builds? There are differences between Cocoa and UIKit, which will become apparent, but this tutorial will get your feet wet and (hopefully) challenge you to build something bigger and better. If you program for your iPhone on your MacBook, shouldn’t you also be able to program for your MacBook on your MacBook? What if Apple actually does merge iOS and macOS? Should you be left behind because you were intimidated by macOS development? ChromeOS already supports Android builds. If you are anything like me, you are a little intimidated by the thought of making a macOS app. The SoapboxĪt this point, you might be saying to yourself, “Why build this? It’s just a simple drawing app!” But that isn’t the point. So, over lunch one day, I decided to take a crack at building this drawing tool, and here we are! This is what we will build in this tutorial. I knew that it was possible because I’d seen it in other apps. I preferred that it not live in the dock, nor change the contents of macOS’ menu bar. I wanted drawing on the screen to be enabled at all times, but not to take over the screen when not in use. This area of macOS contains items called “ menu extras.” By clicking the pencil icon, you will enable drawing on screen, and then you can draw something like this below! Behold the app in all its glory, again! ( View large version) If you look closely at the image above, you will see a little pencil icon in the upper-right bar. OK, it doesn’t look like much - and, honestly, it shouldn’t because I haven’t drawn anything. I decided to build a macOS app to draw on the computer screen:īehold the app in all its glory! ( View large version) I wanted to be able to describe what I was saying by drawing directly on the screen, without any post-production. I recently picked up a side project making tutorial videos on YouTube. Sure, it was in Objective-C, and it was pre-ARC to boot, but after reading through the code, I saw that figuring out how to do it in Swift wasn’t very difficult. After a little digging, I found Apple’s little gem of RoundTransparentWindow. ![]() Having never really done anything on macOS, I started to do some digging. He came over and asked if I knew how to make a circular floating app on macOS for prototyping purposes. The idea comes from two unlikely sources. Once we complete it, you will realize how easy it is to build applications for macOS. To prove this, I will walk you through building a simple screen-annotation application. The good news is that developing for macOS using Swift has a lot more in common with iOS development than you realize. Today is the day we head on over to macOS development, a dark and scary place that you know nothing about. I know you are comfortable there on your iOS island, knocking out iOS applications, but today begins a brand new adventure. Today, we will try to build for a different platform! Don’t be afraid. You sat down at your desk, took a sip of coffee and opened up Xcode to start a new project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |