4 ms·
You can literally create the app described in his quote in about 2 minutes flat with the following lines of code... import SwiftUI @main struct FooApp:
by BakaRakuda 6y ago
You can literally create the app described in his quote in about 2 minutes flat with the following lines of code...
import SwiftUI
@main
struct FooApp: App {
@State private var isClicked: Bool = false
var body: some Scene {
WindowGroup {
VStack {
Button("Click me!") { isClicked.toggle() }
if isClicked { Text("Hello, World!") }
}.frame(width: 640, height: 480)
}
}
}
- skohan 6y agoEven in the objc-cocoa days, you could create a .xib, drag a few connections, and have this working with 10 lines of code (8 of which generated automatically by XCode)