This file contains 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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
IceCreamView(viewModel: ViewModel(iceCream: "banana")) | |
} | |
} | |
struct IceCreamView: View { | |
@State var viewModel: ViewModel |
This file contains 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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
IceCreamView(viewModel: ViewModel(iceCream: "banana")) | |
} | |
} | |
struct IceCreamView: View { | |
@State var viewModel: ViewModel |
This file contains 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
// | |
// ContentView.swift | |
// UnderstandSwiftUIChange | |
// | |
// Created by Christian Selig on 2024-04-04. | |
// | |
import SwiftUI | |
import WebKit | |
import UIKit |
This file contains 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
import SwiftUI | |
@Observable | |
class IceCreamParlor { | |
var iceCream: IceCream? | |
} | |
@Observable | |
class IceCream { | |
var flavor: String |
This file contains 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
import SwiftUI | |
import RealityKit | |
import AVFoundation | |
import MetalKit | |
struct ImmersiveView: View { | |
@State var textureResource: TextureResource? | |
var body: some View { | |
RealityView { content in |
This file contains 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
<html> | |
<head> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
video { | |
width: 1920px; |
This file contains 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
import UIKit | |
import MetalKit | |
class ViewController: UIViewController { | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
let imageView = UIImageView(image: UIImage(named: "landscape.jpeg")) | |
imageView.frame = CGRect(x: 0, y: 200, width: 350, height: 197) | |
view.addSubview(imageView) |
This file contains 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
import SwiftUI | |
import MediaPlayer | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
VolumeSlider() | |
.frame(width: 500.0, height: 50.0) | |
} | |
} |
This file contains 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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
Slidey() | |
} | |
} | |
struct Slidey: View { | |
let width: CGFloat = 200.0 |
This file contains 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
import SwiftUI | |
struct ContentView: View { | |
@State var x: CGFloat = -1.0 | |
var body: some View { | |
VStack(spacing: 50.0) { | |
Text("\(Int(x))") | |
RoundedRectangle(cornerRadius: 20.0) |
NewerOlder