mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-17 23:13:58 +01:00
Remove deprecation warnings for Xcode beta4
This commit is contained in:
@@ -20,7 +20,7 @@ struct CategoryRow: View {
|
||||
|
||||
ScrollView(.horizontal) {
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
ForEach(self.items.identified(by: \.name)) { landmark in
|
||||
ForEach(self.items, id: \.name) { landmark in
|
||||
NavigationLink(
|
||||
destination: LandmarkDetail(
|
||||
landmark: landmark
|
||||
@@ -45,7 +45,7 @@ struct CategoryItem: View {
|
||||
.renderingMode(.original)
|
||||
.cornerRadius(5)
|
||||
Text(landmark.name)
|
||||
.color(.primary)
|
||||
.foregroundColor(.primary)
|
||||
.font(.caption)
|
||||
}
|
||||
.padding(.leading, 15)
|
||||
|
||||
@@ -23,13 +23,13 @@ struct HikeDetail: View {
|
||||
.frame(height: 200, alignment: .center)
|
||||
|
||||
HStack(spacing: 25) {
|
||||
ForEach(buttons.identified(by: \.0)) { value in
|
||||
ForEach(buttons, id: \.0) { value in
|
||||
Button(action: {
|
||||
self.dataToShow = value.1
|
||||
}) {
|
||||
Text(verbatim: value.0)
|
||||
.font(.system(size: 15))
|
||||
.color(value.1 == self.dataToShow
|
||||
.foregroundColor(value.1 == self.dataToShow
|
||||
? Color.gray
|
||||
: Color.accentColor)
|
||||
.animation(nil)
|
||||
|
||||
@@ -28,7 +28,7 @@ struct CategoryHome: View {
|
||||
.clipped()
|
||||
.listRowInsets(EdgeInsets())
|
||||
|
||||
ForEach(categories.keys.sorted().identified(by: \.self)) { key in
|
||||
ForEach(categories.keys.sorted(), id: \.self) { key in
|
||||
CategoryRow(categoryName: key, items: self.categories[key]!)
|
||||
}
|
||||
.listRowInsets(EdgeInsets())
|
||||
|
||||
@@ -35,7 +35,7 @@ struct LandmarkList: View {
|
||||
#if DEBUG
|
||||
struct LandmarksList_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ForEach(["iPhone SE", "iPhone XS Max"].identified(by: \.self)) { deviceName in
|
||||
ForEach(["iPhone SE", "iPhone XS Max"], id: \.self) { deviceName in
|
||||
LandmarkList()
|
||||
.previewDevice(PreviewDevice(rawValue: deviceName))
|
||||
.previewDisplayName(deviceName)
|
||||
|
||||
Reference in New Issue
Block a user