Building iOS 14 Widgets for Carousell - Part 2
Article Summary
Jay Ang and Beemo Lee from Carousell's iOS team shipped their first iOS 14 widget in 2020. Their biggest challenge? Two singleton instances fighting each other across app targets.
When Apple launched iOS 14 widgets, Carousell jumped on the opportunity to bring their Activity tab to users' home screens. The team had to navigate uncharted territory with limited documentation, relying on WWDC videos to answer basic questions about widget capabilities. This deep dive reveals the technical hurdles they hit and the creative solutions they built.
Key Takeaways
- Used DispatchGroup to coordinate multiple API calls for accurate unread counts
- Solved authentication sync by instantiating APIManager per timeline update
- Changed Keychain accessibility to kSecAttrAccessibleAfterFirstUnlock for locked device updates
- Cached latest data to handle network failures gracefully
- Fixed TestFlight nested bundle errors with custom Run Script
Critical Insight
Carousell successfully launched their iOS 14 widget by solving cross-target singleton conflicts, authentication syncing, and keychain accessibility issues that most teams will encounter.