Post

Replies

Boosts

Views

Activity

Reply to Unexpected behaviour SwiftUI
I've tried this way, but actually it stops on a random point in the X-axis. I really can't understand how to figure out this. import SwiftUI struct ContentView: View { let screenWidth = UIScreen.main.bounds.width let screenHeight = UIScreen.main.bounds.height let letters: [String] = ["A"] @State private var xOffset: CGFloat = 0.0 @State private var yOffset: CGFloat = 0.0 @State var animation = false var body: some View { ForEach(letters, id: \.self) { letter in Text(letter) .padding() .font(.largeTitle) .offset(x: xOffset, y: yOffset) .animation(Animation.linear(duration: 1.0).repeatForever(autoreverses: false)) .onAppear { yOffset = CGFloat.random(in: 0...screenHeight) } } Spacer() } }
Feb ’24
Reply to Different position for different elements
Thanks @Claude31 I tried this way but it gives an error struct ContentView: View { var body: some View { MyCircle(radius: 3) // Static method 'buidBlock' requires that 'MyCircle' conform to 'View' } } struct MyCircle { var radius: Int var pos: CGPoint { let x = (0...500).randomElement()! let y = (0...500).randomElement()! return CGPoint(x: x, y: y) } } What did I do wrong?
Apr ’23
Reply to Error appeared
Now it says me this: "Could not launch “App” The operation couldn’t be completed. Unable to launch ...-icloud.com because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user."
Dec ’22
Reply to Getting Started
Hello! So you’d like to learn SwiftUI, the programming language that allows you to build applications for Apple platforms. Am I right? To get started with Swift, I highly recommend to take a look at the Everyone Can Code book series on Apple Books, to start learning something about programming in Swift. There are on many topics and they are all free, so you can just go to Books and download them and start learning! Here's the link for the books [https://books.apple.com/us/book/everyone-can-code-adventures/id1514850778) Have a great day!
Aug ’22
Reply to Build a website
Thanks @Starfia. So can I still use the TextEdit for building a complex website (with animations, images, videos, etc.) and no need to go on Google and write for an app to build the page? And can you tell me how to run it with the browser? Then how can I put this website on the Internet? Sorry for too many questions, but this thing is new to me. Thanks (again).
Aug ’22