mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-07-07 13:25:12 +02:00
Add examples project
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
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
|
||||
NavigationButton(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"].identified(by: \.self)) { deviceName in
|
||||
LandmarkList()
|
||||
.previewDevice(PreviewDevice(rawValue: deviceName))
|
||||
.previewDisplayName(deviceName)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user