UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

What’s new in SwiftUI for iOS 14

Text views, grids, color pickers, and more!

Paul Hudson       @twostraws

SwiftUI was inevitably going to see big changes this year, and I’m really excited to experiment with them all – text views, color pickers, progress views, and even limited support for grids have all landed. Alongside massive improvements to Swift itself (see What's new in Swift 5.3 for more on that), this is a huge leap forward for SwiftUI – we can now make a much wider range of apps.

Please keep in mind that these changes are very new – I'm pushing it as hard as I can, experimenting, refining, sharing, and learning all at the same time. If you have any feedback, please tweet me @twostraws.

You can watch the video below, or scroll down for links to articles.

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

The big stuff

More welcome improvements

New property wrappers

And there's more

Some existing API has seen improvements too:

Plus, improvements in Swift mean you can now use if let and switch statements inside function builders. In practice, this means you can unwrap and use optionals like this:

struct ContentView: View {
    @State var username: String?

    var body: some View {
        Group {
            if let username = username {
                Text("Welcome, \(username)")
            } else {
                Image(systemName: "questionmark.circle")
            }
        }
        .font(.largeTitle)
    }
}

More will come soon – watch this space!

Based on what I’ve seen, many features from wishlists are still missing, including:

  • No sign of compositional collection views – the new grids are more like flow layouts
  • No sign of a way to add a text field to an alert
  • No sign of visual effect views
  • No sign of WebKit integration
  • No sign of tertiary/quaternary colors from UIKit

…but that's okay! We can't get everything all at once, and there's always iOS 15 😅

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 4.6/5

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.