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
// | |
// AdvancedToolbarWindow.swift | |
// | |
// Created by Stephan Casas on 3/17/23. | |
// | |
import SwiftUI; | |
import AppKit; | |
class AdvancedToolbarWindow<MainContent: View, TitleToolbarContent: View>: NSWindow, NSToolbarDelegate { |
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 show = false | |
var body: some View { | |
VStack { | |
Button("Pop Sheet") { show.toggle() } | |
} | |
.adaptiveSheet(isPresent: $show) { SheetView() } | |
} |
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 AnimatableCGPointVector: VectorArithmetic { | |
static var zero = AnimatableCGPointVector(values: [.zero]) | |
static func - (lhs: AnimatableCGPointVector, rhs: AnimatableCGPointVector) -> AnimatableCGPointVector { | |
let values = zip(lhs.values, rhs.values) | |
.map { lhs, rhs in lhs.animatableData - rhs.animatableData } | |
.map { CGPoint(x: $0.first, y: $0.second) } | |
return AnimatableCGPointVector(values: values) |
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 ColorText: View { | |
// MARK:- Properties | |
/// The attributed string to display. | |
private let attributedString: AttributedString | |
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
JSON: | |
https://unpkg.com/[email protected]/emoji.json | |
class EmojiManager: ObservableObject { | |
@Published var emojis: [EmojiObject] = [] | |
init() { | |
decodeJSON() |