ObjectiveC exposes the Objective-C runtime to Swift: the classes, methods, instance variables, properties, message dispatch, and dynamic introspection that underpin Objective-C objects. You work with the root NSObject class and the NSObjectProtocol it conforms to, and reach lower-level runtime structures such as objc_object, objc_super, objc_method_description, and objc_property_attribute_t to inspect or describe types at runtime. The Protocol class lets you reflect over declared protocols, while objc_AssociationPolicy governs how associated values are attached to instances. Use these APIs when you need direct access to runtime metadata and dynamic dispatch rather than ordinary static Swift calls.
Essentials 2
The root class and protocol from which Objective-C objects and their conformances derive.
- ClNSObjectiOS 2.0+The root class to which most Objective-C class hierarchies belong, providing basic object behavior and runtime services.
- PrNSObjectProtocolA protocol that declares the fundamental methods every Objective-C object adopts, such as identity, class, and message handling.
Runtime Reflection 3
Types for inspecting declared protocols and enumerating registered classes at runtime.
- ClProtocolA class that represents a declared Objective-C protocol, used to reflect over its methods and conformances at runtime.
- StObjCClassListiOS 16.0+A Sequence of AnyClass
- EnObjCEnumerationImageiOS 16.0+Tells `objc_enumerateClasses` which images to search.
Runtime Object and Dispatch Structures 2
Low-level structures that model objects and route messages to a superclass implementation.
- Stobjc_objectRepresents an instance of a class.
- Stobjc_superSpecifies the superclass of an instance.
Method and Property Metadata 2
Structures that describe a method's signature and a property's declared attributes.
- Stobjc_method_descriptionDefines a method
- Stobjc_property_attribute_tDefines a property attribute
Associated Objects 1
Options that govern how associated values are attached to and retained by instances.
- Enobjc_AssociationPolicyPolicies related to associative references.
Structures 3
- StNSZoneiOS 1.0+
- StObjCBooliOS 1.0+The Objective-C BOOL type.
- StSelectoriOS 1.0+The Objective-C SEL type.
Type Aliases 17
- TyNSInteger
- TyIMP
- Tyobjc_zone_tForward declaration for zone support
- Tyobjc_objectptr_t
- Tyobjc_exception_preprocessor
- Tyobjc_exception_matcher
- Tyobjc_uncaught_exception_handler
- Tyobjc_exception_handler
- TyMethodAn opaque type that represents a method in a class definition.
- TyIvarAn opaque type that represents an instance variable.
- TyCategoryAn opaque type that represents a category.
- Tyobjc_property_tAn opaque type that represents an Objective-C declared property.
- Tyobjc_hook_getImageNameFunction type for a hook that intercepts class_getImageName().
- Tyobjc_hook_getClassFunction type for a hook that assists objc_getClass() and related functions.
- Tyobjc_func_loadImageFunction type for a function that is called when an image is loaded.
- Tyobjc_hook_lazyClassNamerFunction type for a hook that provides a name for lazily named classes.
Show 1 more
- Ty_objc_swiftMetadataInitializer