Skip to content

Instantly share code, notes, and snippets.

@icykol
Created December 9, 2019 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icykol/0dd0fd1ceb6ac56cd67f8948f5ce2fc4 to your computer and use it in GitHub Desktop.
Save icykol/0dd0fd1ceb6ac56cd67f8948f5ce2fc4 to your computer and use it in GitHub Desktop.
/*
See LICENSE folder for this sample’s licensing information.
Abstract:
A view showing the details for a landmark.
*/
import SwiftUI
struct LandmarkDetail: View {
var landmark:Landmark
var body: some View {
VStack {
MapView(coordinate:
landmark.locationCoordinate)
.edgesIgnoringSafeArea(.top)
.frame(height: 300)
CircleImage(image: landmark.image(forSize:
250))
.offset(x: 0, y: -130)
.padding(.bottom, -130)
VStack(alignment: .leading) {
Text(landmark.name)
.font(.title)
HStack(alignment: .top) {
Text(landmark.park)
.font(.subheadline)
Spacer()
Text(landmark.state)
.font(.subheadline)
}
}
.padding()
Spacer()
}
}
}
struct LandmarkDetail_Previews: PreviewProvider {
static var previews: some View {
LandmarkDetail(landmark: landmarkData[3])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment