UIKit or SwiftUI: what to use in production?
How ready is SwiftUI for use in large production apps? In this post, Alexey Naumov considers this question and shows us how to structure a project with a UI layer that can be easily detached and replaced.
Posted on October 13, 2020
#swiftui
#uikit
Importing interactive UIKit views into SwiftUI
One of SwiftUI's strengths is that it works with existing Apple UI frameworks such as UIKit. This enables us to reuse our existing UIKit components when introducing SwiftUI into a project. In this post, John Sundell shows us how to bring a UIKit-based view into a SwiftUI view hierarchy.
Posted on October 12, 2020
#swiftui
#uikit
Encapsulating SwiftUI view styles
When working with UI frameworks such as SwiftUI, it's desirable to separate the structure of our view components from the styles applied to them. In this post, John Sundell looks at several tools and techniques that we can use to do exactly that when creating custom SwiftUI views.
Posted on October 5, 2020
#swiftui
#encapsulation
Appleās use of Swift and SwiftUI in iOS 14
Since 2015, Alexandre Colucci has analyzed each iOS release to measure how many system applications were using Swift. In this post, Alexandre Colucci shows us how Apple's use of Swift has evolved with iOS 14 and also extends his analysis to measure how many built-in apps use SwiftUI.
Posted on October 4, 2020
#ios14
#swiftui
Handling Undo & Redo in SwiftUI
The UndoManager type, available in Apple's Foundation framework, provides a general-purpose recorder of operations that enables undo and redo actions. In this post, Matthaus Woolard describes a Provider pattern he uses to improve how UndoManager integrates with SwiftUI.
Posted on October 4, 2020
#swiftui
#macos
#ios
SwiftUI View Modifiers and if #available
When applied to a SwiftUI View, a ViewModifier produces a different version of the original value. In this post, Adam Overholtzer provides an extension on the View type, combining view modifiers with platform availability checks to conditionally apply the modifier.
Posted on October 2, 2020
#swiftui
Tabs and pages in SwiftUI
SwiftUI's TabView is a view that switches between child views using interactive user interface elements. In this short post, Majid Jabrayilov demonstrates the basics of using TabView, and also shows us how to configure it to behave as a paging view.
Posted on September 29, 2020
#swiftui
The State of SwiftUI
Since SwiftUI's release in 2019, Apple has continued to evolve the framework, fixing many of the issues that were present in the early versions. In this post, Peter Steinberger takes a look at the current state of SwiftUI. Although Peter doesn't recommend going all-in on SwiftUI for production apps, he does recognize that it's the future at Apple, and many of the current concerns will be resolved over the coming years.
Posted on September 28, 2020
#swiftui
#uikit
#appkit
Impossible SwiftUI views
Swift's Never is an enum that represents a type with no values. It's commonly used as the return type of closures, functions, or methods that do not return normally. SwiftUI also makes use of Never, by extending it to conform to its View protocol. In this post, Federico Zanetello explores SwiftUI's inner workings to show us why.
Posted on September 27, 2020
#swiftui
Building widgets in SwiftUI
Apple's WidgetKit framework, available in Xcode 12, enables us to build widgets that show relevant, glanceable content from an app on the iOS Home screen or macOS Notification Center. Widget views are built exclusively using SwiftUI, and in this post, Majid Jabrayilov shares his experience of building and updating widgets.
Posted on September 22, 2020
#swiftui
#widgetkit