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 { |
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 BPHostingConfiguration<Content: View>: UIContentConfiguration { | |
fileprivate let content: Content | |
init(@ViewBuilder content: () -> Content) { | |
self.content = 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
// | |
// main.mm | |
// Practice_PackageKit | |
// | |
// Created by Jinwoo Kim on 2/4/24. | |
// | |
#import <Foundation/Foundation.h> | |
#import <objc/message.h> | |
#import <objc/runtime.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
import Darwin | |
class FooObject { | |
func foo() { | |
print(self) | |
foo_2() | |
} | |
} | |
func foo_2() { |
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 | |
@_silgen_name("swift_task_isOnExecutor") | |
public func _taskIsOnExecutor<Executor: SerialExecutor>(_ executor: Executor) -> Bool | |
final class MySerialExecutor: SerialExecutor { | |
private let queue: DispatchQueue = .init(label: "Hello") | |
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 | |
import CoreFoundation | |
// https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFCollections/Articles/creating.html#//apple_ref/doc/uid/20001132-101215-CHDEBBDB | |
class MyObject: NSObject { | |
var string: NSString | |
init(string: NSString) { | |
self.string = string |
NewerOlder