Apply macros to your Objective-C APIs to customize how they're imported into Swift.
Objective-C and C Code Customization
Topics
Customizing Objective-C APIs
Use nullability annotations or mark regions as annotated to control how Objective-C declarations are imported into Swift.
Use the NS
macro to customize API names for Swift.
Use the NS
macro to change how an API is imported into Swift.
Add macros to your Objective-C types to group their values in Swift.
Use a
macro to denote the availability of an Objective-C API.
Use the NS
macro to prevent an API from being used in Swift.
Customizing C APIs
Use the CF
macro to group functions that have related behavior.
See Also
Language Interoperability
Learn the recommended steps to migrate your code.
Adopt and interoperate with Cocoa design patterns in your Swift apps.
Cast instances of the Objective-C id
type to a specific Swift type.
Use selectors and key paths to interact with dynamic Objective-C APIs.
Use native Swift syntax to interoperate with types and functions in C and Objective-C.