This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var redirectToApp = function () { | |
setTimeout(function appNotInstalled() { | |
window.location.replace("[Somewhere else like your youtube ad]"); | |
}, 100); | |
window.location.replace("[iOS App Store URL]"); | |
}; if (/iPad|iPhone|iPod/.test(navigator.userAgent)) { | |
window.location.replace("[iOS App Store URL]"); | |
} else if (/android/i.test(navigator.userAgent)) { | |
window.location.replace("[Android Play Store URL]"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var shouldShowErrorLabel = false | |
init() { | |
UINavigationBar.appearance().backgroundColor = .blue | |
UINavigationBar.appearance().largeTitleTextAttributes = [ | |
.foregroundColor : UIColor.white, | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension AnyTransition { | |
static var fadeAndSlide: AnyTransition { | |
AnyTransition.opacity.combined(with: .move(edge: .top)) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
let itemsForSale = [ | |
Item(id: 1, title: "Mask", price: 5.0, description: "A mask is an object normally worn on the face, typically for protection, disguise, performance, or entertainment. ... They are usually worn on the face, although they may also be positioned for effect elsewhere on the wearer's body", onSale: true), | |
Item(id: 2, title: "Sanitizer", price: 15.0, description: "Hand sanitiser, hand antiseptic, hand disinfectant, hand rub, handrub. Hand sanitizer is a liquid, gel, or foam generally used to decrease infectious agents on the hands.", onSale: false), | |
Item(id: 3, title: "Vitamin", price: 25.0, description: "Vitamins are nutrients your body needs to develop and function properly. There are 13 essential vitamins: A, D, E, and K, which are fat-soluble, and vitamins C and the B-complex group, which are water-soluble. Each vitamin has a distinct role in keeping you healthy.", onSale: false), | |
] | |
var body: some View { | |
Scroll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CardView: View { | |
var title: String | |
var description: String | |
var price: Double | |
var isOnSale: Bool | |
private let cardHeight: CGFloat = 300.0 | |
private let cardWidth: CGFloat = 200.0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Item: Identifiable { | |
var id: Int | |
var title: String | |
var price: Double | |
var description: String | |
var onSale: Bool | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ModalView: View { | |
var body: some View { | |
NavigationView { | |
VStack { | |
Spacer() | |
Text("ModalView") | |
Spacer() | |
}.modifier(RedNavigationBar(title: "Modal")) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@ObservedObject var viewModel = ContentViewModel() | |
var genderSegmentedControl: some View { | |
Picker("", selection: $viewModel.selectedSegment.onChange(sectionChange)) { | |
Text("Male").tag(Gender.male.rawValue) | |
Text("Female").tag(Gender.female.rawValue) | |
} | |
.pickerStyle(SegmentedPickerStyle()) |
NewerOlder