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()
}
}
Post
Replies
Boosts
Views
Activity
Can anyone help me?
What are you referring to?
Ok thank you very much all ;))
@Claude31 I mean I have multiple objects on my screen but when I rotate the screen vertically it doesn’t show me all the objects.
Ok thanks! And in case of an image, how does it work?
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?
Can anyone reply me, pls?
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."
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!
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).
Hey guys, can someone help me?
Alright! Thanks a lot!!
I'm using macOS Ventura and on App Store is written Xcode 13.4.1, which I can't open.
I've seen it but it doesn't seem the answer of my question, maybe I explained my self not clearly. I want to create a button with the neumorphic animation.