Post

Replies

Boosts

Views

Activity

Reply to Extra argument in call
let columns: [GridItem] = [GridItem(.flexible()),                            GridItem(.flexible()),                            GridItem(.flexible())] struct ContentView: View {     var body: some View {         GeometryReader { geometry in             VStack{                 Spacer()                 ZStack {                     LazyVGrid(columns: columns) {                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Circle()                             .frame(width: 100, height: 100)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                         Rectangle()                             .frame(width: 200, height: 80)                             .foregroundColor(Color(.systemBlue))                             .opacity(0.5)                             .cornerRadius(60)                             .position(x: 114, y: 55)                         Circle()                     }                 }                 Spacer()             }         }              } } struct contentView_Previews: PreviewProvider {     static var previews: some View {         ContentView() .previewInterfaceOrientation(.portrait)     } } In the last Circle(), it shows me Error.
Dec ’21
Reply to Apple Developer Program
You must be over 18 (or over the majority age in your country) to enroll into Apple Developer Program, and in case you're not, you have to enroll with your mother or father's information (so your mother's/father's name, phone number, etc...) when you'll be over the majority of age you can post apps under your name.
Dec ’21
Reply to Change the position of a shape
Here's the code, it isn't easy to explain... but if you copy/paste my code you'll notice that there is a frame around the rounded rectangle that I've created and that frame isn't aligned with the "rounded rectangle" so when I try to click on the rounded rectangle, because it is a button, I can't click on any side of it, the click works only if I touch the part that covers the frame. It is clear, now? Don't worry if you try to paste my code, you'll notice that there is something that isn't working. GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { GeometryReader { geometry in VStack{ Spacer() ZStack { LazyVGrid(columns: columns) { Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) } Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Rectangle() .frame(width: 200, height: 80) .foregroundColor(Color(.systemBlue)) .opacity(0.5) .cornerRadius(60) .position(x: 114, y: 55) Circle() } } } Spacer() } } } }
Dec ’21
Reply to Change the position of a shape
let columns: [GridItem] = [GridItem(.flexible()),                            GridItem(.flexible()),                            GridItem(.flexible()),                            GridItem(.flexible())] struct ContentView: View {     var body: some View {             GeometryReader { geometry in                     VStack{                                                  Spacer(minLength: 290)                                                ZStack {                                                      LazyVGrid(columns: columns) {                                 Group {                                     Button {                                                                              } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                                     Button {                                                                              } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                                     Button {                                                                              } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                                     Button {                                     } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                                     Button {                                     } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                                     Button {                                     } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                     }                             }                             Group {                                  Button {                                        } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                 Button {                                 } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                 Button {                                 } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                 Button {                                 } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                                                  Button {                                                                   } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                 Button {                                 } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                 Button {                                                     } label: {                                     Rectangle()                                         .frame(width: 180, height: 80)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                         .cornerRadius(60)                                         .position(x: 90, y: 44)                                 }                                   Spacer()                                                             Button {                                 } label: {                                     Circle()                                         .frame(width: 90, height: 90)                                         .foregroundColor(Color(.systemBlue))                                         .opacity(0.5)                                 }                                     Button {                                     } label: {                                         Circle()                                             .frame(width: 90, height: 90)                                             .foregroundColor(Color(.systemBlue))                                             .opacity(0.5)                                         }                                 }                             }                         }                     }                         Spacer()                 }             }         }
Dec ’21
Reply to Result of 'Text' initializer is unused
Oh ops, now I've defined the Number, but despite it gives me the same warning... my goal is to change the text "hello" to number 1 when I click on it. var Number = 1 struct NewView: View {     var body: some View {         Button {             tapped()         } label: {             Text("hello")         }     } }               func tapped() {     Text("\(Number)") } struct NewView_Previews: PreviewProvider {     static var previews: some View {         NewView()     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21
Reply to Result of 'Text' initializer is unused
Actually I'm a SwiftUI self-taught, and there's no one who can teach me here, but I'd like to learn it so I try to do what I can but that's not enough... I know that copying others' code makes no sense but also there I try to understand how people arrived at that solution, it isn't very easy sometimes...
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’21