Tag Archives: UIKit

Future macOS Frameworks

Duct Tape, fixer of all things!I stumbled upon an interesting conversation between some well know Apple Ecosystem Developers this morning discussing, maybe lamenting, the lack of UIKit on macOS. I’m afraid I may have pushed these fellas to take their conversation private, I am sorry if that was the case.

Here’s the tweet that started the conversation:

https://twitter.com/stroughtonsmith/status/779726806727491584

I’m not known in any development communities. I’m what you’d call a nobody. But I’m a nobody with years of experience that has seen changes to my development ecosystem.

Having experienced a dramatic shift in Windows Development technologies I have opinions about what I would expect to see from Apple. These opinions and $10.00 should be enough to buy you any item on a Starbucks drink menu. Take if for what it is. An opinion of a nobody.

What I Expect

Given Apple’s love and focus on Swift I fully expect Apple to put their effort into moving their frameworks to focus on Swift while continuing to allow App developers to use Objective-C with anything new. I’ve written about the idea of Swift only Frameworks. I believe we will eventually arrive there. For now we have excellent UIKit support for three different devices; iOS, watchOS, and tvOS. Odd man out would be macOS. It doesn’t make sense, at least to me, for Apple to spend time back porting or adapting UIKit to the Mac. Their bread and butter is their  iOS based trio of the phone, watch, and cable like device. Since iPhone accounts for around 60% of revenue it makes sense for the iOS Platform to be their primary focus. That begs the question, will the Mac ever receive the attention we’d like it to receive? Probably not.

In the end I’d expect Apple to push iOS forward while keeping the Mac as a primary development system for iOS, watchOS, tvOS, and macOS developers with the latter receiving very little attention from a new Frameworks perspective.

A Brief History of Windows Development

Like I said above, I’m opinionated and I’ve been around the block a few times. I know Apple isn’t Microsoft and people tend to hate those comparisons. But I do see similarities between the Microsoft of the 90’s and the Apple of today. That’s a discussion for another time.

The discussions around Frameworks reminds me of Microsoft’s transition to .Net and C# as an easier way for developers to create Windows Apps. Apple is making such a big push with Swift a new framework targeting Swift developers feels like a natural progression.

It’s taken over 15-years to really push app development into a .Net world. I suppose some could argue it took less than 10 and I wouldn’t fight that. The point is Microsoft managed to push an entire development community to a new technology while allow old technologies to continue to not only function but grow. Look at the Microsoft Office Apps and Adobe Photoshop among others. They continue to be very relevant today and continue to add new features while the Windows API receives much less attention than does .Net and C#.

Ultimately the point is I know Apple could choose to push toward a Swift only framework and allow legacy Objective-C/Cocoa apps to continue to grow and thrive. Microsoft is a prime example of how a company could pull it off.

I think it’s kind of nice being a new developer to Apple’s platforms. I don’t have 20+ years of baggage like I do with Windows. It’s been so much easier to move from Objective-C to Swift because of it. Well, that and being most familiar with C++ made the transition to Swift feel more natural to me.

Whatever Apple has in store for us, be it the growth of Cocoa, a new Swift centered framework, or a Swift only framework, I’m ready for it and welcome it.

AppKit is to the Windows API…

OMG NEW FRAMEWORK!

Will write C/C++ for foodThere was a lot of buzz generated around the discovery of a private framework, called UXKit, that shipped with Apple’s upcoming Photos for Mac app. Like many others I initially thought “It’s about time.” Then I started thinking about the transition that happened when Microsoft created C# and .Net. At the time we had the Windows API and our trusty C/C++ compiler. At the time .Net shipped in early 2002 we were still building desktop applications, the web was moving forward, but not at the pace it is today. Microsoft shipped WinForms, which was pretty much a straight wrapping of the Windows API’s for .Net developers. The point is, Microsoft gave developers a way to do stuff with the new language and runtime that could get them up and running quickly. The environment was different, but the API’s felt familiar.

Moving Forward

In 2006 Microsoft released a new framework called WPF (Windows Presentation Foundation.) This new framework made use of DirectX so rendering the user interface was hardware accelerated, along with other nifty stuff. As far as I know this was the last major framework Microsoft created for desktop developers. Since that time web development and Surface (Metro) seem to be their primary focus. (Someone please correct me here, if this is not accurate. I’m not that dialed in to Windows desktop API’s any longer.)

The point is, Microsoft went through this weird transition from the Windows API to a intermediate (WinForms) to their final desktop UI framework over the course of four years. Creating new technologies and frameworks is hard. They take time, but Microsoft is good at API’s, and they’re very good at maintaining them and providing developers an upgrade path. This is, I believe, where Apple is today. They’re in that awkward period between AppKit and whatever is next.

Enter Swift

In the summer of 2014 Apple gave developers a great surprise at WWDC. They introduced us to a new language; Swift. Since that time Apple has created a weblog dedicated to the language and shipped Xcode 6 with full Swift support. At this point in time it seems like Apple is pushing hard for iOS and Mac developers to adopt Swift as their primary development language. They seem to be “all in.”

Get to the point

Long story short. Do I believe UXKit is a future version of UIKit for Mac development? No, I don’t. I believe it’s a private framework created by the Photo’s team (or another team) to allow them to share a bunch of code with the iOS counterpart. It makes sense. Apple traditionally operates very lean. They have very small teams, so they need to work as fast and smart as they can. If they have a framework that allows them to share more code, it may allow them to move more quickly.

Ultimately I believe we will get an entirely new framework. Built from the ground up using Swift. I suspect that framework will aim to share code between iOS and Mac where it makes sense, and diverge where it doesn’t. The overall feel will be the same for both platforms. It will be unified.

I love thinking and writing about future technologies. I’m rarely ever right in my guesses (see my musings on WinRT), but it doesn’t stop me from dreaming.

Work Note: That compiled?

I just ran across something that had me stumped for a while, I just couldn’t see it, and I would have thought the compiler would have choked on it. It didn’t, it built, and ran, and produced interesting results.

Confession time: I’m not using auto layout, yet. Why? I haven’t had the time to commit to it. Yes, I’m aware it would probably save me time in the long run. I will learn it, of course, just not today.

Anywho, back to the story.

I hade some code that looked like this, I must have been distracted mid-thought, and did a build. This code built.

self.thingView.frame = frame;
self.thingView.frame

AHHHHHH!Anyone see a problem there? No assignment, no closing “;”. The code built and ran! The outcome was my view moving into strange positions during rotation for no apparent reason. Wow.

I finally had to do a diff to find it, I just couldn’t see it.