Learning SwiftUI

Ok, I admit it. I’m a bit late in going through Apple’s tutorial on SwiftUI. That has had its good points–SwiftUI is amazing!!!–and its bad–much changes between Xcode5 beta updates. I will update this post regularly with some of the gotchas that I’ve found between the latest Xcode5 beta and the Apple SwiftUI tutorial. I hope this helps.

Working With UI Controls

In ProfileEditor.swift,

Picker("Seasonal Photo", selection: $profile.seasonalPhoto { ForEach(Profile.Season.allCases.identified(by: \.self)) { season in Text(season.rawValue).tag(season)
}
}

To avoid the error,

Value of type '[Profile.Season]' has no member 'identified'

ForEach() should be written as,

Picker("Seasonal Photo", selection: $profile.seasonalPhoto) { ForEach(Profile.Season.allCases, id: \.self) { season in Text(season.rawValue).tag(season)
}
}