Skip to content

Instantly share code, notes, and snippets.

View pookjw's full-sized avatar

Jinwoo Kim pookjw

View GitHub Profile
private import Foundation
private import _DarwinFoundation3.pthread
fileprivate final class Box<U> {
let value: U
init(value: U) {
self.value = value
}
}
#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) {
#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) {
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 {
#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);
#import <Foundation/Foundation.h>
@interface FooObject : NSObject
@end
@implementation FooObject
- (NSString *)getTitle {
abort();
}
- (NSString *)title {
abort();
#import <CoreData/CoreData.h>
#include <objc/runtime.h>
#include <objc/message.h>
@import ellekit;
@interface NSPersistentStore (Category)
- (void)sql_resetCache;
@end
@implementation NSPersistentStore (Category)
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 {
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()
#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 {