ufjoe.blogg.se

Swift code mac
Swift code mac









swift code mac

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.

swift code mac

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.

swift code mac

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.

swift code mac

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.











Swift code mac