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
// | |
// ViewController.m | |
// MyApp | |
// | |
// Created by Jinwoo Kim on 12/9/23. | |
// | |
#import "ViewController.h" | |
#import <objc/message.h> |
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
// | |
// PHPickerConfiguration+OnlyReturnsIdentifiers.hpp | |
// SurfVideo | |
// | |
// Created by Jinwoo Kim on 12/6/23. | |
// | |
#import <PhotosUI/PhotosUI.h> | |
NS_ASSUME_NONNULL_BEGIN |
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 UIKit | |
import SwiftUI | |
fileprivate final class PresentedViewController: UIHostingController<AnyView> { | |
var key: UUID? | |
var willDisappear: (() -> Void)? | |
override func viewWillDisappear(_ animated: Bool) { | |
super.viewWillDisappear(animated) |
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 | |
private let associationKey = UnsafeMutablePointer<UInt8>.allocate(capacity: 1) | |
@MainActor | |
struct CustomUndoManagerView<Content: View>: UIViewControllerRepresentable { | |
private let undoManager: UndoManager | |
private let content: Content | |
init(undoManager: UndoManager, @ViewBuilder builder: () -> Content) { |
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 "SceneDelegate.hpp" | |
#import "RootViewController.hpp" | |
#import <objc/message.h> | |
@implementation SceneDelegate | |
- (void)dealloc { | |
[_window release]; | |
[super dealloc]; | |
} |
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
// UIWindowScene+interfaceOrientationDidChangeNotification.h | |
#import <UIKit/UIKit.h> | |
NS_HEADER_AUDIT_BEGIN(nullability, sendability) | |
static NSNotificationName const UIWindowSceneInterfaceOrientationDidChangeNotification = @"UIWindowSceneInterfaceOrientationDidChangeNotification"; | |
static NSString * const UIWindowSceneInterfaceOrientationValueUserInfoKey = @"UIWindowSceneInterfaceOrientationValueUserInfoKey"; | |
static NSString * const UIWindowSceneInterfaceOrientationAnimationDurationUserInfoKey = @"UIWindowSceneInterfaceOrientationAnimationDurationUserInfoKey"; |
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 <concepts> | |
#import <functional> | |
template<class _Tp> | |
concept hashable = requires { | |
std::hash<_Tp>(); | |
}; | |
template <class T> requires std::equality_comparable<T> && std::copyable<T> && hashable<T> | |
class IdentifiableRef { |
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 <Cocoa/Cocoa.h> | |
NS_HEADER_AUDIT_BEGIN(nullability, sendability) | |
@class SVTextField; | |
@protocol SVTextFieldDelegate <NSTextFieldDelegate> | |
@optional - (BOOL)textField:(SVTextField *)textField shouldChangeTextInRange:(NSRange)range replacementString:(NSString *)string; | |
@end | |
@interface SVTextField : NSTextField |
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 <Foundation/Foundation.h> | |
@interface MyPlaceholderValue : NSObject | |
- (instancetype)initWithInteger:(NSInteger)number; | |
@end | |
@implementation MyPlaceholderValue | |
- (id)initWithInteger:(NSInteger)number { | |
CFNumberRef result = CFNumberCreate(NULL, kCFNumberNSIntegerType, &number); |