Returns the class definition of a specified class.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Objective-C Runtime
Declaration
func objc_lookUpClass(_ name: Unsafe Pointer<Int8>) -> Any Class?
Parameters
name
The name of the class to look up.
Return Value
The Class object for the named class, or nil
if the class is not registered with the Objective-C runtime.
Discussion
objc
is different from this function in that if the class is not registered, objc
calls the class handler callback and then checks a second time to see whether the class is registered. This function does not call the class handler callback.