TechnologiesLow-level, Kernel & Legacy

ObjectiveC

iOSmacOStvOSwatchOSvisionOS

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.

  • Cl
    NSObjectiOS 2.0+
    The root class to which most Objective-C class hierarchies belong, providing basic object behavior and runtime services.
  • Pr
    NSObjectProtocol
    A 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.

  • Cl
    Protocol
    A class that represents a declared Objective-C protocol, used to reflect over its methods and conformances at runtime.
  • St
    ObjCClassListiOS 16.0+
    A Sequence of AnyClass
  • En
    ObjCEnumerationImageiOS 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.

  • St
    objc_object
    Represents an instance of a class.
  • St
    objc_super
    Specifies the superclass of an instance.

Method and Property Metadata 2

Structures that describe a method's signature and a property's declared attributes.

  • St
    objc_method_description
    Defines a method
  • St
    objc_property_attribute_t
    Defines a property attribute

Associated Objects 1

Options that govern how associated values are attached to and retained by instances.

  • En
    objc_AssociationPolicy
    Policies related to associative references.

Structures 3

  • St
    NSZoneiOS 1.0+
  • St
    ObjCBooliOS 1.0+
    The Objective-C BOOL type.
  • St
    SelectoriOS 1.0+
    The Objective-C SEL type.

Type Aliases 17

  • Ty
    NSInteger
  • Ty
    IMP
  • Ty
    objc_zone_t
    Forward declaration for zone support
  • Ty
    objc_objectptr_t
  • Ty
    objc_exception_preprocessor
  • Ty
    objc_exception_matcher
  • Ty
    objc_uncaught_exception_handler
  • Ty
    objc_exception_handler
  • Ty
    Method
    An opaque type that represents a method in a class definition.
  • Ty
    Ivar
    An opaque type that represents an instance variable.
  • Ty
    Category
    An opaque type that represents a category.
  • Ty
    objc_property_t
    An opaque type that represents an Objective-C declared property.
  • Ty
    objc_hook_getImageName
    Function type for a hook that intercepts class_getImageName().
  • Ty
    objc_hook_getClass
    Function type for a hook that assists objc_getClass() and related functions.
  • Ty
    objc_func_loadImage
    Function type for a function that is called when an image is loaded.
  • Ty
    objc_hook_lazyClassNamer
    Function type for a hook that provides a name for lazily named classes.
Show 1 more
  • Ty
    _objc_swiftMetadataInitializer
← Low-level, Kernel & Legacy