mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-27 02:58:43 +02:00
34 lines
852 B
Swift
Executable File
34 lines
852 B
Swift
Executable File
/*
|
||
See LICENSE folder for this sample’s licensing information.
|
||
|
||
Abstract:
|
||
A view showing a list of landmarks.
|
||
*/
|
||
|
||
import SwiftUI
|
||
|
||
struct LandmarkList: View {
|
||
var body: some View {
|
||
NavigationView {
|
||
List(landmarkData) { landmark in
|
||
NavigationLink(destination: LandmarkDetail(landmark: landmark)) {
|
||
LandmarkRow(landmark: landmark)
|
||
}
|
||
}
|
||
.navigationBarTitle(Text("Landmarks"), displayMode: .large)
|
||
}
|
||
}
|
||
}
|
||
|
||
#if DEBUG
|
||
struct LandmarkList_Previews: PreviewProvider {
|
||
static var previews: some View {
|
||
ForEach(["iPhone SE", "iPhone XS Max"], id: \.self) { deviceName in
|
||
LandmarkList()
|
||
.previewDevice(PreviewDevice(rawValue: deviceName))
|
||
.previewDisplayName(deviceName)
|
||
}
|
||
}
|
||
}
|
||
#endif
|