Post

Replies

Boosts

Views

Activity

Error in my code
Hi everyone! I was working on a playground in Swift Playground and I got an error. I can't understand what this error means, can anyone help me? This is my code: struct Preview: View {     @State var isPlaying = true     @State var num1 = 60     @State var num2 = 150     var body: some View {         if isPlaying == true { // ERROR: Only concrete types such as structs, enums and classes can conform to protocols // Required by static method 'buildBlock' where 'C0' = ()             num1 += 1             print("\(num1)")         }     } } Thanks.
1
0
681
Apr ’22
Problems with Swift Playgrounds
Hello world! I was creating a playground with Swift Playgrounds, and I created a .swift files and should connect these files to ContentView(), but when I write that file name on ContentView() it tells me "Cannot find ... in scope". Does anyone know why this error and how to fix it? Thanks in advance from heart.
3
0
1.2k
Apr ’22
WWDC22 Special Event
Hello everyone! I had a question about the Apple’s WWDC Special event, hope someone can resolve my doubts. For taking part of this event, will the event for invites be online or we have to go at Cupertino? Because I read some articles that says the event for developers will in-person. Quindi sono un po’ confusa, per favore aiutatemi se riuscite ;)
0
0
1.1k
May ’22
Xcode issue
Hello everyone! I recently updated my Mac to macOS Ventura, everything was updated as expected, but I'm having a problem with Xcode, I also updated Xcode, but when I clicked on it for opening it, a message appeared which says that "In order to use Xcode, you need to update to the latest version" (despite having already updated it), so, when I go on App Store for updating it again, it already says me to open, and there isn't the Update option. I'm troubling with this problem... please if anyone knows how to fix it, help me. Thank you.
4
0
3.2k
Jun ’22
App crashed
Hello there! I was trying to build an app with the new App feature in Swift Playgrounds for Mac. But I have an error message in my code, and I can't understand how to fix it. Can anyone help me to solve this error. Here's the code: import SwiftUI struct Something: View {     let rows = 17     let columns = 17     let size: CGFloat = 10     let blocks: [[Color]] = [[.purple, .purple]]     var body: some View {         VStack {             ForEach((0...self.rows - 1), id: \.self) { row in                  HStack (spacing: 0) {                     ForEach((0...self.columns - 1), id: \.self) { col in                         VStack (spacing: 0) {                             Rectangle()                                 .frame(width: self.size, height: self.size)                                 .foregroundColor(self.blocks[row][col]) // index out of range: the requested index was outside the bounds of the array.                         }                     }                 }             }         }     } }
1
0
841
Jun ’22
Build a website from scratch
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? If someone has the right answer, please help me. Thanks.
Topic: Safari & Web SubTopic: General Tags:
1
0
1.2k
Aug ’22
App suggestion
Hi developers! Does anyone know an app to make a short animated film like this https://youtu.be/a4PraWW82_A, which is also free? I used Procreate before, but there is the layer limit and since my video is a little long I need more layouts :( thanks in advance
Topic: Design SubTopic: General Tags:
1
0
912
Aug ’22
How to fix these errors?
Hello there! I want to create a cards game, and I'm creating it following the Stanford University's tutorial. I followed the video step by step but there is a warning that In the video doesn't appear. Can someone help me to fix it? Here's the link of the video: [https://www.youtube.com/watch?v=oWZOFSYS5GE&t=671s) This is my code: import SwiftUI struct ContentView: View {     let viewModel: EmojiMemoryGame     var body: some View {         VStack {                 LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) {                     ForEach(viewModel.cards) { card in                         CardView(card: card)                             .aspectRatio(aspectRatio, contentMode: .fit) // here's the first error which says "Cannot convert value of type '(CGFloat?, ContentMode) -> some View' to expected argument type 'CGSize'"                     }                 }                 .padding()                 .foregroundColor(Color(.systemTeal))                                  Spacer()                 Button {                     emojiCount += 1                     if emojiCount == 10 {                         aspectRatio = 9/3                     } ì                     if emojiCount > 17 {                         print("Card finished")                     }                 } label: {                     Text("Add Card")                 }             }         }     } struct CardView: View {     let card: MemoryGame<String>.Card          var body: some View {         ZStack {             let shape = RoundedRectangle(cornerRadius: 20)             if card.isFaceUp {                 shape.fill().foregroundColor(.white)                 shape.stroke(lineWidth: 3)                 Text(card.content).font(.system(size: 50))             } else {                 shape.fill(.orange)             }         }     } } struct ContentView_Previews:     PreviewProvider {         static var previews: some View {             ContentView(viewModel: game) //here's the second error which says "Cannot find 'game' in scope"     } }
14
0
1.9k
Aug ’22
Build a website
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? And what is the WebKit, can I still use it to build web pages using SwiftUI? If someone has the right answer, please help me. Thanks.
2
0
3k
Aug ’22
Password Animation
Hello guys! I need a little help. I want to create a password animation using SwiftUI, but can't understand how, if you can help me I'll appreciate it a lot. For example when I write something, after I finished the word, it'll turn into points. I hope you understand what I mean. Thanks in advance.
0
0
818
Oct ’22
No profiles founded
Hi friends! I was developing an app, everything was working OK, but when I played the app on my iPhone connecting it via cable to the Mac an error has appeared and it says "The operation couldn't be completed. Unable to log in with account ... " "No profiles for ... were found: Xcode couldn't find any iOS app Development provisioning devices matching ..." and I'm not able to try it on my iPhone. Any suggestion or idea to fix these errors?
0
0
740
Nov ’22
Error in my code
Hi everyone! I was working on a playground in Swift Playground and I got an error. I can't understand what this error means, can anyone help me? This is my code: struct Preview: View {     @State var isPlaying = true     @State var num1 = 60     @State var num2 = 150     var body: some View {         if isPlaying == true { // ERROR: Only concrete types such as structs, enums and classes can conform to protocols // Required by static method 'buildBlock' where 'C0' = ()             num1 += 1             print("\(num1)")         }     } } Thanks.
Replies
1
Boosts
0
Views
681
Activity
Apr ’22
Problems with Swift Playgrounds
Hello world! I was creating a playground with Swift Playgrounds, and I created a .swift files and should connect these files to ContentView(), but when I write that file name on ContentView() it tells me "Cannot find ... in scope". Does anyone know why this error and how to fix it? Thanks in advance from heart.
Replies
3
Boosts
0
Views
1.2k
Activity
Apr ’22
Where to put variables/constants
Hi there! I have a public structure and I called it in my ContentView, but I can't understand where to punt the var/let. I try to put them before "var body: some view" but it gives me these errors.
Replies
1
Boosts
0
Views
712
Activity
Apr ’22
How to export an Xcode project into a Swift Playgrounds playground
Hello guys! Does anyone know how to export an Xcode app project in na Swift Playgrounds' playground?
Replies
0
Boosts
0
Views
640
Activity
Apr ’22
How to put in casual position objects in SwiftUI
Hey there! I have a Circle, and I would like to create many on this circle and display them in random position on the screen. Is it possible? Thanks in advance.
Replies
5
Boosts
0
Views
1.6k
Activity
Apr ’22
Neumorphic Button SwiftUI
Hello there! I'm trying to create a button with a neumorphic animation using SwiftUI, with a smooth animation when the user taps it. Something like this: Can someone help me to figure out this, please? Thanks!
Replies
3
Boosts
0
Views
1.1k
Activity
May ’22
WWDC22 Special Event
Hello everyone! I had a question about the Apple’s WWDC Special event, hope someone can resolve my doubts. For taking part of this event, will the event for invites be online or we have to go at Cupertino? Because I read some articles that says the event for developers will in-person. Quindi sono un po’ confusa, per favore aiutatemi se riuscite ;)
Replies
0
Boosts
0
Views
1.1k
Activity
May ’22
Xcode issue
Hello everyone! I recently updated my Mac to macOS Ventura, everything was updated as expected, but I'm having a problem with Xcode, I also updated Xcode, but when I clicked on it for opening it, a message appeared which says that "In order to use Xcode, you need to update to the latest version" (despite having already updated it), so, when I go on App Store for updating it again, it already says me to open, and there isn't the Update option. I'm troubling with this problem... please if anyone knows how to fix it, help me. Thank you.
Replies
4
Boosts
0
Views
3.2k
Activity
Jun ’22
App crashed
Hello there! I was trying to build an app with the new App feature in Swift Playgrounds for Mac. But I have an error message in my code, and I can't understand how to fix it. Can anyone help me to solve this error. Here's the code: import SwiftUI struct Something: View {     let rows = 17     let columns = 17     let size: CGFloat = 10     let blocks: [[Color]] = [[.purple, .purple]]     var body: some View {         VStack {             ForEach((0...self.rows - 1), id: \.self) { row in                  HStack (spacing: 0) {                     ForEach((0...self.columns - 1), id: \.self) { col in                         VStack (spacing: 0) {                             Rectangle()                                 .frame(width: self.size, height: self.size)                                 .foregroundColor(self.blocks[row][col]) // index out of range: the requested index was outside the bounds of the array.                         }                     }                 }             }         }     } }
Replies
1
Boosts
0
Views
841
Activity
Jun ’22
Build a website from scratch
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? If someone has the right answer, please help me. Thanks.
Topic: Safari & Web SubTopic: General Tags:
Replies
1
Boosts
0
Views
1.2k
Activity
Aug ’22
App suggestion
Hi developers! Does anyone know an app to make a short animated film like this https://youtu.be/a4PraWW82_A, which is also free? I used Procreate before, but there is the layer limit and since my video is a little long I need more layouts :( thanks in advance
Topic: Design SubTopic: General Tags:
Replies
1
Boosts
0
Views
912
Activity
Aug ’22
How to fix these errors?
Hello there! I want to create a cards game, and I'm creating it following the Stanford University's tutorial. I followed the video step by step but there is a warning that In the video doesn't appear. Can someone help me to fix it? Here's the link of the video: [https://www.youtube.com/watch?v=oWZOFSYS5GE&t=671s) This is my code: import SwiftUI struct ContentView: View {     let viewModel: EmojiMemoryGame     var body: some View {         VStack {                 LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) {                     ForEach(viewModel.cards) { card in                         CardView(card: card)                             .aspectRatio(aspectRatio, contentMode: .fit) // here's the first error which says "Cannot convert value of type '(CGFloat?, ContentMode) -> some View' to expected argument type 'CGSize'"                     }                 }                 .padding()                 .foregroundColor(Color(.systemTeal))                                  Spacer()                 Button {                     emojiCount += 1                     if emojiCount == 10 {                         aspectRatio = 9/3                     } ì                     if emojiCount > 17 {                         print("Card finished")                     }                 } label: {                     Text("Add Card")                 }             }         }     } struct CardView: View {     let card: MemoryGame<String>.Card          var body: some View {         ZStack {             let shape = RoundedRectangle(cornerRadius: 20)             if card.isFaceUp {                 shape.fill().foregroundColor(.white)                 shape.stroke(lineWidth: 3)                 Text(card.content).font(.system(size: 50))             } else {                 shape.fill(.orange)             }         }     } } struct ContentView_Previews:     PreviewProvider {         static var previews: some View {             ContentView(viewModel: game) //here's the second error which says "Cannot find 'game' in scope"     } }
Replies
14
Boosts
0
Views
1.9k
Activity
Aug ’22
Build a website
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? And what is the WebKit, can I still use it to build web pages using SwiftUI? If someone has the right answer, please help me. Thanks.
Replies
2
Boosts
0
Views
3k
Activity
Aug ’22
Password Animation
Hello guys! I need a little help. I want to create a password animation using SwiftUI, but can't understand how, if you can help me I'll appreciate it a lot. For example when I write something, after I finished the word, it'll turn into points. I hope you understand what I mean. Thanks in advance.
Replies
0
Boosts
0
Views
818
Activity
Oct ’22
No profiles founded
Hi friends! I was developing an app, everything was working OK, but when I played the app on my iPhone connecting it via cable to the Mac an error has appeared and it says "The operation couldn't be completed. Unable to log in with account ... " "No profiles for ... were found: Xcode couldn't find any iOS app Development provisioning devices matching ..." and I'm not able to try it on my iPhone. Any suggestion or idea to fix these errors?
Replies
0
Boosts
0
Views
740
Activity
Nov ’22