XCode: DESIGN & CONSTRUCT
So today I have been on a journey to guide you all through a process were we use Xcode. We learned many things from this platform so I ran into something very interesting and eye-catching. Would you all like to know what it is? Xcoding is how graphic designers put movement on their designs. If you’ve ever used PowerPoint, it was called adding animation to your slides.
It’s very exciting to use because you get different ways to make your animation rotate, pop in and out or be controlled by a click. For example, movies or TV shows, especially cartoons are the end results of animation design. Before you get to the final product, the drawn image has to be loaded onto a screen. Graphic Designer who take pictures with any smartphone or filming device, they use this exact code. Xcode animation can be used to create 3D visual setting and virtual reality simulation.
I, like many others probably have, was wondering why the loading image just circles your screen when you purchase something. So today I was studying animation and checking into Xcode to learn more about it. I was able to find a code that I would like to share that’s straight forward. It’s something that fools your brain into seeing movement. Also here’s a walkthrough on a couple of screens that will be presented to show you how to do animation yourself.
import SwiftUIstruct ContentView: View { @State private var isdone : Bool = false
var body: some View { VStack { Button(action:{
withAnimation {
isdone.toggle()
}
},label:{
Image(systemName:"bag")
.resizable()
.frame(width: 80, height: 80, alignment: .center).rotationEffect(isdone ? .degrees(50) : .degrees(0)) })
}
} func animation(){
self.isdone.toggle()
}
} struct ContentView_Previews:PreviewProvider {
static var previews: some View {
ContentView()
}
}
The source ‘HackingWithSwiftUI”made it easy and basic. The reason for using a button is because it create a string to start your code. From my understanding, it’s an action that can be built upon or replaced.
It does something if you click or tap on it. In this case it helps the animation toggle. Toggle means a switch that performs a state to be true or false/on or off. With that being said my toggle means “is done” which is a place holder for making it false. This caused it to alternate, making the animation move in a circling way.
It’s cool to know how the function works but it can be overwhelming. Some codes for animation aren’t this short and straight to the point. It gets tough. Coding can make things speed up, slow down, or not move much at all. Animation works as implicit and explicit which means it has to be modified and triggered. This sometimes changes depending on the variable to make it function.
In conclusion, animation is a computer program that shows different data models being changed. It’s some sauce in the game that a lot of new updates are using. Soon it’s going to be building a technique to expose the future in a timing point of view. We observe the idea without mentioning the key point of it all. Xcode animation clean code that someone can learn on their own and implement in their own app.
Get Shatika Damphie’s stories in your inbox
Join Medium for free to get updates from this writer.
To see the full code visit: — Shatika -GitHub
Reference
HackingWithSwiftUI, https://www.hackingwithswift.com/100/swiftui





