My main activity of 2019 was a port of the Mental Canvas 3D drawing tool from Windows to iOS. About 75% of my effort was user interface code, maybe 15% on graphics and 10% other platform issues.
What’s interesting about our porting approach? Well, it’s just an unusual mix:
- It’s a UWP (Universal Windows Platform) app. UWP was Microsoft’s effort to modernize Win32 and add iOS mobile paradigms, so it is already touch-centric, relatively sandboxed and has a more mobile-like lifecycle
- We didn’t use React Native, Flutter, Electron, Xamarin, Qt or even Fuschia’s namesake Pink. We just… wrote some native code. And a lightweight abstraction layer.
- We completed the porting effort in seven months, with three developers.
- We stayed with the MVVM architecture that is the norm on Windows. Many iOS developers would call that… exceptionally ok
- We didn’t use the latest and greatest Swift tools, just plain old C++11 and Objective-C for the most part. We didn’t switch to SwiftUI when it was released half way through our port.
What combination of circumstances led to this approach? Mostly just a real life constraint: a desire to rewrite/redesign as little working code as possible, and keep the codebase’s size down.
- Starting Point
- UI Framework Choice
- Restructuring the UI Thread
- Lightweight iOS Bindings
- What About SwiftUI?
- Incremental Porting
- The Upshot: Code Reuse