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 | |
// MARK: Demo | |
struct ContentView: View { | |
@State | |
private var isActive = false | |
@SceneStorage("OtherKey") | |
private var isActiveStock = false |
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 IsToggledOnKey: EnvironmentKey { | |
static let defaultValue: Bool = false | |
} | |
extension EnvironmentValues { | |
fileprivate var _isToggledOn: Bool { | |
get { self[IsToggledOnKey.self] } | |
set { self[IsToggledOnKey.self] = newValue } |
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 | |
extension Toggle where Label == SwiftUI.Label<Text, Image> { | |
public init(_ titleKey: LocalizedStringKey, systemImage named: String, isOn: Binding<Bool>) { | |
self.init(isOn: isOn, label: { Label(titleKey, systemImage: named) }) | |
} | |
public init(_ titleKey: LocalizedStringKey, image named: String, isOn: Binding<Bool>) { | |
self.init(isOn: isOn, label: { Label(titleKey, image: named) }) | |
} |
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
debug server graph://127.0.0.1:51000/?token=1706701259 | |
== UInt32, 4 bytes == | |
(layout #:length 18 | |
(== #:size 4 #:type UInt32)) | |
== EnvironmentValues, 16 bytes == | |
(layout #:length 23 | |
(enum #:size 8 #:type Optional<Element> | |
(case 0 | |
(read 8))) | |
(enum #:size 8 #:type Optional<Tracker> |
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
struct ContentView: View { | |
var body: some View { | |
List { | |
ForEach(0..<100) { index in | |
Text("Index: \(index)") | |
.listRowSeparatorInsets( | |
.init( | |
top: 0, | |
left: CGFloat(index) * 5, |
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 | |
private var show = false | |
@State | |
private var selection = 0 | |
var body: some View { |
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 Application: Identifiable { | |
enum Icon { | |
case url(URL) | |
case systemImage(String) | |
} | |
let id: UUID = .init() | |
let name: 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
// Works. | |
extension VW { | |
public static func buildBlock<Content: DynamicViewContent>(_ content: Content) -> some View where Content.Data: RandomAccessCollection, Content.Data.Element: Identifiable { | |
ViewBuilder.buildBlock(VStack { ForEach(content.data) { _ in Text("Test") } }) | |
} | |
} | |
// Crashes | |
extension VW { | |
public static func buildBlock<Content: DynamicViewContent>(_ content: Content) -> some View where Content.Data: RandomAccessCollection, Content.Data.Element: Identifiable { |
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
<!DOCTYPE html> | |
<html> | |
<style type="text/css"> | |
body { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
background-color: black; | |
top: 0%; | |
left: 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 LinkKit | |
import SwiftUI | |
struct PlaidViewPresenter: UIViewControllerRepresentable { | |
@Binding var isPresented: Bool | |
var configuration: LinkPublicKeyConfiguration | |
var exitCallback: ((LinkExit) -> Void)? | |
var successCallback: ((LinkSuccess) -> Void)? |