How to Reuse SwiftUI Views with LibraryContentProvider and Swift Package
WWDC 2020 introduced several new features and improvements in the entire spectrum of develpment in Apple ecosystem, and definitely every developer found lots of things to get excited with. One of those features regard Xcode 12...
Using SwiftUI TextEditor for Multiline Text Input
The first version of SwiftUI doesn’t come with a native UI component for multiline text field. For multiline input, you can wrap a UITextView from the UIKit framework and make it available to your SwiftUI project by...
Building an Expandable List View with Inset Grouped Style Using SwiftUI
SwiftUI list is very similar to UITableView in UIKit. In the first release of SwiftUI, Apple’s engineers already made creating list view construction a breeze. You do not need to create a prototype cell and there is no...
Building Collection Views in SwiftUI with LazyVGrid and LazyHGrid
The initial release of SwiftUI didn’t come with a native collection view. You can either build your own solution or use third party libraries. In this year’s WWDC, Apple introduced tons of new features for the SwiftUI...
How to Access Photo Library and Use Camera in SwiftUI
Earlier, we explored the use of UIViewRepresentable and show you how to integrate UITextView into a SwiftUI project. While you can use the UIViewRepresentable protocol to wrap a UIKit view, but how about a view controller? You...
Creating a SwiftUI TextView Using UIViewRepresentable
I enjoy so much working with the SwiftUI framework. Like most new frameworks, however, one drawback is that it doesn’t come with all UI controls which are available in UIKit. For example, you can’t find a SwiftUI...
SwiftUI Tip: How to Remove Line Separators in List View
The List view in SwiftUI is very similar to the table view in UIKit. It is also designed for developers to present a list of items row by row. By default, each row of data is separated by a line separator. In UIKit, you can...
Building a Search Bar in SwiftUI
One recent question I got is about the implementation of search bar in SwiftUI projects. Unlike UIKit, SwiftUI doesn’t come with a built-in control for search bar. You may use the UIViewRepresentable protocol to reuse...
Introduction to MusicKit: Building a Music Player in SwiftUI
At WWDC 2017, Apple announced MusicKit, a framework to help developers build apps that allow users to play Apple Music and their local music library. Unlike most frameworks like ARKit or CoreML, MusicKit cannot be added to your...
Learn SwiftUI Using Swift Playgrounds for iPad and Mac
“I only have an iPad. Can I use it to develop iOS apps?” This is one of the most common questions for beginners. My answer is always “No, you need a Mac to run Xcode for iOS app development.” “But...