TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

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      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

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.