Conferences Condensed: 360iDev
A few of my favorite sessions
Last August, I got the chance to attend 360iDev, a long running iOS and macOS conference based in Denver, Colorado. After a two year hiatus from attending in-person conferences, I was excited to see a conference in action again. Since WWDC is right around the corner, here’s a refresher on some SwiftUI focused sessions—enjoy!
SwiftUI.View: Codable – Transforming SwiftUI to JSON for a fully backend driven UI
Florian starts by explaining the flexibility of SwiftUI static views via parameterization and dynamic screens with shipped views (also known as as optional or conditional views). Since SwiftUI views are structs they can automatically synthesize
Codable features for encoding and decoding JSON as long as the underlying properties also conform to Codable. Florian provides a neat demo for this which can be found here.
Async Await and more in Swift
Cameron starts off with an example of error prone completion handlers, the complexity for scale, and the inevitable pyramid of doom.
This talk goes over the familiar paradigm of async/await around error handling with throwing functions. Async/await isn’t limited to functions—they can be used with property getters and initializers. This talk also goes over the ergonomics of structured concurrency around
async let and the ability to run in parallel with
Task along with the hierarchy of
Task. Fun fact: you can use a
Task.Handle as a replacement to storing Combine’s
AnyCancellable to cancel a task and avoid any unnecessary background processing. Cameron also dives into shared mutable state with actors. This talk goes in depth around different use cases where you might want to use these features.
Multi-platform Development, the SwiftUI Way
Malin gives a delightful talk with a tour of Vancouver, Canada! Malin goes over the intricacies of developing a multi platform app for time tracking and invoicing, Orbit. This talk goes over the expectations of writing a SwiftUI app and the necessity to split views into components for reusability along with legacy code use cases. It also includes compiler directive examples within view modifiers and efficient ways to use them. Malin emphasizes the point that SwiftUI isn’t a write once, run everywhere solution but more of a learn once and apply to different platforms framework. This talk also goes over how to leverage UIKit within SwiftUI via protocols like
UIViewControllerRepresentable for more complex layouts, and using coordinators for communicating changes and handling interactions like transitions in a page view controller.
Ellen starts off with what C stands for in DocC, which is Compiler! Since the documentation compiler is tightly integrated with the swift compiler. At Lickability we document everything, so I was super excited to try this since Ellen mentioned how simple it is to use existing swift docs to generate a DocC version via the Xcode menu Product → Build Documentation. That will generate docs that look exactly like Apple’s via their documentation viewer:
Fancy! This talk also goes over how to add links to your types via a double back tick, e.g. ``AvatarImageView``. That will also trigger autocomplete since the swift compiler is used. DocC also accounts for typos in case types are misspelled which would trigger a warning. A caveat in symbol linking is that you can’t link to anything outside your library’s context. Linking for specific enum cases isn’t supported yet either. Ellen goes over the extensive limitations in DocC, including linking within related frameworks or even the standard library. Any public extensions of types that are not initially declared in your framework will not have documentation generated, which can be a pain point if you use extensions heavily. Ellen goes over how to view a DocC archive file by looking at the package contents, and explains that under the hood this is running as a Vue.Js instance—interesting! Since this conference talk, Apple has open sourced DocC.
Since this conference, we’ve been using a handful of these SwiftUI features at Lickability. It’s always exciting to see talks like these using SwiftUI in production or in testing!
Watch these and other sessions from 360iDev on their website.