MagicLibrary Go to Targer->Build Settings->All Search for "other linker flags", add "-ObjC" in other linker flags References: Matt Thompson's NSHipster, http://nshipster.com/method-swizzling/ https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/occ/instm/UIView/initWithFrame: https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/index.html#//apple_ref/occ/intfm/NSCoding/initWithCoder: