By Oniel Rosario
At Sulzer US, we develop both native and hybrid iOS and Android applications. Our focus lies on maximizing device capabilities and ensuring high performance for the challenges we are tackling. As mobile development technologies are constantly evolving, we often explore new methods and tech products when creating bespoke solutions for enterprise clients. SwiftUI is a notable product worth sharing and one we are looking to employ in a number of current engagements.
SwiftUI is an innovative and simple way to build user interfaces across Apple devices. SwiftUI is native on all Apple platforms and available on devices that support iOS 13+, Xcode 11, and Catalina.
SwiftUI uses declarative syntaxes to state what the user interface should do. For example, it is possible to write a list of items consisting of text fields, then describe alignment, font, and color for each field in a single line text editing. For example: “ List(model.items, action: model selectItem) { item in Image(item.image) } ”
Benefits of SwiftUI over UIKit:
We still use UIKit or AppKit for some parts to avoid user experience loss. Swift UI can still be used in UIKit via UIViewRepresentable and UIViewControllerRepresentable. The APIs of UIHostingController is quite constricted. Updating values for and receiving events from SwiftUI in UIKit can be somewhat complex. Luckily, this can be made simpler through using Combine, and optionally, EnvironmentValues.
SwiftUI is Apple’s attempt to create declarative programming. The method is creative by leveraging the declarative programing with existing Swift features, such as generics. Although it is not mature yet, learning SwiftUI is a valuable tool because it is a solution that can better serve both users and developers.
To learn more about innovation at Sulzer US, please visit our website.
Spektrum44 is a UX, brand strategy, and design agency. We are partnering to redefine end-to-end digital solutions today - and into the future. In this issue, we profile their visual brand identify project developed for the IoT+ Network Association: The Internet of Things Online Community and Event Platform.
Read more