Month: June 2020

  • Future App Development on iPad

    With less than 24 hours until Apple unveils iOS 14 and a slew of software updates at WWDC 2020, I wanted to briefly get my thoughts down regarding something that has been in my head.

    Many feel that, with the iPad positioned as a computing platform, the iPad itself needs to do more things like a Mac can. One of those is app development. While it’s not a totally useless platform for development, there are limitations. But I think there will be some lingering limitations for a while, and in a way, those limitations might help us see the direction Apple is taking their platforms.

    Current State

    Right now, the iPad has a limited availability for development. This is in the form of the Swift Playgrounds app, which is a great way to learn Swift within a playground environment. Since last year, it has supported SwiftUI, Apple’s new declarative UI framework.

    Swift Playgrounds is useful but comes with some obvious limitations:

    • No actual app creation
    • IDE only – No Interface Builder/SwiftUI Preview canvas
    • Missing some SwiftUI functionality when running your code

    It’s not totally useless. If you’re a fan of playgrounds like me, then you may already be used to building a lot of Xcode playgrounds to test various ideas and concepts. Doing the same on the iPad is no different.

    iPad as ARM Mac?

    With Apple’s rumored transition to ARM processors for their Mac line, some were speculating that the iPad Pro would be a good test device until actual ARM Macs ship later this year. However, this was shot down as the iPad Pro has only 6 GB of RAM, while the typical Mac starts with 8 GB.

    From John Gruber at Daring Fireball:

    iPad Pros only have 6 GB of RAM — no Mac has shipped with less than 8 GB in many years, and developers aren’t buying machines with 8 GB of RAM. Honestly, I think the RAM is a deal-breaker on the iPad Pro-as-ARM-Mac-dev-kit idea.

    I also agree with this point. I don’t think the iPad Pro is itself a good candidate for testing macOS on ARM hardware. However, if we take the above limitation into account, let’s reason on some possibilities.

    The Future of iPadOS

    Why did Apple break out iPadOS from iOS? Sure, there are differences at the UI/UX level. For instance, you can drag and drop items between apps on the iPad, but on the iPhone this is limited to within the scope of a single app.

    Even during the iOS 13 timeframe, the builds for iOS and iPadOS were similar in terms of foundation. There’s no surprise there. But this begs the question: is iPadOS just a marketing term?

    With the recent release of the Magic Keyboard for the iPad Pro, I wonder if we’ll truly see the iPad move into more of a Mac-like direction. It will never become the Mac. It will never replace the Mac. But we might see some additions to the iPad that make it more compelling to use with something like the Magic Keyboard.

    For one, let’s consider the initial transition in bringing iOS apps to the Mac. This was done by bringing UIKit from iOS to macOS. Last year, Apple announced Mac Catalyst as a way for iPad apps to easily come to the Mac, and improvements were made throughout iPadOS 13 to support mouse cursors and keyboard input.

    The next stage in that transition is supposedly bringing support for iPhone apps to the Mac.

    But that sounds so trivial. Why is that a separate stage in the release? If someone can easily make an app that supports iPhone and iPad now, what does this bring for developers?

    iPadOS Windows

    Last year, Apple added support for multiple windows (called “Scenes”) of the same app to exist at the same time. What this means is you can have two windows from the same app side by side in multitasking. Or have multiple windows from an app paired with multiple other apps. Example: You can have two Notes windows side by side, or two Messages windows, or two Safari windows.

    However, there are still limitations on how windows can be arranged. Right now, you can have an app (or two, paired) take up the full display, and have an app visible via Slide-Over on the side.

    What if the idea of iPhone apps coming to Mac is really intended for iPhone apps to come to the iPad? Imagine Slide-Over but refined and expanded, allowing iPhone-sized apps to live on your iPad screen, perhaps even when you’re on the home screen. With cursor and keyboard support, this would bring some added capabilities to iPadOS, bringing it closer to the Mac without actually running macOS.

    I have no knowledge of future roadmaps, but I wouldn’t be surprised if that’s the direction iPadOS takes.

    Now, what does this have to do with developing apps on the iPad?

    The Future of App Development on iPad

    Right now, app development is done on the Mac. Xcode lets you build apps for iOS, watchOS, iPadOS, tvOS, and macOS. And the Mac can simulate all of those environments.

    If we were to expand iPad to be able to develop apps, we have to ask the question: What platforms can we simulate on an iPad?

    If iPhone apps will soon be able to run on an iPad, I’d argue that being able to develop iPhone apps on an iPad version of Xcode is a possibility. And much like the Xcode for Mac is capable of building Mac apps, Xcode for iPad will be able to build iPad apps. In fact, I can see Watch and tvOS apps just as easily.

    But what about Mac apps? While it could be possible, how would you test it? Mac apps have the most access to their platform than any other Apple OS, by far. Would you simulate a Mac environment to test a Mac app?

    While not impossible, I find it highly improbable that you would be able to simulate a Mac environment on an iPad to test a Mac app.

    Then you have the question of UI development. While you can programmatically build UI, Apple wouldn’t want to leave that as the only way to do so. And while many apps are still built with UIKit/AppKit and Interface Builder, Apple has showed us a new way to build UIs: SwiftUI.

    With SwiftUI, we’re able to build apps for all of Apple’s platforms (including the Mac). With SwiftUI, I also think Apple is slowly laying the foundation for eventually supporting a version of Xcode for iPad.

    While the iPad won’t be able to build everything Xcode for Mac can, it’ll eventually be able to build apps for the iPad, iPhone, Apple Watch, and possibly tvOS. But you would have limitations: SwiftUI would be your only route for UI.

    If this ends up being true, it also shows Apple’s priorities: Enable developers to build apps for their more popular platforms with limited, more specialized tools, and leave the larger development picture to the Mac.

    So will Xcode come to the iPad? I think so. Will it replace Xcode for Mac? No. Will the iPad replace the Mac? No.

    But what we will definitely see is a separation of iOS and iPadOS. Last year was just marketing. This year and beyond, we’ll see it in practice.

  • WWDC 2020 Expectations

    Everyone has their own expectations when WWDC comes around. Here is what I’d like to see come from Apple and their various platforms.

    SwiftUI improvements

    Whether they call it SwiftUI 2, or just say they’ve made it better, I fully expect to see a “What’s New in SwiftUI” session this year, including some much needed additions. Of those, I’m hoping to see:

    • First party support for two-dimensional data grids. If List is to UITableView, then I want whatever is the equivalent of UICollectionView. There are a few interesting third-party solutions out there, and I’m not against using them, but I feel something like this would benefit from being provided by Apple themselves.
    • Fixed TabView. Right now, while you can easily create tabbed navigation, the SwiftUI TabView doesn’t behave like a normal UITabViewController. Specifically, if you navigate to another tab and come back, it’s up to the developer to maintain the hierarchy. So if I’m 3 views deep in tab 1, go to tab 2, then go back to tab 1, I’m back at the root by default.
    • Fixed NavigationView. This is more-so when it comes to master/detail on iPad. If I navigate a layer deep in a detail, then rotate the iPad, it resets the detail view while retaining the navigation stack. So I can push a view, rotate, push again, rotate, push again, and end up with what seems to be a navigation stack three or four views deep when in reality my hierarchy is just one or two.

    What I do not expect to see is a complete replacement of everything available in UIKit or AppKit. What I mean: I don’t think we’ll see SwiftUI versions of WKWebView, MKMapView, or similar views. The current SwiftUI<->UIKit/AppKit functionality seems to cover situations like this.

    “Swifty” Core Data

    In Swift 3, Swift gained a huge improvement when it came to JSON Serialization: Codable. Codable is really two protocols: Encodable and Decodable. But together, they take the concept of serializing data, such as to/from JSON, and made is super easy to support.

    I would love to see something similar done with Swift classes and Core Data. Could we make a data model conform for Core Data storage by just adding a protocol conformance? If that were possible, I know I’d love to use it.

    I’d also hope that any such improvements would allow us to make a Core Data managed object that automatically conformed to Codable without requiring a custom init/decoder.

    A Gamer’s GameCenter

    I think GameCenter was one of Apple’s squandered opportunities. They offer a powerful Apple TV box that, if powered by newer iOS chipsets, can rival console performance. Yet they have nothing on their platform that resembles the social interactions and networking like you’d see on Xbox or Playstation. I keep hoping they’ll wisen up, revive that platform, and provide a better way for people to find their friends and game together.

    An Improved Development Experience on iPad

    Swift Playgrounds shows that it’s possible to do coding on the iPad. I’d like to see this turned up a notch, even if it isn’t a full-blown Xcode for iPad. With SwiftUI, perhaps we’ll see some middle-ground. Use your iPad to develop a SwiftUI app? Great. Want to integrate legacy components? Take your project to your Mac.

    Even if that doesn’t happen, I’m curious to see what new features and enhancements come to the Swift Playgrounds app this year.

    I’m sure that, with whatever Apple announces, I’ll be eager to install the latest betas and try things out. Even if none of my expectations are meant, I’m going to enjoy WWDC 2020.