Read this post on our new engineering blog!
WWDC 2019 contained one of Apple's most significant announcement since announcing Swift in 2014: SwiftUI. They promised it to be innovative and an effortless way to build user interfaces across all Apple platforms. Me and my two Apple Developer colleagues, forming the team behind the Collect iPhone and iPad application, were super enthusiastic about getting started with this new way of building apps.
Building an app that reaches millions of users with a relatively small team of 3 engineers is challenging. Testing views on iPad, iPhone, and several app extensions take time when done manually. The benefits of using live previews from within Xcode with SwiftUI made us decide to switch gears and adopt early.
Deciding to switch gears and adopt
Switching gears by adopting a brand new language is not easy. It can slow down development because developers need to learn a new language, and it's risky because we're not sure what to expect from SwiftUI. When resources are low, you have to be careful and consider whether the benefits weigh up to the impacts.
Within Collect, we're a meritocracy. We allow individuals to make decisions based on their talent and experiences. Our team builds on trust and honesty: we believe our colleagues are experts in what they do, and they're making the best decision possible. Therefore, it was up to our team of three iOS developers to decide whether or not to adopt SwiftUI.
However, we couldn't just decide and go. Adopting SwiftUI comes with a learning curve that takes time. It has the chance of being unstable, resulting in even more development delays, and we could even conclude, in the end, that it has been too early to start adopting SwiftUI. We had to develop a strong case to convince ourselves that we should begin adopting SwiftUI.
Today's decisions determine our future, and that also holds for the quality of our codebase. Time might be expensive today but even more costly later if we make a wrong decision. We believe SwiftUI is the future. All views we can develop in SwiftUI today will save us from rewriting them later. We took the learning curve for granted as we would run into that sooner or later, and tried to lower the risks by picking a small, isolated feature as a tryout: the new introduction screens. For users on older OS versions without support for SwiftUI, we could show the old designs. The latest introduction screens built with SwiftUI would only be visible for those with iOS 13 and up, for which SwiftUI views are available.
“An exceptionally simple way to build user interfaces”—is that true?
Apple introduced SwiftUI as an innovative, exceptionally simple way to build user interfaces across all Apple platforms with the power of Swift. A promising way to describe a new language and most-likely not considering any bugs occurring in early versions. Although Apple battle-tested SwiftUI internally by building some of their apps using this new technology, it was far from bug-free when it launched.
Yes, it's much simpler to declare views using the new syntax. However, commonly used UI elements like collection views only became available since iOS 14. Even if you start adopting SwiftUI today, you likely need to support iOS 13 with all its early-day bugs and missing components. Without draining away all the value from the above quote, I'd like to dive into our experiences of adopting SwiftUI for our brand new introduction screens.
The views we had to build were relatively simple on their own. The animation binding them together, however, was much more complicated. A classic 80/20 story arrived: 80% of the feature was easy to build while the last 20% to finish up the details took most of our time.
We managed to build the views relatively quickly. SwiftUI previews work great as long as you're developing in a small project. Segueing into our first conclusion: create your SwiftUI views in a separate project to leverage Xcode Previews. Otherwise, Xcode will generate your previews by building your complete project, making them unacceptably slow.
Secondly, you have to test on many different OS versions. It turned out that a minor iOS 13 version could make a big difference to the rendering of views. Our animation worked great on iOS 13.4 and up but broke on all lower versions. Even updates on iOS 14 broke our views sometimes. You can imagine how testing on all these versions took a lot of our development time.
Lastly, prepare for a new way of developing. We took our time to set up convenience methods to apply brand styling, and we've worked out our vision for developing SwiftUI views. Setting up guidelines takes time but is essential for building a foundation for your team to write consistently in this new UI language.
If I could turn back time?
What if we could travel in time and make the same decision today. Would we change anything? We don't regret adopting SwiftUI this early. We would, however, pick a less detailed view to start developing with it. The learning curve took a lot of time already, and the complicated animations didn't make it any easier.
SwiftUI is still young today and was even younger when announced. Deciding to adopt SwiftUI today is best done if you can drop iOS 13 or leave it out for the views you're going to build. This way, you'll run into fewer bugs from the early days, and you have fewer differences between OS versions to check. Take into account you might need to support two UIs if you're still supporting iOS 12 or lower today.
Word of advice? Make sure to adopt SwiftUI in phases. Don't start rewriting your complete app today but start with a small part of your app. Consider rewriting an existing view so that you can show the older view to older OS versions. Besides, you've already got the business logic, and you only need to focus on writing the UI, making the learning curve a bit less curvy!
The future is bright
Although SwiftUI is still in its early days, the future is bright. The declarative syntax and Xcode Previews make it easier to write views. Apple announced Swift in 2014, and we still have projects with lots of Objective-C code. We need to consider the same time range of adoption for SwiftUI.
It's a matter of time before SwiftUI takes over. We believe that adopting SwiftUI today, in phases, is the best way forward for making SwiftUI the default language to write in.
Related articles
- Save for now. Get to it later
Never stress about expired links again. Discover how WeTransfer's ‘save for later’ feature lets you store and access important files whenever you need them.
- Unleashing our next era of growth, with Bending Spoons
WeTransfer joins the Bending Spoons portfolio of digital businesses
- Share big files from the same place you create them
WeTransfer Teams Up with Adobe to streamline content sharing with new add-on for Adobe Express
- Behind the scenes with WeTransfer and Tribeca Festival
Why we partnered with the iconic film festival for our latest short film launch
- Get Partner Perks with WeTransfer: Unlocking Creativity Together
New partner benefits and discounts exclusively for WeTransfer Pro subscribers
- Set a price, share your work, and get paid with WeTransfer
Introducing a simpler way to get paid for client work and make money from your creativity
- “Move it like a Pro” campaign highlights simple tools that help creators
A behind the scenes look into WeTransfer's latest brand campaign
- New Rules: Inspiring creatives at a difficult time
We’ve launched a guide to help photographers navigate an industry in flux
- Creating a world? Join our new research project
Submit your projects to get published in our new memo, take part in our research and get paid for doing it.
- Talk to the Moon: one giant leap for WeTransfer
The story of Talk to the Moon: a wonderfully strange AI experience, brought to life on WeTransfer
- Why we’re giving everyone at WeTransfer Fridays off over the summer
Introducing WeTransfer Time Off: summer edition, with every full Friday during July and August granted as a day off, without changing our work patterns Monday to Thursday or adjusting compensation and benefits
- Season 4 roundup - Influence Podcast
During this season we talk to UK-based fashion designer Harris Reed and Oscar-winning actor, writer, producer and musician Riz Ahmed, plus more
- Season 3 roundup - Influence Podcast
Throughout this season Damian chats to Ben & Jerry's co-founder Jerry Greenfield and explores what happened behind closed doors at Cambridge Analytica, plus much more
- Season 2 roundup - Influence Podcast
During this season we explore the complexity of being black in America, non verbal communication, plus more
- Season 1 roundup - Influence Podcast
influence-podcast-by-wetransfer-season-1
- We’re launching our next act
Supporting the next generation of creatives
- Meet Holley M. Kholi-Murchison, Our New Creative Researcher-in-Residence
The social practice artist sheds light on how our first creative residency came to life
- Alva Skog has an idea
You might notice some cheeky new artwork during your transfers by this Swedish artist. Here's how they came to life.
- Designing the 2020 Ideas Report
To show the impact of a year of chaos on the creative mind, we had to think outside the box
- When the going gets tough, the tough get going
Covid-19 has offered an unexpected opportunity for creatives to reset and innovate
- From Idea to Idea App in 3 Days Flat
Hacking together an idea at the WeTransfer Hackathon
- More voices = better ideas
Our mission to bring more diverse voices to the table (and make sure they’re heard)
- Nelly Ben Hayoun and Arjun Appadurai on counter culture & education
Supporting pluralistic thinking with the University of the Underground
- The Trust Manifesto by Damian Bradfield
If you could reinvent the internet now, what would it look like?