

List of all the images in /Library/Developer/CoreSimulator/Volumes/iOS_21A328/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/SFSymbols.framework/CoreGlyphsPrivate.bundle/Assets.car
NSBundle *const sfSymbolsBundle = [SFSCoreGlyphsBundle private];
_UIAssetManager *const assetManager = [_UIAssetManager assetManagerForBundle:sfSymbolsBundle];
UIImage *const image = [assetManager imageNamed:@"apple.breathe"];
import SwiftUI | |
/// In this example: | |
/// * The view model holds and publishes the view state wrapper value. | |
/// * The view reacts to changes by holding an @StateObject reference to the view model. | |
/// * The initial loading is an empty screen with a ProgressView in the middle. | |
/// * Once we have some data, the subsequent loadings will not override the loaded data, | |
/// and instead, will just display a ProgressView in the toolbar. | |
struct ViewStateExampleView: View { | |
@StateObject private var viewModel: ViewModel = .init() |
import UIKit | |
import Foundation | |
// NOTE: This playground shows how to use Swift's AttributedString with Markdown. | |
// | |
// This code was used to display Markdown content in the Tot iOS Widget <https://tot.rocks> | |
// MARK: - Helpful Links | |
// NOTE: The following links helped me figure this stuff out. |
enum QueryPredicate { | |
case isEqualTo(_ field: String, _ value: Any) | |
case isNotEqualTo(_ field: String, _ value: Any) | |
case isIn(_ field: String, _ values: [Any]) | |
case isNotIn(_ field: String, _ values: [Any]) | |
case arrayContains(_ field: String, _ value: Any) | |
case arrayContainsAny(_ field: String, _ values: [Any]) |
import SwiftUI | |
import Combine | |
public struct ChangeObserver<V: Equatable>: ViewModifier { | |
public init(newValue: V, action: @escaping (V) -> Void) { | |
self.newValue = newValue | |
self.newAction = action | |
} | |
private typealias Action = (V) -> Void |
class Banana: NSObject, NSSecureCoding { | |
let bananaName: String | |
let userInfo: [String: Any] | |
static var supportsSecureCoding: Bool = true | |
init(bananaName: String, userInfo: [String: Any]) { | |
self.bananaName = bananaName | |
self.userInfo = userInfo | |
} |
extension Result { | |
public func `catch`(_ handler: () throws -> Success) -> Result<Success, Error> { | |
flatMapError { _ in | |
.init { try handler() } | |
} | |
} | |
public func `catch`(_ handler: (Failure) throws -> Success) -> Result<Success, Error> { | |
flatMapError { error in | |
.init { try handler(error) } |
import Foundation | |
import MapKit | |
final class MapKitService { | |
// Map the Apple Category to your own category | |
private let typesToDrink: [MKPointOfInterestCategory] = [.brewery, .cafe, .winery] | |
private let typesToEat: [MKPointOfInterestCategory] = [.foodMarket, .restaurant] | |
func retrieve(from: String, completionBlock: @escaping ([Place]) -> Void) { |