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.
In the last installment of our Women in Tech Spotlight Series meet Venus Yu, a Full Stack Developer by day, craft artist and musician in her free time. Venus shares an honest and reflective experience on how she discovered a passion for software development, and where fellow women techies can focus their energies when pursuing a career in the IT field.
Read more