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 | |
// MARK: - Locking | |
public protocol Locking { | |
init() | |
/// Attempts to acquire a lock, blocking a thread’s execution until the lock can be acquired. | |
func lock() |
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 SwiftUI | |
import AppKit | |
import Combine | |
extension View { | |
public func embedInLabel(label: String) -> some View { | |
FieldLabel(label: label) { | |
self | |
} | |
} |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <vector> | |
#include <array> | |
struct Vertex { | |
float x, y, z; | |
}; | |
std::ostream& operator<<(std::ostream& stream, const Vertex& vertex) { |
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 UIKit | |
import SwiftUI | |
// MARK: - UIViewBridge | |
/// Usage: | |
/// | |
/// var body: some View { | |
/// ... |
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 | |
// MARK: - Proxy | |
public protocol ProxyProtocol { | |
associatedtype ProxyType | |
/// The wrapped proxied object. | |
var proxiedObject: ProxyType { get } | |
} |
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 UIKit | |
// Example usage: | |
// let label = UILabel() | |
// label.attributedText = Typography.current.style(.button).asAttributedString("Edit"), | |
class Typography { | |
/// The current application typography. | |
/// Override this static property to use a custom typography. | |
static var current: TypographyProtocol = BaseTypography() |
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 UIKit | |
/// Represents the internal state of the view. | |
public protocol BaseViewState { | |
init() | |
} | |
/// Empty view state. | |
public final class BaseViewNullState: BaseViewState { | |
public init() { |
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
#ifndef objcxx_h | |
#define objcxx_h | |
#import <Foundation/Foundation.h> | |
NS_ASSUME_NONNULL_BEGIN | |
// #pragma mark - Type inference and dynamic casts | |
// Type inference for local variables. |
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/Foundation.h> | |
#define objc_struct_check(__TYPE__, __ACTION__) \ | |
[__ACTION__.identifier isEqualToString: @ #__TYPE__] \ | |
#define objc_struct_define \ | |
typedef struct __attribute__((objc_boxable)) \ | |
#define _objc_boxed_struct_make(__TYPE__, __ARGS__) \ | |
[[objc_boxed_struct alloc] initWithIdentifier:@ # __TYPE__ \ |
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 | |
// MARK: KVO Change set | |
/// Represent a change for a KVO compliant property. | |
public struct KVOChange<O:AnyObject, T> { | |
/// The associated object for this change. | |
public let object: O? | |
/// The keyPath the triggered this change. |
NewerOlder