This file contains hidden or 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
| // | |
| // IntelligenceUIPlatterView.swift | |
| // | |
| // Created by Stephan Casas on 2/13/25. | |
| // | |
| import SwiftUI | |
| import AppKit | |
| import Combine |
This file contains hidden or 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
| @propertyWrapper | |
| struct Storage<T: AppStorageConvertible>: RawRepresentable { | |
| var rawValue: String { wrappedValue.storedValue } | |
| var wrappedValue: T | |
| init?(rawValue: String) { | |
| guard let value = T.init(rawValue) else { return nil } | |
| self.wrappedValue = value | |
| } | |
| init(wrappedValue: T) { |
This file contains hidden or 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 Foundation | |
| import SwiftUI | |
| // MARK: Demo | |
| struct Example: RawRepresentable, Codable { | |
| let id: UUID | |
| } | |
| // This is functionally the same as above, but we have a neater type without creating a new protocol. |
This file contains hidden or 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 Foundation | |
| import SwiftUI | |
| extension EnvironmentValues { | |
| public func value<T>(_: T.Type = T.self, forKey key: String) -> T? { | |
| guard let value = first(where: { name($0, equals: key) }) else { | |
| print("No EnvironmentValue with key '\(key)' found.") | |
| return nil | |
| } |
This file contains hidden or 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
| // | |
| // View+Geometry.swift | |
| // SwiftUIKit | |
| // | |
| // Created by Daniel Saidi on 2020-03-26. | |
| // Copyright © 2020 Daniel Saidi. All rights reserved. | |
| // | |
| import SwiftUI |
This file contains hidden or 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 Foundation | |
| import AudioToolbox | |
| class KKSimplePlayer: NSObject { | |
| var URL: NSURL | |
| var URLSession: NSURLSession! | |
| var packets = [NSData]() | |
| var audioFileStreamID: AudioFileStreamID = nil | |
| var outputQueue: AudioQueueRef = nil | |
| var streamDescription: AudioStreamBasicDescription? |