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
private import Foundation | |
private import _DarwinFoundation3.pthread | |
fileprivate final class Box<U> { | |
let value: U | |
init(value: U) { | |
self.value = value | |
} | |
} |
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> | |
#import <AppleArchive/AppleArchive.h> | |
extern void * AAAssetExtractorCreate(const char *, void *, unsigned long); | |
extern int AAAssetExtractorSetParameterPtr(void *, int, void *); | |
extern int AAAssetExtractorSetParameterCallback(void *, int, void *); | |
extern void AAAssetBuilderDestroy(void *); | |
extern size_t AAAssetExtractorWrite(void *, void *, ssize_t); | |
BOOL foo(void) { |
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 "ViewController.h" | |
#include <objc/message.h> | |
#include <objc/runtime.h> | |
@interface MyLabel : UILabel | |
@end | |
@implementation MyLabel | |
- (void)willMoveToWindow:(UIWindow *)newWindow { | |
[super willMoveToWindow:newWindow]; | |
if (newWindow == nil) { |
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
private import Darwin.POSIX.dlfcn | |
public import UIKit | |
/* | |
expr -l objc -O -- [(Class)NSClassFromString(@"UIScene") _scenesIncludingInternal:0x1] | |
expr -l objc -i0 -O -- [(Class)NSClassFromString(@"MRUIHelper") descriptionForWindow:(id)0x0] | |
*/ | |
@_objcRuntimeName(__MRUIHeloper) | |
fileprivate final class MRUIHelper { |
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> | |
#include <dlfcn.h> | |
#include <objc/message.h> | |
#include <objc/message.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
{ | |
void *handle = dlopen("/System/Library/PrivateFrameworks/DiskImages2.framework/DiskImages2", RTLD_NOW); | |
assert(handle != NULL); |
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> | |
@interface FooObject : NSObject | |
@end | |
@implementation FooObject | |
- (NSString *)getTitle { | |
abort(); | |
} | |
- (NSString *)title { | |
abort(); |
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 <CoreData/CoreData.h> | |
#include <objc/runtime.h> | |
#include <objc/message.h> | |
@import ellekit; | |
@interface NSPersistentStore (Category) | |
- (void)sql_resetCache; | |
@end | |
@implementation NSPersistentStore (Category) |
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 CoreData | |
extension NSManagedObjectContext { | |
@available(macOS, deprecated: 12, renamed: "performAndWait(_:)") | |
@available(iOS, deprecated: 15.0, renamed: "performAndWait(_:)") | |
func old_performAndWait<T>(_ block: () throws -> T) rethrows -> T { | |
try withoutActuallyEscaping(block) { _block in | |
var result: Result<T, Error>? | |
performAndWait { |
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 | |
struct ContentView: View { | |
@State private var value: Bool = false | |
var body: some View { | |
VStack { | |
EquatableView(content: MyView(value: value)) | |
// MyView(value: value).equatable() | |
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> | |
@interface Error : NSError | |
@end | |
@implementation Error | |
+ (BOOL)occurError:(NSError **)error { | |
*error = [[Error alloc] initWithDomain:NSCocoaErrorDomain code:0 userInfo:nil]; | |
return NO; | |
} | |
- (void)dealloc { |
NewerOlder