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 var showAlert = false | |
var body: some View { | |
Button(action: { | |
self.showAlert.toggle() | |
}, label: { | |
Text("SHOW ALERT") |
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 var showAlert = false | |
var body: some View { | |
Button(action: { | |
self.showAlert.toggle() | |
}, label: { | |
Text("SHOW ALERT") |
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 var showAlert = false | |
var body: some View { | |
Button(action: { | |
self.showAlert.toggle() | |
}, label: { | |
Text("SHOW ALERT") |
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 var showAlertOne = false | |
@State var showAlertTwo = false | |
var body: some View { | |
VStack{ | |
/// button 1 |
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 AlertItem: Identifiable { | |
var id = UUID() | |
var title = Text("") | |
var message: Text? | |
var dismissButton: Alert.Button? | |
var primaryButton: Alert.Button? | |
var secondaryButton: Alert.Button? | |
} |
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 var alertItem : AlertItem? | |
var body: some View { | |
VStack{ | |
/// button 1 | |
Button(action: { |
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 var alertItem : AlertItem? | |
var body: some View { | |
/// button | |
Button(action: { | |
self.alertItem = AlertItem(title: Text("I'm an alert"), message: Text("Are you sure about this?"), primaryButton: .default(Text("Yes"), action: { |
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 CategoryText: View { | |
@Binding var currentCategoryIndex : Int | |
@Binding var nestedPages : [Int] | |
var body: some View { | |
HStack(spacing: 20){ | |
Text("Music") | |
.font(.largeTitle).bold() | |
.foregroundColor(self.currentCategoryIndex == 0 ? .primary : .secondary) | |
.onTapGesture { | |
self.nestedPages = [0,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 SubCategoryText: View { | |
var subCategorys : [String] | |
@Binding var currentSubCategoryIndex : Int | |
@Binding var indicatorOffset : CGFloat | |
var body: some View { | |
HStack{ | |
subCategory(index: 0, parent: self) | |
subCategory(index: 1, parent: self) | |
subCategory(index: 2, parent: self) |
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 MediaContentView: View { | |
var colours : [Color] = [.red, .orange, .green, .pink, .purple, .yellow] | |
var body: some View { | |
ScrollView(.vertical, showsIndicators: true){ | |
ForEach(0..<10) {_ in | |
HStack{ | |
Rectangle() | |
.frame(width: UIScreen.main.bounds.size.width/6 , height: UIScreen.main.bounds.size.height/12) | |
.foregroundColor(self.colours[Int.random(in: 0 ... 5 )]) | |
VStack(alignment: .leading){ |
OlderNewer