Skip to content

Instantly share code, notes, and snippets.

View artyom-stv's full-sized avatar

Artem Starosvetskiy artyom-stv

View GitHub Profile
@robb
robb / Example.m
Last active January 9, 2024 14:38
A macro to convert nullable references to nonnull references while triggering an assert if the expression is actually true. Think of this as unsafe unwrap for Objective-C.
NS_ASSUME_NONNULL_BEGIN
void Log(NSString *foo) {
NSLog(@"%@", foo);
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSDictionary *stuff = @{
@"a": @"Test"