This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var shouldAnimate = false | |
var body: some View { | |
Circle() | |
.fill(Color.blue) | |
.frame(width: 30, height: 30) | |
.overlay( | |
ZStack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var shouldAnimate = false | |
var body: some View { | |
HStack { | |
Circle() | |
.fill(Color.blue) | |
.frame(width: 20, height: 20) | |
.scaleEffect(shouldAnimate ? 1.0 : 0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var shouldAnimate = false | |
var body: some View { | |
HStack(alignment: .center, spacing: shouldAnimate ? 15 : 5) { | |
Capsule(style: .continuous) | |
.fill(Color.blue) | |
.frame(width: 10, height: 50) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
@State private var shouldAnimate = false | |
@State var leftOffset: CGFloat = -100 | |
@State var rightOffset: CGFloat = 100 | |
var body: some View { | |
RoundedRectangle(cornerRadius: 10) | |
.fill(Color.blue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
let timer = Timer.publish(every: 1.6, on: .main, in: .common).autoconnect() | |
@State var leftOffset: CGFloat = -100 | |
@State var rightOffset: CGFloat = 100 | |
var body: some View { | |
ZStack { | |
Circle() | |
.fill(Color.blue) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
static let names = ["name1", "name2", "name3", "name4", "name5", "name6"] | |
var body: some View { | |
List(Self.names, id: \.self) { name in | |
Text(name) | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
static let names = ["name1", "name2", "name3", "name4", "name5", "name6"] | |
var body: some View { | |
List(ContentView.names, id: \.self) { name in | |
Text(name) | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct WorkoutsList: View { | |
@Environment(\.managedObjectContext) var managedObjectContext | |
@FetchRequest(entity: Workout.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \Workout.createdAt, ascending: true)]) var workouts: FetchedResults<Workout> | |
var body: some View { | |
NavigationView { | |
List(workouts, id: \.self) { workout in | |
Text(workout.name) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Environment(\.horizontalSizeClass) var horizontalSizeClass | |
@Environment(\.managedObjectContext) var managedObjectContext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Order: ObservableObject { | |
@Published var items = [MenuItem]() | |
} | |
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
var order = Order() | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
... |