SwiftUI:
Bridging
Perception and Reality
$ whoamI?
$ whoamI?
- Rizwan Ahmed
- Senior iOS Developer @zoho
- Blogger at ohmyswift.com
- 9+ years of experience in iOS
Our SwiftUI Journey
Challenges
- Convincing my manager!
When
something is
working
fi
ne, why do
you want to change
it?
🤬
My manager Me
Because it is
SwiftUI! 🤩
- Convincing my manager!
- Huge codebase
- Backward compatibility challenges
Challenges
Also the biggest
challenge was,
- The uncertainity
Our approach
- Keep the changes minimal
- Do the necessary research
- Be ready to revert changes
What exactly is SwiftUI?
The coffee machine analogy
SwiftUI always strikes a balance
Is SwiftUI declarative or imperative?
It is both!!
Getting started should be easy, but
delving deeper should be possible
SwiftUI’s behaviour across
Apple platforms
KYP
(Know Your Platform/Problem)
Button("Like",
systemImage:"hand.thumbsup") {…}
iOS macOS visionOS
Write once and
run everywhere
Learn once,
apply anywhere
Navigation in SwiftUI
Is it just us?
My Reddit discussion
Reddit post link
What were our options?
- Ease of navigation
- Ease of data transfer
Our solution
should have…
Well, two solid options…
- Use SwiftUI with
UINavigationController
- Use TCA
The Composable Architecture
(TCA) 🚀
We chose,
Pros Cons
Handles navigation properly
You will need to unlearn and
re-learn concepts
Backward compatibility
Separation of concerns
Easy to learn
It should not be applied to
every view
Accessibility
Accessibility is a fundamental
part of any great app
SwiftUI is designed with accessibility at its core
SwiftUI o
ff
ers built-in support for a wide range of
accessibility features
Have you ever thought of
teaching your designer,
SwiftUI?
SwiftUI as a design tool
- We always had problems with alignments
Challenges which we faced,
- The static designs didn’t give information about the
behaviour of our UI
- Platform speci
fi
c features were missing
We decided to design
our watchOS app in
SwiftUI !
The results,
Gained a deep understanding of each
platform's behavior.
Utilized platform-speci
fi
c features, such as
the Digital Crown and its sensitivity
Enabled rapid prototyping of our ideas.
Takeaways,
Get started by using UIHostingCon
fi
guration to
replace UITableViewCells with SwiftUI views
Use TCA, it maybe tough in the beginning but you
will get used to it
Consider other Apple platforms simultaneously
Try to use SwiftUI as a design tool
Thank you!
https://bento.me/rizwan95
SwiftUI in 2024: Bridging Perception and Reality

SwiftUI in 2024: Bridging Perception and Reality