First, runtime is a set of low-level C language Library, compiler in compiling object-c code is, eventually converted to runtime C language code.
For example: [UIView alloc]; At compile time it will be converted to Objc_msgsend (UIView, @selector (alloc));
There is an Isa pointer within each object that points to the class in which the object resides (there is also an Isa pointer to its meta-class metaclass), and when the method is called, the compiler will look up through the ISA pointer one layer at a time until the root class (root metaclass) is found, if not found, will be an error. The function is called after the function pointer is found;
Second, by adding #import <objc/runtime.h>, we can invoke the method provided by runtime to implement the operation of class creation, method substitution, method implementation, etc.
Thirdly, some famous third-party libraries have used runtime:afnetworking, sdwebimage and so on, and KVO's bottom realization also used the runtime;
Runtime run time