Post

Replies

Boosts

Views

Activity

Reply to Print something on the screen
I've defined the text here, how can I change the value of it? VStack{             Text("text")                          Button {                              } label: {                 ZStack {                     Circle()                         .frame(width: 90, height: 90)                         .foregroundColor(Color(.systemBlue))                         .opacity(0.5)                                          Text("5")                         .font(.largeTitle)                         .bold()                         .foregroundColor(.black)                 }                 .frame(width: 90, height: 90)             }         }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Print something on the screen
I'm trying to do it in Swift Playgrounds and here's my code: import PlaygroundSupport let columns: [GridItem] = [GridItem(.flexible()),                            GridItem(.flexible()),                            GridItem(.flexible())] struct ContentView: View {     var body: some View {         GeometryReader { geometry in             VStack {                 Spacer(minLength: 290)                 Text("text")                     .font(.largeTitle)                 ZStack {                     LazyVGrid(columns: columns) {                         Group {                             Button {                                                              } label: {                                 ZStack {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                     //.position(x: geometry.size.width/2, y: -100)                                                                          Text("5")                                         .font(.largeTitle)                                         .bold()                                         .foregroundColor(.black)                                 }                                 .frame(width: 90, height: 90)                             }                         }                     }                 }             }                      }                                  } } PlaygroundPage.current.setLiveView(ContentView()) I've created a text and I would like that the text will change on the press of the button. For example: there's a Text() witch now has written on it "text" and when I press the blue button (you can see it in my code), I want "text" to change to number "5"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Print something on the screen
I created the structure down the "let columns" above the ContentView and I called the NumberView in the Button's action and now the error it's gone. But when I play my code and click the button it doesn't show me the text. Can't understand why...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Idea for next iOS
Great idea, but I don’t think that it changes to much, already iPhone or other Apple products are very simple to use (brilliant colors, icons, animations, accessibility features and more). I see many old people transferring to iPhone because of its simplicity… And all the features you said are already possible, so we don’t have to make easier a thing that is already easy, doing so it will become more complex for us and also for the user
Topic: App & System Services SubTopic: Core OS Tags:
Jan ’22
Reply to Add Text to an animated object
I putted .overlay(Text("Hello, world!")) before .rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0))), so this is my syntax now: RoundedRectangle(cornerRadius: 20)                     .frame(width: 140, height: 170)                     .foregroundColor(self.flipped1 ? .yellow : .purple)                     .padding()                     .overlay(Text("Hello, world!"))                      .rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0)))                     .animation(.default)                      .onTapGesture {                         self.flipped1.toggle()                     }  I want the rectangle to show the text only on one face (only when it is flipped)... Instead now he shows it on all 2 faces
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Print something on the screen
I've defined the text here, how can I change the value of it? VStack{             Text("text")                          Button {                              } label: {                 ZStack {                     Circle()                         .frame(width: 90, height: 90)                         .foregroundColor(Color(.systemBlue))                         .opacity(0.5)                                          Text("5")                         .font(.largeTitle)                         .bold()                         .foregroundColor(.black)                 }                 .frame(width: 90, height: 90)             }         }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to Print something on the screen
I'm trying to do it in Swift Playgrounds and here's my code: import PlaygroundSupport let columns: [GridItem] = [GridItem(.flexible()),                            GridItem(.flexible()),                            GridItem(.flexible())] struct ContentView: View {     var body: some View {         GeometryReader { geometry in             VStack {                 Spacer(minLength: 290)                 Text("text")                     .font(.largeTitle)                 ZStack {                     LazyVGrid(columns: columns) {                         Group {                             Button {                                                              } label: {                                 ZStack {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                     //.position(x: geometry.size.width/2, y: -100)                                                                          Text("5")                                         .font(.largeTitle)                                         .bold()                                         .foregroundColor(.black)                                 }                                 .frame(width: 90, height: 90)                             }                         }                     }                 }             }                      }                                  } } PlaygroundPage.current.setLiveView(ContentView()) I've created a text and I would like that the text will change on the press of the button. For example: there's a Text() witch now has written on it "text" and when I press the blue button (you can see it in my code), I want "text" to change to number "5"
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Print something on the screen
I have tried, but it gives me this error…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Print something on the screen
I created the structure down the "let columns" above the ContentView and I called the NumberView in the Button's action and now the error it's gone. But when I play my code and click the button it doesn't show me the text. Can't understand why...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Swift Playgrounds
Okay thanks!
Replies
Boosts
Views
Activity
Jan ’22
Reply to Idea for next iOS
Great idea, but I don’t think that it changes to much, already iPhone or other Apple products are very simple to use (brilliant colors, icons, animations, accessibility features and more). I see many old people transferring to iPhone because of its simplicity… And all the features you said are already possible, so we don’t have to make easier a thing that is already easy, doing so it will become more complex for us and also for the user
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Print something on the screen
Now it's working. Thanks to both of you!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to iPhone Simulator in Swift Playgrounds
So Swift Playgrounds isn’t for building apps?
Replies
Boosts
Views
Activity
Jan ’22
Reply to iPhone Simulator in Swift Playgrounds
ok, so can I use the Mac Swift Playgrounds too?
Replies
Boosts
Views
Activity
Jan ’22
Reply to iPhone Simulator in Swift Playgrounds
But for creating a playground instead of an app is it ok?
Replies
Boosts
Views
Activity
Jan ’22
Reply to iPhone Simulator in Swift Playgrounds
But isn’t TestFlight just for publishing apps?
Replies
Boosts
Views
Activity
Jan ’22
Reply to Add Text to an animated object
I putted .overlay(Text("Hello, world!")) before .rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0))), so this is my syntax now: RoundedRectangle(cornerRadius: 20)                     .frame(width: 140, height: 170)                     .foregroundColor(self.flipped1 ? .yellow : .purple)                     .padding()                     .overlay(Text("Hello, world!"))                      .rotation3DEffect(self.flipped1 ? Angle(degrees: 180): Angle(degrees: 0), axis: (x: CGFloat(0), y: CGFloat(10), z: CGFloat(0)))                     .animation(.default)                      .onTapGesture {                         self.flipped1.toggle()                     }  I want the rectangle to show the text only on one face (only when it is flipped)... Instead now he shows it on all 2 faces
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Add Text to an animated object
Yes it is correct. Thanks very much!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Need a help with my app
Thanks very much, it's exactly what I want! Can you explain me what you did in the tapped() function? Because it's a little bit confusing to understand.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Keep face up the cards if equal
Where did you define the number of the cards?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22