WWDC24 SALE: Save 50% on all my Swift books and bundles! >>

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      

Save 50% in my WWDC sale.

SAVE 50% To celebrate WWDC24, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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.