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.
International Women's Month inspires us to recognize women across our company who are contributing to the work of our teams, clients and the tech industry as a whole. In this Q/A series, we feature a select group of our team members who share a bit about themselves and offer advice to others looking to enter the field.
Read more