├── .gitignore ├── Example ├── MZAppearance.xcodeproj │ └── project.pbxproj └── MZAppearance │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── MZAppDelegate.h │ ├── MZAppDelegate.m │ ├── MZAppearance-Info.plist │ ├── MZAppearance-Prefix.pch │ ├── MZViewController.h │ ├── MZViewController.m │ ├── en.lproj │ ├── InfoPlist.strings │ ├── MainStoryboard_iPad.storyboard │ └── MainStoryboard_iPhone.storyboard │ └── main.m ├── LICENSE ├── MZAppearance.podspec ├── MZAppearance.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── MZAppearance.xcscheme ├── MZAppearance ├── Info.plist ├── MZAppearance.h ├── MZAppearance.m ├── NSInvocation+Copy.h └── NSInvocation+Copy.m ├── Package.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | *.xcworkspace 13 | !default.xcworkspace 14 | xcuserdata 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | -------------------------------------------------------------------------------- /Example/MZAppearance.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0628412217BFEC9B0098FD72 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0628412117BFEC9B0098FD72 /* UIKit.framework */; }; 11 | 0628412417BFEC9B0098FD72 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0628412317BFEC9B0098FD72 /* Foundation.framework */; }; 12 | 0628412617BFEC9B0098FD72 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0628412517BFEC9B0098FD72 /* CoreGraphics.framework */; }; 13 | 0628412C17BFEC9B0098FD72 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0628412A17BFEC9B0098FD72 /* InfoPlist.strings */; }; 14 | 0628412E17BFEC9B0098FD72 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0628412D17BFEC9B0098FD72 /* main.m */; }; 15 | 0628413217BFEC9B0098FD72 /* MZAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0628413117BFEC9B0098FD72 /* MZAppDelegate.m */; }; 16 | 0628413417BFEC9B0098FD72 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 0628413317BFEC9B0098FD72 /* Default.png */; }; 17 | 0628413617BFEC9B0098FD72 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0628413517BFEC9B0098FD72 /* Default@2x.png */; }; 18 | 0628413817BFEC9B0098FD72 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0628413717BFEC9B0098FD72 /* Default-568h@2x.png */; }; 19 | 0628413B17BFEC9B0098FD72 /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0628413917BFEC9B0098FD72 /* MainStoryboard_iPhone.storyboard */; }; 20 | 0628413E17BFEC9B0098FD72 /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0628413C17BFEC9B0098FD72 /* MainStoryboard_iPad.storyboard */; }; 21 | 0628414117BFEC9B0098FD72 /* MZViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0628414017BFEC9B0098FD72 /* MZViewController.m */; }; 22 | 062D29BE17C0C2F300E9CF11 /* MZAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 062D29BB17C0C2F300E9CF11 /* MZAppearance.m */; }; 23 | 062D29BF17C0C2F300E9CF11 /* NSInvocation+Copy.m in Sources */ = {isa = PBXBuildFile; fileRef = 062D29BD17C0C2F300E9CF11 /* NSInvocation+Copy.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 0628411E17BFEC9B0098FD72 /* MZAppearance.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MZAppearance.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 0628412117BFEC9B0098FD72 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 0628412317BFEC9B0098FD72 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | 0628412517BFEC9B0098FD72 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 31 | 0628412917BFEC9B0098FD72 /* MZAppearance-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MZAppearance-Info.plist"; sourceTree = ""; }; 32 | 0628412B17BFEC9B0098FD72 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 33 | 0628412D17BFEC9B0098FD72 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | 0628412F17BFEC9B0098FD72 /* MZAppearance-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MZAppearance-Prefix.pch"; sourceTree = ""; }; 35 | 0628413017BFEC9B0098FD72 /* MZAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MZAppDelegate.h; sourceTree = ""; }; 36 | 0628413117BFEC9B0098FD72 /* MZAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MZAppDelegate.m; sourceTree = ""; }; 37 | 0628413317BFEC9B0098FD72 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 38 | 0628413517BFEC9B0098FD72 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 39 | 0628413717BFEC9B0098FD72 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 40 | 0628413A17BFEC9B0098FD72 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPhone.storyboard; sourceTree = ""; }; 41 | 0628413D17BFEC9B0098FD72 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = ""; }; 42 | 0628413F17BFEC9B0098FD72 /* MZViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MZViewController.h; sourceTree = ""; }; 43 | 0628414017BFEC9B0098FD72 /* MZViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MZViewController.m; sourceTree = ""; }; 44 | 062D29BA17C0C2F300E9CF11 /* MZAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MZAppearance.h; path = ../../MZAppearance/MZAppearance.h; sourceTree = ""; }; 45 | 062D29BB17C0C2F300E9CF11 /* MZAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MZAppearance.m; path = ../../MZAppearance/MZAppearance.m; sourceTree = ""; }; 46 | 062D29BC17C0C2F300E9CF11 /* NSInvocation+Copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSInvocation+Copy.h"; path = "../../MZAppearance/NSInvocation+Copy.h"; sourceTree = ""; }; 47 | 062D29BD17C0C2F300E9CF11 /* NSInvocation+Copy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSInvocation+Copy.m"; path = "../../MZAppearance/NSInvocation+Copy.m"; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 0628411B17BFEC9B0098FD72 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 0628412217BFEC9B0098FD72 /* UIKit.framework in Frameworks */, 56 | 0628412417BFEC9B0098FD72 /* Foundation.framework in Frameworks */, 57 | 0628412617BFEC9B0098FD72 /* CoreGraphics.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 0628411517BFEC9B0098FD72 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 0628412717BFEC9B0098FD72 /* MZAppearance */, 68 | 0628412017BFEC9B0098FD72 /* Frameworks */, 69 | 0628411F17BFEC9B0098FD72 /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | 0628411F17BFEC9B0098FD72 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 0628411E17BFEC9B0098FD72 /* MZAppearance.app */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 0628412017BFEC9B0098FD72 /* Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 0628412117BFEC9B0098FD72 /* UIKit.framework */, 85 | 0628412317BFEC9B0098FD72 /* Foundation.framework */, 86 | 0628412517BFEC9B0098FD72 /* CoreGraphics.framework */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | 0628412717BFEC9B0098FD72 /* MZAppearance */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 0628415017BFEF7A0098FD72 /* Source */, 95 | 0628413017BFEC9B0098FD72 /* MZAppDelegate.h */, 96 | 0628413117BFEC9B0098FD72 /* MZAppDelegate.m */, 97 | 0628413917BFEC9B0098FD72 /* MainStoryboard_iPhone.storyboard */, 98 | 0628413C17BFEC9B0098FD72 /* MainStoryboard_iPad.storyboard */, 99 | 0628413F17BFEC9B0098FD72 /* MZViewController.h */, 100 | 0628414017BFEC9B0098FD72 /* MZViewController.m */, 101 | 0628412817BFEC9B0098FD72 /* Supporting Files */, 102 | ); 103 | path = MZAppearance; 104 | sourceTree = ""; 105 | }; 106 | 0628412817BFEC9B0098FD72 /* Supporting Files */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 0628412917BFEC9B0098FD72 /* MZAppearance-Info.plist */, 110 | 0628412A17BFEC9B0098FD72 /* InfoPlist.strings */, 111 | 0628412D17BFEC9B0098FD72 /* main.m */, 112 | 0628412F17BFEC9B0098FD72 /* MZAppearance-Prefix.pch */, 113 | 0628413317BFEC9B0098FD72 /* Default.png */, 114 | 0628413517BFEC9B0098FD72 /* Default@2x.png */, 115 | 0628413717BFEC9B0098FD72 /* Default-568h@2x.png */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | 0628415017BFEF7A0098FD72 /* Source */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 062D29BA17C0C2F300E9CF11 /* MZAppearance.h */, 124 | 062D29BB17C0C2F300E9CF11 /* MZAppearance.m */, 125 | 062D29BC17C0C2F300E9CF11 /* NSInvocation+Copy.h */, 126 | 062D29BD17C0C2F300E9CF11 /* NSInvocation+Copy.m */, 127 | ); 128 | name = Source; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXNativeTarget section */ 134 | 0628411D17BFEC9B0098FD72 /* MZAppearance */ = { 135 | isa = PBXNativeTarget; 136 | buildConfigurationList = 0628414417BFEC9B0098FD72 /* Build configuration list for PBXNativeTarget "MZAppearance" */; 137 | buildPhases = ( 138 | 0628411A17BFEC9B0098FD72 /* Sources */, 139 | 0628411B17BFEC9B0098FD72 /* Frameworks */, 140 | 0628411C17BFEC9B0098FD72 /* Resources */, 141 | ); 142 | buildRules = ( 143 | ); 144 | dependencies = ( 145 | ); 146 | name = MZAppearance; 147 | productName = MZAppearance; 148 | productReference = 0628411E17BFEC9B0098FD72 /* MZAppearance.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | /* End PBXNativeTarget section */ 152 | 153 | /* Begin PBXProject section */ 154 | 0628411617BFEC9B0098FD72 /* Project object */ = { 155 | isa = PBXProject; 156 | attributes = { 157 | CLASSPREFIX = MZ; 158 | LastUpgradeCheck = 0460; 159 | ORGANIZATIONNAME = "Michał Zaborowski"; 160 | }; 161 | buildConfigurationList = 0628411917BFEC9B0098FD72 /* Build configuration list for PBXProject "MZAppearance" */; 162 | compatibilityVersion = "Xcode 3.2"; 163 | developmentRegion = English; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | ); 168 | mainGroup = 0628411517BFEC9B0098FD72; 169 | productRefGroup = 0628411F17BFEC9B0098FD72 /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 0628411D17BFEC9B0098FD72 /* MZAppearance */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 0628411C17BFEC9B0098FD72 /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 0628412C17BFEC9B0098FD72 /* InfoPlist.strings in Resources */, 184 | 0628413417BFEC9B0098FD72 /* Default.png in Resources */, 185 | 0628413617BFEC9B0098FD72 /* Default@2x.png in Resources */, 186 | 0628413817BFEC9B0098FD72 /* Default-568h@2x.png in Resources */, 187 | 0628413B17BFEC9B0098FD72 /* MainStoryboard_iPhone.storyboard in Resources */, 188 | 0628413E17BFEC9B0098FD72 /* MainStoryboard_iPad.storyboard in Resources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXResourcesBuildPhase section */ 193 | 194 | /* Begin PBXSourcesBuildPhase section */ 195 | 0628411A17BFEC9B0098FD72 /* Sources */ = { 196 | isa = PBXSourcesBuildPhase; 197 | buildActionMask = 2147483647; 198 | files = ( 199 | 0628412E17BFEC9B0098FD72 /* main.m in Sources */, 200 | 0628413217BFEC9B0098FD72 /* MZAppDelegate.m in Sources */, 201 | 0628414117BFEC9B0098FD72 /* MZViewController.m in Sources */, 202 | 062D29BE17C0C2F300E9CF11 /* MZAppearance.m in Sources */, 203 | 062D29BF17C0C2F300E9CF11 /* NSInvocation+Copy.m in Sources */, 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | }; 207 | /* End PBXSourcesBuildPhase section */ 208 | 209 | /* Begin PBXVariantGroup section */ 210 | 0628412A17BFEC9B0098FD72 /* InfoPlist.strings */ = { 211 | isa = PBXVariantGroup; 212 | children = ( 213 | 0628412B17BFEC9B0098FD72 /* en */, 214 | ); 215 | name = InfoPlist.strings; 216 | sourceTree = ""; 217 | }; 218 | 0628413917BFEC9B0098FD72 /* MainStoryboard_iPhone.storyboard */ = { 219 | isa = PBXVariantGroup; 220 | children = ( 221 | 0628413A17BFEC9B0098FD72 /* en */, 222 | ); 223 | name = MainStoryboard_iPhone.storyboard; 224 | sourceTree = ""; 225 | }; 226 | 0628413C17BFEC9B0098FD72 /* MainStoryboard_iPad.storyboard */ = { 227 | isa = PBXVariantGroup; 228 | children = ( 229 | 0628413D17BFEC9B0098FD72 /* en */, 230 | ); 231 | name = MainStoryboard_iPad.storyboard; 232 | sourceTree = ""; 233 | }; 234 | /* End PBXVariantGroup section */ 235 | 236 | /* Begin XCBuildConfiguration section */ 237 | 0628414217BFEC9B0098FD72 /* Debug */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_WARN_CONSTANT_CONVERSION = YES; 245 | CLANG_WARN_EMPTY_BODY = YES; 246 | CLANG_WARN_ENUM_CONVERSION = YES; 247 | CLANG_WARN_INT_CONVERSION = YES; 248 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 249 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 250 | COPY_PHASE_STRIP = NO; 251 | GCC_C_LANGUAGE_STANDARD = gnu99; 252 | GCC_DYNAMIC_NO_PIC = NO; 253 | GCC_OPTIMIZATION_LEVEL = 0; 254 | GCC_PREPROCESSOR_DEFINITIONS = ( 255 | "DEBUG=1", 256 | "$(inherited)", 257 | ); 258 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 259 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 261 | GCC_WARN_UNUSED_VARIABLE = YES; 262 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 263 | ONLY_ACTIVE_ARCH = YES; 264 | SDKROOT = iphoneos; 265 | TARGETED_DEVICE_FAMILY = "1,2"; 266 | }; 267 | name = Debug; 268 | }; 269 | 0628414317BFEC9B0098FD72 /* Release */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 274 | CLANG_CXX_LIBRARY = "libc++"; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_CONSTANT_CONVERSION = YES; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 281 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 282 | COPY_PHASE_STRIP = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 285 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 286 | GCC_WARN_UNUSED_VARIABLE = YES; 287 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 288 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 289 | SDKROOT = iphoneos; 290 | TARGETED_DEVICE_FAMILY = "1,2"; 291 | VALIDATE_PRODUCT = YES; 292 | }; 293 | name = Release; 294 | }; 295 | 0628414517BFEC9B0098FD72 /* Debug */ = { 296 | isa = XCBuildConfiguration; 297 | buildSettings = { 298 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 299 | GCC_PREFIX_HEADER = "MZAppearance/MZAppearance-Prefix.pch"; 300 | INFOPLIST_FILE = "MZAppearance/MZAppearance-Info.plist"; 301 | PRODUCT_NAME = "$(TARGET_NAME)"; 302 | WRAPPER_EXTENSION = app; 303 | }; 304 | name = Debug; 305 | }; 306 | 0628414617BFEC9B0098FD72 /* Release */ = { 307 | isa = XCBuildConfiguration; 308 | buildSettings = { 309 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 310 | GCC_PREFIX_HEADER = "MZAppearance/MZAppearance-Prefix.pch"; 311 | INFOPLIST_FILE = "MZAppearance/MZAppearance-Info.plist"; 312 | PRODUCT_NAME = "$(TARGET_NAME)"; 313 | WRAPPER_EXTENSION = app; 314 | }; 315 | name = Release; 316 | }; 317 | /* End XCBuildConfiguration section */ 318 | 319 | /* Begin XCConfigurationList section */ 320 | 0628411917BFEC9B0098FD72 /* Build configuration list for PBXProject "MZAppearance" */ = { 321 | isa = XCConfigurationList; 322 | buildConfigurations = ( 323 | 0628414217BFEC9B0098FD72 /* Debug */, 324 | 0628414317BFEC9B0098FD72 /* Release */, 325 | ); 326 | defaultConfigurationIsVisible = 0; 327 | defaultConfigurationName = Release; 328 | }; 329 | 0628414417BFEC9B0098FD72 /* Build configuration list for PBXNativeTarget "MZAppearance" */ = { 330 | isa = XCConfigurationList; 331 | buildConfigurations = ( 332 | 0628414517BFEC9B0098FD72 /* Debug */, 333 | 0628414617BFEC9B0098FD72 /* Release */, 334 | ); 335 | defaultConfigurationIsVisible = 0; 336 | defaultConfigurationName = Release; 337 | }; 338 | /* End XCConfigurationList section */ 339 | }; 340 | rootObject = 0628411617BFEC9B0098FD72 /* Project object */; 341 | } 342 | -------------------------------------------------------------------------------- /Example/MZAppearance/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1entus/MZAppearance/b47471ed78f80bcf47608cb11df6750d08df1e78/Example/MZAppearance/Default-568h@2x.png -------------------------------------------------------------------------------- /Example/MZAppearance/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1entus/MZAppearance/b47471ed78f80bcf47608cb11df6750d08df1e78/Example/MZAppearance/Default.png -------------------------------------------------------------------------------- /Example/MZAppearance/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/m1entus/MZAppearance/b47471ed78f80bcf47608cb11df6750d08df1e78/Example/MZAppearance/Default@2x.png -------------------------------------------------------------------------------- /Example/MZAppearance/MZAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MZAppDelegate.h 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MZAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/MZAppearance/MZAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MZAppDelegate.m 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | 9 | #import "MZAppDelegate.h" 10 | #import "MZViewController.h" 11 | 12 | @implementation MZAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | [[MZViewController appearance] setCustomColor:[UIColor blackColor]]; 17 | [[MZViewController appearance] setCustomFloat:6.0]; 18 | 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application 30 | { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(UIApplication *)application 36 | { 37 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | - (void)applicationDidBecomeActive:(UIApplication *)application 41 | { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | - (void)applicationWillTerminate:(UIApplication *)application 46 | { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/MZAppearance/MZAppearance-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | pl.whitecode.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | MainStoryboard_iPhone 29 | UIMainStoryboardFile~ipad 30 | MainStoryboard_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/MZAppearance/MZAppearance-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MZAppearance' target in the 'MZAppearance' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Example/MZAppearance/MZViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MZViewController.h 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MZAppearance.h" 11 | 12 | @interface MZViewController : UIViewController 13 | 14 | @property (nonatomic,strong) UIColor *customColor MZ_APPEARANCE_SELECTOR; 15 | @property (nonatomic,assign) CGFloat customFloat MZ_APPEARANCE_SELECTOR; 16 | 17 | + (id)appearance; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/MZAppearance/MZViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MZViewController.m 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | 9 | #import "MZViewController.h" 10 | #import "MZAppearance.h" 11 | 12 | @interface MZViewController () 13 | 14 | @end 15 | 16 | @implementation MZViewController 17 | 18 | + (id)appearance 19 | { 20 | return [MZAppearance appearanceForClass:[self class]]; 21 | } 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | [[[self class] appearance] applyInvocationTo:self]; 28 | 29 | NSLog(@"custom color: %@",self.customColor); 30 | NSLog(@"custom float: %f",self.customFloat); 31 | } 32 | 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/MZAppearance/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/MZAppearance/en.lproj/MainStoryboard_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/MZAppearance/en.lproj/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/MZAppearance/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MZAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MZAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Michał Zaborowski 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MZAppearance.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'MZAppearance' 3 | s.version = '1.1.6' 4 | s.license = 'MIT' 5 | s.summary = 'UIAppearance proxy for custom objects.' 6 | s.homepage = 'https://github.com/m1entus/MZAppearance' 7 | s.authors = 'Michał Zaborowski' 8 | s.source = { :git => 'https://github.com/m1entus/MZAppearance.git', :tag => '1.1.6' } 9 | s.source_files = 'MZAppearance/*.{h,m}' 10 | s.requires_arc = true 11 | 12 | s.ios.deployment_target = "5.0" 13 | s.tvos.deployment_target = "9.0" 14 | 15 | s.frameworks = 'QuartzCore' 16 | end -------------------------------------------------------------------------------- /MZAppearance.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AA44EF1B1C60AAC0005F5F37 /* MZAppearance.h in Headers */ = {isa = PBXBuildFile; fileRef = AA44EF1A1C60AAC0005F5F37 /* MZAppearance.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | AA44EF251C60AB73005F5F37 /* MZAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = AA44EF221C60AB73005F5F37 /* MZAppearance.m */; }; 12 | AA44EF261C60AB73005F5F37 /* NSInvocation+Copy.h in Headers */ = {isa = PBXBuildFile; fileRef = AA44EF231C60AB73005F5F37 /* NSInvocation+Copy.h */; }; 13 | AA44EF271C60AB73005F5F37 /* NSInvocation+Copy.m in Sources */ = {isa = PBXBuildFile; fileRef = AA44EF241C60AB73005F5F37 /* NSInvocation+Copy.m */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | AA44EF171C60AAC0005F5F37 /* MZAppearance.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MZAppearance.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | AA44EF1A1C60AAC0005F5F37 /* MZAppearance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MZAppearance.h; sourceTree = ""; }; 19 | AA44EF1C1C60AAC0005F5F37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 20 | AA44EF221C60AB73005F5F37 /* MZAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MZAppearance.m; sourceTree = ""; }; 21 | AA44EF231C60AB73005F5F37 /* NSInvocation+Copy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSInvocation+Copy.h"; sourceTree = ""; }; 22 | AA44EF241C60AB73005F5F37 /* NSInvocation+Copy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSInvocation+Copy.m"; sourceTree = ""; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | AA44EF131C60AAC0005F5F37 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | AA44EF0D1C60AAC0005F5F37 = { 37 | isa = PBXGroup; 38 | children = ( 39 | AA44EF191C60AAC0005F5F37 /* MZAppearance */, 40 | AA44EF181C60AAC0005F5F37 /* Products */, 41 | ); 42 | sourceTree = ""; 43 | }; 44 | AA44EF181C60AAC0005F5F37 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | AA44EF171C60AAC0005F5F37 /* MZAppearance.framework */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | AA44EF191C60AAC0005F5F37 /* MZAppearance */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | AA44EF221C60AB73005F5F37 /* MZAppearance.m */, 56 | AA44EF231C60AB73005F5F37 /* NSInvocation+Copy.h */, 57 | AA44EF241C60AB73005F5F37 /* NSInvocation+Copy.m */, 58 | AA44EF1A1C60AAC0005F5F37 /* MZAppearance.h */, 59 | AA44EF1C1C60AAC0005F5F37 /* Info.plist */, 60 | ); 61 | path = MZAppearance; 62 | sourceTree = ""; 63 | }; 64 | /* End PBXGroup section */ 65 | 66 | /* Begin PBXHeadersBuildPhase section */ 67 | AA44EF141C60AAC0005F5F37 /* Headers */ = { 68 | isa = PBXHeadersBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | AA44EF261C60AB73005F5F37 /* NSInvocation+Copy.h in Headers */, 72 | AA44EF1B1C60AAC0005F5F37 /* MZAppearance.h in Headers */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXHeadersBuildPhase section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | AA44EF161C60AAC0005F5F37 /* MZAppearance */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = AA44EF1F1C60AAC0005F5F37 /* Build configuration list for PBXNativeTarget "MZAppearance" */; 82 | buildPhases = ( 83 | AA44EF121C60AAC0005F5F37 /* Sources */, 84 | AA44EF131C60AAC0005F5F37 /* Frameworks */, 85 | AA44EF141C60AAC0005F5F37 /* Headers */, 86 | AA44EF151C60AAC0005F5F37 /* Resources */, 87 | ); 88 | buildRules = ( 89 | ); 90 | dependencies = ( 91 | ); 92 | name = MZAppearance; 93 | productName = MZAppearance; 94 | productReference = AA44EF171C60AAC0005F5F37 /* MZAppearance.framework */; 95 | productType = "com.apple.product-type.framework"; 96 | }; 97 | /* End PBXNativeTarget section */ 98 | 99 | /* Begin PBXProject section */ 100 | AA44EF0E1C60AAC0005F5F37 /* Project object */ = { 101 | isa = PBXProject; 102 | attributes = { 103 | LastUpgradeCheck = 0720; 104 | ORGANIZATIONNAME = "Michał Zaborowski"; 105 | TargetAttributes = { 106 | AA44EF161C60AAC0005F5F37 = { 107 | CreatedOnToolsVersion = 7.2; 108 | }; 109 | }; 110 | }; 111 | buildConfigurationList = AA44EF111C60AAC0005F5F37 /* Build configuration list for PBXProject "MZAppearance" */; 112 | compatibilityVersion = "Xcode 3.2"; 113 | developmentRegion = English; 114 | hasScannedForEncodings = 0; 115 | knownRegions = ( 116 | en, 117 | ); 118 | mainGroup = AA44EF0D1C60AAC0005F5F37; 119 | productRefGroup = AA44EF181C60AAC0005F5F37 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | AA44EF161C60AAC0005F5F37 /* MZAppearance */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | AA44EF151C60AAC0005F5F37 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | ); 134 | runOnlyForDeploymentPostprocessing = 0; 135 | }; 136 | /* End PBXResourcesBuildPhase section */ 137 | 138 | /* Begin PBXSourcesBuildPhase section */ 139 | AA44EF121C60AAC0005F5F37 /* Sources */ = { 140 | isa = PBXSourcesBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | AA44EF251C60AB73005F5F37 /* MZAppearance.m in Sources */, 144 | AA44EF271C60AB73005F5F37 /* NSInvocation+Copy.m in Sources */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXSourcesBuildPhase section */ 149 | 150 | /* Begin XCBuildConfiguration section */ 151 | AA44EF1D1C60AAC0005F5F37 /* Debug */ = { 152 | isa = XCBuildConfiguration; 153 | buildSettings = { 154 | ALWAYS_SEARCH_USER_PATHS = NO; 155 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 156 | CLANG_CXX_LIBRARY = "libc++"; 157 | CLANG_ENABLE_MODULES = YES; 158 | CLANG_ENABLE_OBJC_ARC = YES; 159 | CLANG_WARN_BOOL_CONVERSION = YES; 160 | CLANG_WARN_CONSTANT_CONVERSION = YES; 161 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 162 | CLANG_WARN_EMPTY_BODY = YES; 163 | CLANG_WARN_ENUM_CONVERSION = YES; 164 | CLANG_WARN_INT_CONVERSION = YES; 165 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 166 | CLANG_WARN_UNREACHABLE_CODE = YES; 167 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 168 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 169 | COPY_PHASE_STRIP = NO; 170 | CURRENT_PROJECT_VERSION = 1; 171 | DEBUG_INFORMATION_FORMAT = dwarf; 172 | ENABLE_STRICT_OBJC_MSGSEND = YES; 173 | ENABLE_TESTABILITY = YES; 174 | GCC_C_LANGUAGE_STANDARD = gnu99; 175 | GCC_DYNAMIC_NO_PIC = NO; 176 | GCC_NO_COMMON_BLOCKS = YES; 177 | GCC_OPTIMIZATION_LEVEL = 0; 178 | GCC_PREPROCESSOR_DEFINITIONS = ( 179 | "DEBUG=1", 180 | "$(inherited)", 181 | ); 182 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 183 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 184 | GCC_WARN_UNDECLARED_SELECTOR = YES; 185 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 186 | GCC_WARN_UNUSED_FUNCTION = YES; 187 | GCC_WARN_UNUSED_VARIABLE = YES; 188 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 189 | MTL_ENABLE_DEBUG_INFO = YES; 190 | ONLY_ACTIVE_ARCH = YES; 191 | SDKROOT = iphoneos; 192 | TARGETED_DEVICE_FAMILY = "1,2"; 193 | VERSIONING_SYSTEM = "apple-generic"; 194 | VERSION_INFO_PREFIX = ""; 195 | }; 196 | name = Debug; 197 | }; 198 | AA44EF1E1C60AAC0005F5F37 /* Release */ = { 199 | isa = XCBuildConfiguration; 200 | buildSettings = { 201 | ALWAYS_SEARCH_USER_PATHS = NO; 202 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 203 | CLANG_CXX_LIBRARY = "libc++"; 204 | CLANG_ENABLE_MODULES = YES; 205 | CLANG_ENABLE_OBJC_ARC = YES; 206 | CLANG_WARN_BOOL_CONVERSION = YES; 207 | CLANG_WARN_CONSTANT_CONVERSION = YES; 208 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 209 | CLANG_WARN_EMPTY_BODY = YES; 210 | CLANG_WARN_ENUM_CONVERSION = YES; 211 | CLANG_WARN_INT_CONVERSION = YES; 212 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 213 | CLANG_WARN_UNREACHABLE_CODE = YES; 214 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 215 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 216 | COPY_PHASE_STRIP = NO; 217 | CURRENT_PROJECT_VERSION = 1; 218 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 219 | ENABLE_NS_ASSERTIONS = NO; 220 | ENABLE_STRICT_OBJC_MSGSEND = YES; 221 | GCC_C_LANGUAGE_STANDARD = gnu99; 222 | GCC_NO_COMMON_BLOCKS = YES; 223 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 224 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 225 | GCC_WARN_UNDECLARED_SELECTOR = YES; 226 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 227 | GCC_WARN_UNUSED_FUNCTION = YES; 228 | GCC_WARN_UNUSED_VARIABLE = YES; 229 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 230 | MTL_ENABLE_DEBUG_INFO = NO; 231 | SDKROOT = iphoneos; 232 | TARGETED_DEVICE_FAMILY = "1,2"; 233 | VALIDATE_PRODUCT = YES; 234 | VERSIONING_SYSTEM = "apple-generic"; 235 | VERSION_INFO_PREFIX = ""; 236 | }; 237 | name = Release; 238 | }; 239 | AA44EF201C60AAC0005F5F37 /* Debug */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | DEFINES_MODULE = YES; 243 | DYLIB_COMPATIBILITY_VERSION = 1; 244 | DYLIB_CURRENT_VERSION = 1; 245 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 246 | INFOPLIST_FILE = MZAppearance/Info.plist; 247 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 248 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 249 | PRODUCT_BUNDLE_IDENTIFIER = com.github.MZAppearance; 250 | PRODUCT_NAME = "$(TARGET_NAME)"; 251 | SKIP_INSTALL = YES; 252 | }; 253 | name = Debug; 254 | }; 255 | AA44EF211C60AAC0005F5F37 /* Release */ = { 256 | isa = XCBuildConfiguration; 257 | buildSettings = { 258 | DEFINES_MODULE = YES; 259 | DYLIB_COMPATIBILITY_VERSION = 1; 260 | DYLIB_CURRENT_VERSION = 1; 261 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 262 | INFOPLIST_FILE = MZAppearance/Info.plist; 263 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 264 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 265 | PRODUCT_BUNDLE_IDENTIFIER = com.github.MZAppearance; 266 | PRODUCT_NAME = "$(TARGET_NAME)"; 267 | SKIP_INSTALL = YES; 268 | }; 269 | name = Release; 270 | }; 271 | /* End XCBuildConfiguration section */ 272 | 273 | /* Begin XCConfigurationList section */ 274 | AA44EF111C60AAC0005F5F37 /* Build configuration list for PBXProject "MZAppearance" */ = { 275 | isa = XCConfigurationList; 276 | buildConfigurations = ( 277 | AA44EF1D1C60AAC0005F5F37 /* Debug */, 278 | AA44EF1E1C60AAC0005F5F37 /* Release */, 279 | ); 280 | defaultConfigurationIsVisible = 0; 281 | defaultConfigurationName = Release; 282 | }; 283 | AA44EF1F1C60AAC0005F5F37 /* Build configuration list for PBXNativeTarget "MZAppearance" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | AA44EF201C60AAC0005F5F37 /* Debug */, 287 | AA44EF211C60AAC0005F5F37 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | /* End XCConfigurationList section */ 293 | }; 294 | rootObject = AA44EF0E1C60AAC0005F5F37 /* Project object */; 295 | } 296 | -------------------------------------------------------------------------------- /MZAppearance.xcodeproj/xcshareddata/xcschemes/MZAppearance.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /MZAppearance/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MZAppearance/MZAppearance.h: -------------------------------------------------------------------------------- 1 | // 2 | // MZApperance.h 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | //! Project version number for MZAppearance. 29 | FOUNDATION_EXPORT double MZAppearanceVersionNumber; 30 | 31 | //! Project version string for MZAppearance. 32 | FOUNDATION_EXPORT const unsigned char MZAppearanceVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | 36 | 37 | #define MZ_APPEARANCE_SELECTOR UI_APPEARANCE_SELECTOR 38 | 39 | @protocol MZAppearance 40 | 41 | /** 42 | To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class. 43 | */ 44 | + (instancetype)appearance; 45 | @end 46 | 47 | @interface MZAppearance : NSObject 48 | 49 | /** 50 | Applies the appearance of all instances to the object. 51 | */ 52 | - (void)applyInvocationTo:(id)target; 53 | 54 | /** 55 | Applies the appearance of all instances to the object starting from the superclass 56 | */ 57 | - (void)applyInvocationRecursivelyTo:(id)target upToSuperClass:(Class)superClass; 58 | 59 | /** 60 | Returns appearance for class 61 | */ 62 | + (id)appearanceForClass:(Class)aClass; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /MZAppearance/MZAppearance.m: -------------------------------------------------------------------------------- 1 | // 2 | // MZApperance.m 3 | // MZAppearance 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "MZAppearance.h" 27 | 28 | static NSMutableDictionary *instanceOfClassesDictionary = nil; 29 | 30 | @interface MZAppearance () 31 | @property (strong, nonatomic) Class mainClass; 32 | @property (strong, nonatomic) NSMutableArray *invocations; 33 | @end 34 | 35 | @implementation MZAppearance 36 | 37 | - (id)initWithClass:(Class)thisClass 38 | { 39 | _mainClass = thisClass; 40 | _invocations = [NSMutableArray array]; 41 | 42 | return self; 43 | } 44 | 45 | - (void)applyInvocationTo:(id)target 46 | { 47 | for (NSInvocation *invocation in self.invocations) { 48 | 49 | // Create a new copy of the stored invocation, 50 | // otherwise setting the new target, this will never be released 51 | // because the invocation in the array is still alive after the call 52 | 53 | NSInvocation *targetInvocation = [invocation copy]; 54 | [targetInvocation setTarget:target]; 55 | [targetInvocation invoke]; 56 | targetInvocation = nil; 57 | } 58 | } 59 | 60 | - (void)applyInvocationRecursivelyTo:(id)target upToSuperClass:(Class)superClass 61 | { 62 | NSMutableArray *classes = [NSMutableArray array]; 63 | 64 | // We now need to first set the properties of the superclass 65 | for (Class class = [target class]; 66 | [class isSubclassOfClass:superClass] || class == superClass; 67 | class = [class superclass]) { 68 | [classes addObject:class]; 69 | } 70 | 71 | NSEnumerator *reverseClasses = [classes reverseObjectEnumerator]; 72 | 73 | for (Class class in reverseClasses) { 74 | [[MZAppearance appearanceForClass:class] applyInvocationTo:target]; 75 | } 76 | } 77 | 78 | + (id)appearanceForClass:(Class)aClass 79 | { 80 | static dispatch_once_t onceToken; 81 | 82 | dispatch_once(&onceToken, ^{ 83 | instanceOfClassesDictionary = [[NSMutableDictionary alloc] init]; 84 | }); 85 | 86 | if (![instanceOfClassesDictionary objectForKey:NSStringFromClass(aClass)]) 87 | { 88 | id appearance = [[self alloc] initWithClass:aClass]; 89 | [instanceOfClassesDictionary setObject:appearance forKey:NSStringFromClass(aClass)]; 90 | return appearance; 91 | } 92 | else { 93 | return [instanceOfClassesDictionary objectForKey:NSStringFromClass(aClass)]; 94 | } 95 | 96 | } 97 | 98 | - (void)forwardInvocation:(NSInvocation *)anInvocation; 99 | { 100 | [anInvocation setTarget:nil]; 101 | [anInvocation retainArguments]; 102 | 103 | [self.invocations addObject:anInvocation]; 104 | } 105 | 106 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 107 | { 108 | return [self.mainClass instanceMethodSignatureForSelector:aSelector]; 109 | } 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /MZAppearance/NSInvocation+Copy.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSInvocation+Copy.h 3 | // MZFormSheetControllerExample 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface NSInvocation (Copy) 29 | 30 | - (id)copy; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MZAppearance/NSInvocation+Copy.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSInvocation+Copy.m 3 | // MZFormSheetControllerExample 4 | // 5 | // Created by Michał Zaborowski on 17.08.2013. 6 | // Copyright (c) 2013 Michał Zaborowski. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import "NSInvocation+Copy.h" 28 | 29 | @interface NSString (Encoding) 30 | 31 | - (BOOL)mz_isFirstCharacterEqual:(NSString *)string; 32 | - (BOOL)mz_isFirstCharacterCaseInsensitiveEqual:(NSString *)string; 33 | - (NSString *)mz_stringByRemovingMethodEnodingQualifiers; 34 | 35 | @end 36 | 37 | @implementation NSString (Encoding) 38 | 39 | - (BOOL)mz_isFirstCharacterEqual:(NSString *)string 40 | { 41 | if (self.length < 1 || string.length < 1) { 42 | return NO; 43 | } 44 | return [[self substringToIndex:1] isEqualToString:[string substringToIndex:1]]; 45 | } 46 | 47 | - (BOOL)mz_isFirstCharacterCaseInsensitiveEqual:(NSString *)string 48 | { 49 | if (self.length < 1 || string.length < 1) { 50 | return NO; 51 | } 52 | return [[self substringToIndex:1] caseInsensitiveCompare:[string substringToIndex:1]] == NSOrderedSame; 53 | } 54 | 55 | - (NSString *)mz_stringByRemovingMethodEnodingQualifiers 56 | { 57 | if ([self mz_isFirstCharacterCaseInsensitiveEqual:@"r"] || 58 | [self mz_isFirstCharacterCaseInsensitiveEqual:@"n"] || 59 | [self mz_isFirstCharacterCaseInsensitiveEqual:@"o"] || 60 | [self mz_isFirstCharacterEqual:@"V"]) { 61 | return [self substringFromIndex:1]; 62 | } else { 63 | return self; 64 | } 65 | } 66 | 67 | @end 68 | 69 | static inline BOOL mz_areObjCTypesEqual(NSString *argmuentType, const char *encodingType) { 70 | 71 | NSString *encoding = [NSString stringWithUTF8String:encodingType]; 72 | return [[argmuentType mz_stringByRemovingMethodEnodingQualifiers] isEqualToString:[encoding mz_stringByRemovingMethodEnodingQualifiers]]; 73 | } 74 | 75 | @implementation NSInvocation (Copy) 76 | 77 | // http://stackoverflow.com/questions/15732885/uiappearance-proxy-for-custom-objects 78 | 79 | - (id)copy 80 | { 81 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:self.methodSignature]; 82 | NSUInteger numberOfArguments = [[self methodSignature] numberOfArguments]; 83 | 84 | [invocation setTarget:self.target]; 85 | [invocation setSelector:self.selector]; 86 | 87 | if (numberOfArguments > 2) { 88 | for (int i = 0; i < (numberOfArguments - 2); i++) { 89 | NSInteger index = i+2; 90 | 91 | NSString *argumentType = [NSString stringWithUTF8String:[self.methodSignature getArgumentTypeAtIndex:index]]; 92 | 93 | if (mz_areObjCTypesEqual(argumentType, @encode(char))) { 94 | char arg; 95 | [self getArgument:&arg atIndex:index]; 96 | [invocation setArgument:&arg atIndex:index]; 97 | } else if (mz_areObjCTypesEqual(argumentType, @encode(unsigned char))) { 98 | unsigned char arg; 99 | [self getArgument:&arg atIndex:index]; 100 | [invocation setArgument:&arg atIndex:index]; 101 | } else if (mz_areObjCTypesEqual(argumentType, @encode(bool))) { 102 | bool arg; 103 | [self getArgument:&arg atIndex:index]; 104 | [invocation setArgument:&arg atIndex:index]; 105 | } else if (mz_areObjCTypesEqual(argumentType, @encode(short))) { 106 | short arg; 107 | [self getArgument:&arg atIndex:index]; 108 | [invocation setArgument:&arg atIndex:index]; 109 | } else if (mz_areObjCTypesEqual(argumentType, @encode(unsigned short))) { 110 | unsigned short arg; 111 | [self getArgument:&arg atIndex:index]; 112 | [invocation setArgument:&arg atIndex:index]; 113 | } else if (mz_areObjCTypesEqual(argumentType, @encode(int))) { 114 | int arg; 115 | [self getArgument:&arg atIndex:index]; 116 | [invocation setArgument:&arg atIndex:index]; 117 | } else if (mz_areObjCTypesEqual(argumentType, @encode(unsigned int))) { 118 | unsigned int arg; 119 | [self getArgument:&arg atIndex:index]; 120 | [invocation setArgument:&arg atIndex:index]; 121 | } else if (mz_areObjCTypesEqual(argumentType, @encode(long))) { 122 | long arg; 123 | [self getArgument:&arg atIndex:index]; 124 | [invocation setArgument:&arg atIndex:index]; 125 | } else if (mz_areObjCTypesEqual(argumentType, @encode(unsigned long))) { 126 | unsigned long arg; 127 | [self getArgument:&arg atIndex:index]; 128 | [invocation setArgument:&arg atIndex:index]; 129 | } else if (mz_areObjCTypesEqual(argumentType, @encode(long long))) { 130 | long long arg; 131 | [self getArgument:&arg atIndex:index]; 132 | [invocation setArgument:&arg atIndex:index]; 133 | } else if (mz_areObjCTypesEqual(argumentType, @encode(unsigned long long))) { 134 | unsigned long long arg; 135 | [self getArgument:&arg atIndex:index]; 136 | [invocation setArgument:&arg atIndex:index]; 137 | } else if (mz_areObjCTypesEqual(argumentType, @encode(float))) { 138 | float arg; 139 | [self getArgument:&arg atIndex:index]; 140 | [invocation setArgument:&arg atIndex:index]; 141 | } else if (mz_areObjCTypesEqual(argumentType, @encode(double))) { 142 | double arg; 143 | [self getArgument:&arg atIndex:index]; 144 | [invocation setArgument:&arg atIndex:index]; 145 | } else if (mz_areObjCTypesEqual(argumentType, @encode(id))) { 146 | char buffer[sizeof(intmax_t)]; 147 | [self getArgument:(void *)&buffer atIndex:i + 2]; 148 | [invocation setArgument:(void *)&buffer atIndex:i + 2]; 149 | } else if (mz_areObjCTypesEqual(argumentType, @encode(SEL))) { 150 | SEL arg; 151 | [self getArgument:&arg atIndex:index]; 152 | [invocation setArgument:&arg atIndex:index]; 153 | } else if (mz_areObjCTypesEqual(argumentType, @encode(Class))) { 154 | Class arg; 155 | [self getArgument:&arg atIndex:index]; 156 | [invocation setArgument:&arg atIndex:index]; 157 | } else if (mz_areObjCTypesEqual(argumentType, @encode(char *))) { 158 | char *arg; 159 | [self getArgument:&arg atIndex:index]; 160 | [invocation setArgument:&arg atIndex:index]; 161 | } else if (mz_areObjCTypesEqual(argumentType, @encode(NSRange))) { 162 | NSRange arg; 163 | [self getArgument:&arg atIndex:index]; 164 | [invocation setArgument:&arg atIndex:index]; 165 | } else if (mz_areObjCTypesEqual(argumentType, @encode(CGPoint))) { 166 | CGPoint arg; 167 | [self getArgument:&arg atIndex:index]; 168 | [invocation setArgument:&arg atIndex:index]; 169 | } else if (mz_areObjCTypesEqual(argumentType, @encode(CGSize))) { 170 | CGSize arg; 171 | [self getArgument:&arg atIndex:index]; 172 | [invocation setArgument:&arg atIndex:index]; 173 | } else if (mz_areObjCTypesEqual(argumentType, @encode(CGColorRef))) { 174 | CGColorRef arg; 175 | [self getArgument:&arg atIndex:index]; 176 | [invocation setArgument:&arg atIndex:index]; 177 | } else if (mz_areObjCTypesEqual(argumentType, @encode(CGRect))) { 178 | CGRect arg; 179 | [self getArgument:&arg atIndex:index]; 180 | [invocation setArgument:&arg atIndex:index]; 181 | } else if ([argumentType mz_isFirstCharacterEqual:@"^"]) { 182 | // generic pointer, including function pointers 183 | 184 | void *arg; 185 | [self getArgument:&arg atIndex:index]; 186 | [invocation setArgument:&arg atIndex:index]; 187 | } else if ([argumentType mz_isFirstCharacterEqual:@"@"]) { 188 | // most likely a block, handle like a function pointer 189 | 190 | id arg; 191 | [self getArgument:&arg atIndex:index]; 192 | [invocation setArgument:&arg atIndex:index]; 193 | } else { 194 | 195 | const char *argumentType = [self.methodSignature getArgumentTypeAtIndex:index]; 196 | 197 | NSUInteger argumentLength; 198 | NSGetSizeAndAlignment(argumentType, &argumentLength, NULL); 199 | 200 | void *buffer = malloc(argumentLength); 201 | 202 | if (buffer) { 203 | [self getArgument:buffer atIndex:index]; 204 | [invocation setArgument:buffer atIndex:index]; 205 | 206 | free(buffer); 207 | } 208 | } 209 | 210 | } 211 | } 212 | 213 | return invocation; 214 | } 215 | 216 | @end 217 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "MZAppearance", 6 | platforms: [ 7 | .iOS(.v8), 8 | ], 9 | products: [ 10 | .library(name: "MZAppearance", targets: ["MZAppearance"]), 11 | ], 12 | targets: [ 13 | .target( 14 | name: "MZAppearance", 15 | path: "MZAppearance" 16 | ), 17 | ], 18 | swiftLanguageVersions: [.v5] 19 | ) 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 2 | 3 | MZAppearance 4 | ============ 5 | 6 | UIAppearance proxy for custom objects 7 | 8 | ## How To Use 9 | 10 | All you need is mark a method that participates in the appearance proxy API using MZ_APPEARANCE_SELECTOR. 11 | Implement protocol method + (id)appearance, and call applyInvocationTo inside your init or viewDidLoad object method. 12 | 13 | ``` objective-c 14 | @interface MZViewController : UIViewController 15 | 16 | @property (nonatomic,strong) UIColor *customColor MZ_APPEARANCE_SELECTOR; 17 | @property (nonatomic,assign) CGFloat customFloat MZ_APPEARANCE_SELECTOR; 18 | 19 | + (id)appearance; 20 | 21 | @end 22 | ``` 23 | 24 | ``` objective-c 25 | + (id)appearance 26 | { 27 | return [MZAppearance appearanceForClass:[self class]]; 28 | } 29 | 30 | - (void)viewDidLoad 31 | { 32 | [super viewDidLoad]; 33 | 34 | [[[self class] appearance] applyInvocationTo:self]; 35 | 36 | NSLog(@"custom color: %@",self.customColor); 37 | NSLog(@"custom float: %f",self.customFloat); 38 | } 39 | ``` 40 | 41 | ## How to setup appearance variable 42 | 43 | ``` objective-c 44 | [[MZViewController appearance] setCustomColor:[UIColor blackColor]]; 45 | [[MZViewController appearance] setCustomFloat:6.0]; 46 | ``` 47 | 48 | Console result will be 49 | 50 | ``` objective-c 51 | 2013-08-17 19:59:38.546 MZAppearance[3374:c07] custom color: UIDeviceWhiteColorSpace 0 1 52 | 2013-08-17 19:59:38.547 MZAppearance[3374:c07] custom float: 6.000000 53 | ``` 54 | 55 | 56 | 57 | 58 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/m1entus/mzappearance/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 59 | 60 | --------------------------------------------------------------------------------