Skip to content

Instantly share code, notes, and snippets.

import UIKit
import SwiftUI
struct MyView: View {
@State var number: Int = .zero
var body: some View {
MyViewController.SwiftUIView(number: $number)
}
}
#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;
#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);
}
#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;
#import "ViewController.h"
#import <objc/message.h>
#import <dlfcn.h>
OBJC_EXPORT id objc_msgSendSuper2(void);
extern BOOL UIImagePickerLoadPhotoLibraryIfNecessary(void);
@implementation ViewController
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface MyObject : NSObject <NSCopying> {
@package NSUInteger _first;
@package NSInteger _second;
@package BOOL _third;
}
@end
#import <Foundation/Foundation.h>
#pragma mark - MyDescriptor
__attribute__((objc_direct_members))
@interface MyDescriptor : NSObject {
@package NSInteger _index;
}
- (BOOL)direct_isEqual:(MyDescriptor *)other;
@end
#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
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")
import UIKit
enum Hello {
static let foo: Int = {
var result: Int?
if Thread.isMainThread {
result = 300
} else {
DispatchQueue.main.sync {