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

new featurs from iOS16 doesn't work

Forums > SwiftUI

Hi, can someone help me please :(

struct ContentView: View {
    @Environment(\.horizontalSizeClass) var horizontalSizeClass

    var body: some View {
        let layout = horizontalSizeClass == .regular ? AnyLayout(HStack()) : AnyLayout(VStack())

        layout {
            Image(systemName: "1.circle")
            Image(systemName: "2.circle")
            Image(systemName: "3.circle")
        }
        .font(.largeTitle)
    }
}

this code doesn't work, "Cannot find 'AnyLayout' in scope". Where I have to change some settings to On iOS16 and xCOde 14.1beta? TY

2      

Target Platform in Project Settings is set to iOS16?

2      

Betas dont always have all the API mentioned in the WWDC. Make sure you are on xCode 14 beta and have the correct deployment set.

2      

@Hatsushira iOS 15.5, no 16 in list :(

@eoinnorris how to do that?

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.