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 | |
struct MyView: View { | |
@State var number: Int = .zero | |
var body: some View { | |
MyViewController.SwiftUIView(number: $number) | |
} | |
} |
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/UIKit.h> | |
#import <objc/message.h> | |
#import <objc/runtime.h> | |
#import <MultipeerConnectivity/MultipeerConnectivity.h> | |
namespace _MCAlertController { | |
namespace show { | |
void (*original)(id, SEL); | |
void custom(__kindof UIViewController *self, SEL _cmd) { | |
UIWindowScene *activeWindowScene = nil; |
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 "ViewController.h" | |
#import <objc/message.h> | |
#import <objc/runtime.h> | |
NSNotificationCenter * __viewGeometryNotificationCenter; | |
id (*nc_originalInit)(id, SEL); | |
id nc_customInit(id self, SEL _cmd) { | |
__viewGeometryNotificationCenter = self; | |
return nc_originalInit(self, _cmd); | |
} |
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/UIKit.h> | |
NS_ASSUME_NONNULL_BEGIN | |
UIKIT_EXTERN BOOL UIImagePickerLoadPhotoLibraryIfNecessary(void); | |
UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerAllowsEditing; | |
UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerVideoQuality; | |
UIKIT_EXTERN UIImagePickerControllerInfoKey const UIImagePickerControllerVideoMaximumDuration; | |
UIKIT_EXTERN UIImagePickerControllerInfoKey const _UIImagePickerControllerFullScreenImage; |
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 "ViewController.h" | |
#import <objc/message.h> | |
#import <dlfcn.h> | |
OBJC_EXPORT id objc_msgSendSuper2(void); | |
extern BOOL UIImagePickerLoadPhotoLibraryIfNecessary(void); | |
@implementation ViewController |
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> | |
#import <objc/runtime.h> | |
@interface MyObject : NSObject <NSCopying> { | |
@package NSUInteger _first; | |
@package NSInteger _second; | |
@package BOOL _third; | |
} | |
@end |
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> | |
#pragma mark - MyDescriptor | |
__attribute__((objc_direct_members)) | |
@interface MyDescriptor : NSObject { | |
@package NSInteger _index; | |
} | |
- (BOOL)direct_isEqual:(MyDescriptor *)other; | |
@end |
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 NSIndexSet (FastEnumeration) <NSFastEnumeration> | |
@end | |
@implementation NSIndexSet (FastEnumeration) | |
- (NSUInteger)countByEnumeratingWithState:(nonnull NSFastEnumerationState *)state objects:(id _Nullable * _Nonnull)buffer count:(NSUInteger)len { | |
/* | |
state |
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 | |
final class TraitSelectionState: UITraitDefinition, UITraitBridgedEnvironmentKey { | |
static func read(from traitCollection: UITraitCollection) -> Bool { | |
traitCollection[TraitSelectionState.self] | |
} | |
static func write(to mutableTraits: inout any UIMutableTraits, value: Bool) { | |
fatalError("Forbidden") |
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 | |
enum Hello { | |
static let foo: Int = { | |
var result: Int? | |
if Thread.isMainThread { | |
result = 300 | |
} else { | |
DispatchQueue.main.sync { |
NewerOlder