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
# -fobjc-arc: enables ARC | |
# -fmodules: enables modules so you can import with `@import AppKit;` | |
# -mmacosx-version-min=10.6: support older OS X versions, this might increase the binary size | |
clang main.m -fobjc-arc -fmodules -mmacosx-version-min=10.6 -o main |
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 selectedIndex: Int? = nil | |
let options: [String] = ["Option1", "Option2"] | |
var body: some View { | |
PickerField("Select an option", data: self.options, selectionIndex: self.$selectedIndex) | |
} | |
} |