Post

Replies

Boosts

Views

Activity

Same content in 2 cards
Hello there! I'm trying to create something in SwiftUI, but there's a problem: I can't have 2 cards with the same content, does anyone know a way to have the same emojis in 2 separate cards? Here's my code: import PlaygroundSupport import SwiftUI struct ContentView: View {     var emojis: [String] = ["🐶", "🐱", "🐱", "🦊", "🦁", "🐝", "🐼", "🐷", "🐮"]     var body: some View {         LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) {             ForEach(emojis, id: \.self, content: { emoji in                 emojiView(content: emoji)             })     } }     struct emojiView: View {         var content: String = ""         var body: some View {             ZStack {                 RoundedRectangle(cornerRadius: 20)                     .frame(width: 90, height: 120)                     .foregroundColor(.yellow)                 Text(content).font(.largeTitle)             }         }     } } PlaygroundPage.current.setLiveView(ContentView())
2
0
3.7k
Mar ’22
Expand the circle throughout the screen in SwiftUI
Hi there! I'm trying to build something in SwiftUI and I need a help on it. I want the orange circle to scale and expand, and fill the entire screen, whenI click on it. Here's my code: import SwiftUI struct ContentView: View {     var body: some View {        Circle()             .frame(width: 120, height: 120)             .foregroundColor(.orange)     } } Thank you.
1
0
1.7k
Apr ’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.
1
0
688
Apr ’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.3k
Jun ’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
950
Aug ’22
Error appeared
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?
2
0
1.3k
Dec ’22
Need a help
Hi there, I'm studying SwiftUI on my own, but unfortunately I'm still not able to write complex lines of code, or even code an app independently, which is very frustrating for me. I love coding, it's a way to express my creativity. I already have a lot of ideas, but I can't put them into practice because I feel like I don't have learned enough about this programming language. Can any of you suggest me some free courses or other resources that have also helped you in your first steps with coding?
2
0
1.1k
Jul ’23
Falling effect SwiftUI
Hi everyone! import SwiftUI struct ContentView: View { let screenHeight = UIScreen.main.bounds.height let letters: [String] = ["A", "B"] @State private var yOffset: CGFloat = 0.0 var body: some View { ForEach(letters, id: \.self) { letter in Text(letter) .padding() .font(.largeTitle) .offset(x: 0, y: yOffset) .animation(Animation.linear(duration: 5.0).repeatForever(autoreverses: false)) .onAppear { yOffset = screenHeight - 90 } } } } I would like in this code, the letters to fall from the beginning of the screen to its end, I have the size of screen's height, but actually I can't understand how I can I use it, until the letters can start from the beginning of the screen. And I would also like that once they reach the bottom, they start falling again... I can't understand how this effect can be achieved, is there anyone who can help me?
1
0
649
Feb ’24
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
3.1k
Aug ’22
Error installing iOS 17.2 Simulator Xcode
Hello and happy new year to all! I've updated Xcode but I'm having a problem installing the iOS 17.2 Simulator. It's the 4th time I'm trying to download it, but it gives me this error: I've also download watchOS which is successfully installed, but I can't understand why only iOS is having some issues. If someone knows how to fix this issue, please help me, I'm unable to use Xcode without the iOS simulator :( Thanks in advance.
3
2
2.5k
Jan ’24
Same content in 2 cards
Hello there! I'm trying to create something in SwiftUI, but there's a problem: I can't have 2 cards with the same content, does anyone know a way to have the same emojis in 2 separate cards? Here's my code: import PlaygroundSupport import SwiftUI struct ContentView: View {     var emojis: [String] = ["🐶", "🐱", "🐱", "🦊", "🦁", "🐝", "🐼", "🐷", "🐮"]     var body: some View {         LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) {             ForEach(emojis, id: \.self, content: { emoji in                 emojiView(content: emoji)             })     } }     struct emojiView: View {         var content: String = ""         var body: some View {             ZStack {                 RoundedRectangle(cornerRadius: 20)                     .frame(width: 90, height: 120)                     .foregroundColor(.yellow)                 Text(content).font(.largeTitle)             }         }     } } PlaygroundPage.current.setLiveView(ContentView())
Replies
2
Boosts
0
Views
3.7k
Activity
Mar ’22
Expand the circle throughout the screen in SwiftUI
Hi there! I'm trying to build something in SwiftUI and I need a help on it. I want the orange circle to scale and expand, and fill the entire screen, whenI click on it. Here's my code: import SwiftUI struct ContentView: View {     var body: some View {        Circle()             .frame(width: 120, height: 120)             .foregroundColor(.orange)     } } Thank you.
Replies
1
Boosts
0
Views
1.7k
Activity
Apr ’22
Use fonts in SwiftUI
Hello there! Does anyone know how to apply Apple's default fonts to text in SwiftUI?
Replies
5
Boosts
0
Views
1.6k
Activity
Apr ’22
Set an image as the background in SwiftUI
Hello there! I would like to set an image as the background of my project in SwiftUI, but I have no idea how it is done. Could anyone help me to figure out this? I am using Swift Playgrounds and SwiftUI framework.
Replies
1
Boosts
0
Views
800
Activity
Apr ’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
688
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.7k
Activity
Apr ’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.3k
Activity
Jun ’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
950
Activity
Aug ’22
Error appeared
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
2
Boosts
0
Views
1.3k
Activity
Dec ’22
Unexpected Error
Hello everyone, I was working on a Xcode playground, and unexpectedly it appeared an error that I can't understand how to fix. Here's the error that I'm facing. Does someone know how to fix it? Thanks in advance ;)
Replies
3
Boosts
0
Views
1k
Activity
Apr ’23
Need a help
Hi there, I'm studying SwiftUI on my own, but unfortunately I'm still not able to write complex lines of code, or even code an app independently, which is very frustrating for me. I love coding, it's a way to express my creativity. I already have a lot of ideas, but I can't put them into practice because I feel like I don't have learned enough about this programming language. Can any of you suggest me some free courses or other resources that have also helped you in your first steps with coding?
Replies
2
Boosts
0
Views
1.1k
Activity
Jul ’23
Falling effect SwiftUI
Hi everyone! import SwiftUI struct ContentView: View { let screenHeight = UIScreen.main.bounds.height let letters: [String] = ["A", "B"] @State private var yOffset: CGFloat = 0.0 var body: some View { ForEach(letters, id: \.self) { letter in Text(letter) .padding() .font(.largeTitle) .offset(x: 0, y: yOffset) .animation(Animation.linear(duration: 5.0).repeatForever(autoreverses: false)) .onAppear { yOffset = screenHeight - 90 } } } } I would like in this code, the letters to fall from the beginning of the screen to its end, I have the size of screen's height, but actually I can't understand how I can I use it, until the letters can start from the beginning of the screen. And I would also like that once they reach the bottom, they start falling again... I can't understand how this effect can be achieved, is there anyone who can help me?
Replies
1
Boosts
0
Views
649
Activity
Feb ’24
Swift Playgrounds
Hi guys, is Swift Playgrounds same as Xcode, I mean the code that I write in Xcode I can paste it into Swift Playgrounds?
Replies
5
Boosts
1
Views
1.6k
Activity
May ’23
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
3.1k
Activity
Aug ’22
Error installing iOS 17.2 Simulator Xcode
Hello and happy new year to all! I've updated Xcode but I'm having a problem installing the iOS 17.2 Simulator. It's the 4th time I'm trying to download it, but it gives me this error: I've also download watchOS which is successfully installed, but I can't understand why only iOS is having some issues. If someone knows how to fix this issue, please help me, I'm unable to use Xcode without the iOS simulator :( Thanks in advance.
Replies
3
Boosts
2
Views
2.5k
Activity
Jan ’24