Sample Objective-C code demonstrating Objective-C's nullability annotations tell the compiler which pointers can be nil. They catch bugs at compile time and make your code bridge to Swift cleanly..
This project accompanies the article: Nullability Annotations in Objective-C
- Xcode 26.2+
- iOS 26.0+
- Clone this repository
- Run
xcodegen generate(requires XcodeGen) - Open
NullabilityAnnotationsObjc.xcodeproj - Build and run
- main.m: Source file
- AppDelegate.h: Source file
- AppDelegate.m: Source file
- User.h: Source file
- User.m: Source file
- UserManager.h: Source file
- UserManager.m: Source file
- DataStore.h: Source file
- DataStore.m: Source file
- LegacyAPI.h: Source file
- LegacyAPI.m: Source file
- ModernAPI.h: Source file
- ModernAPI.m: Source file
- ResettableConfig.h: Source file
- ResettableConfig.m: Source file
- ViewController.h: Source file
- ViewController.m: Source file
This project is written in Objective-C to demonstrate traditional iOS development patterns.
Read the full article at BleepingSwift for detailed explanations and additional examples.
MIT License - see LICENSE for details.