Pretend that you're writing Swift (when you're really writing Objective-C):
let value = @"A constant string, with an inferred type of NSString *";
var value = @"A string that can be reassigned, with an inferred type of NSString *";
value = @"A new value";
Makes repeated NSParameterAssert(argument != nil);
boilerplate that much easier ✨.
AUTAssertNotNil(something, somethingElse, anotherThing);
Like Swift's !
, but in Objective-C:
- (void)doSomethingWith:(nonnull id)argument;
@property (nullable) id property;
// ...
[self doSomethingWith:AUTNotNil(self.property)];
Like Swift's ??
, but in Objective-C:
- (void)doSomethingWith:(nonnull id)argument;
@property (nullable) id property;
// ...
[self doSomethingWith:AUTFallback(self.property, @"fallback")];
Same as @strongify(...)
, but with an escape hatch if strongification fails.
@strongifyOr(self) return [RACSignal empty];
Reduces boilerplate when opting out of designated initializers.
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
- (instancetype)initWithCoder:(NSCoder *)aDecoder AUT_UNAVAILABLE_DESIGNATED_INITIALIZER;
Tells the clang analyzer that a string does not need localization if the CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED build setting is on.
label.text = AUTLocalizationNotNeeded(@"Secret Developer Menu");