Skip to content

Instantly share code, notes, and snippets.

@rudrankriyam
Last active November 24, 2019 05:06
Show Gist options
  • Select an option

  • Save rudrankriyam/a7222e1e4b25b0d8a72997a45e0e796d to your computer and use it in GitHub Desktop.

Select an option

Save rudrankriyam/a7222e1e4b25b0d8a72997a45e0e796d to your computer and use it in GitHub Desktop.
Creating an Apple like Splash Screen in SwiftUI Information Detail View
import SwiftUI
struct InformationDetailView: View {
var title: String = "title"
var subTitle: String = "subTitle"
var imageName: String = "car"
var body: some View {
HStack(alignment: .center) {
Image(systemName: imageName)
.font(.largeTitle)
.foregroundColor(.mainColor)
.padding()
.accessibility(hidden: true)
VStack(alignment: .leading) {
Text(title)
.font(.headline)
.foregroundColor(.primary)
.accessibility(addTraits: .isHeader)
Text(subTitle)
.font(.body)
.foregroundColor(.secondary)
.fixedSize(horizontal: false, vertical: true)
}
}
.padding(.top)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment