├── .gitignore ├── CustomUIViewFromXib.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── CustomUIViewFromXib ├── Controller │ └── ViewController.swift ├── Storyboard │ └── Base.lproj │ │ └── Main.storyboard ├── Supporting Files │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 76@2x.png │ │ │ ├── 83.5@2x.png │ │ │ ├── Contents.json │ │ │ ├── Pika-iphone-29@2x.png │ │ │ ├── Pika-iphone-29@3x.png │ │ │ ├── Pika-iphone-40@2x.png │ │ │ ├── Pika-iphone-40@3x.png │ │ │ ├── Pika-iphone-60@2x.png │ │ │ ├── Pika-iphone-60@3x.png │ │ │ └── pika.png │ │ ├── Charizard.imageset │ │ │ ├── Charizard.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── Mewtwo.imageset │ │ │ ├── Contents.json │ │ │ └── Mewtwo.png │ ├── CustomUIViewFromXib.entitlements │ └── Info.plist └── View │ ├── Pokemon.swift │ └── Pokemon.xib ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /CustomUIViewFromXib.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | EDCE3EF01D411F9200428254 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDCE3EEF1D411F9200428254 /* AppDelegate.swift */; }; 11 | EDCE3EF21D411F9200428254 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDCE3EF11D411F9200428254 /* ViewController.swift */; }; 12 | EDCE3EF51D411F9200428254 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EDCE3EF31D411F9200428254 /* Main.storyboard */; }; 13 | EDCE3EF71D411F9200428254 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EDCE3EF61D411F9200428254 /* Assets.xcassets */; }; 14 | EDCE3F071D41238200428254 /* Pokemon.xib in Resources */ = {isa = PBXBuildFile; fileRef = EDCE3F061D41238200428254 /* Pokemon.xib */; }; 15 | EDCE3F091D412ECA00428254 /* Pokemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDCE3F081D412ECA00428254 /* Pokemon.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 077536842434820300E04BED /* CustomUIViewFromXib.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = CustomUIViewFromXib.entitlements; sourceTree = ""; }; 20 | EDCE3EEC1D411F9100428254 /* CustomUIViewFromXib.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomUIViewFromXib.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | EDCE3EEF1D411F9200428254 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | EDCE3EF11D411F9200428254 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 23 | EDCE3EF41D411F9200428254 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | EDCE3EF61D411F9200428254 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | EDCE3EFB1D411F9200428254 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | EDCE3F061D41238200428254 /* Pokemon.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Pokemon.xib; sourceTree = ""; }; 27 | EDCE3F081D412ECA00428254 /* Pokemon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pokemon.swift; sourceTree = ""; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | EDCE3EE91D411F9100428254 /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXFrameworksBuildPhase section */ 39 | 40 | /* Begin PBXGroup section */ 41 | EDCE3EE31D411F9100428254 = { 42 | isa = PBXGroup; 43 | children = ( 44 | EDCE3EEE1D411F9200428254 /* CustomUIViewFromXib */, 45 | EDCE3EED1D411F9100428254 /* Products */, 46 | ); 47 | sourceTree = ""; 48 | }; 49 | EDCE3EED1D411F9100428254 /* Products */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | EDCE3EEC1D411F9100428254 /* CustomUIViewFromXib.app */, 53 | ); 54 | name = Products; 55 | sourceTree = ""; 56 | }; 57 | EDCE3EEE1D411F9200428254 /* CustomUIViewFromXib */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | EDCE3F011D411FBA00428254 /* Model */, 61 | EDCE3F021D411FC000428254 /* View */, 62 | EDCE3F031D411FCA00428254 /* Controller */, 63 | EDCE3F051D411FE400428254 /* Storyboard */, 64 | EDCE3F041D411FCF00428254 /* Supporting Files */, 65 | ); 66 | path = CustomUIViewFromXib; 67 | sourceTree = ""; 68 | }; 69 | EDCE3F011D411FBA00428254 /* Model */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | ); 73 | path = Model; 74 | sourceTree = ""; 75 | }; 76 | EDCE3F021D411FC000428254 /* View */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | EDCE3F061D41238200428254 /* Pokemon.xib */, 80 | EDCE3F081D412ECA00428254 /* Pokemon.swift */, 81 | ); 82 | path = View; 83 | sourceTree = ""; 84 | }; 85 | EDCE3F031D411FCA00428254 /* Controller */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | EDCE3EF11D411F9200428254 /* ViewController.swift */, 89 | ); 90 | path = Controller; 91 | sourceTree = ""; 92 | }; 93 | EDCE3F041D411FCF00428254 /* Supporting Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | EDCE3EEF1D411F9200428254 /* AppDelegate.swift */, 97 | EDCE3EF61D411F9200428254 /* Assets.xcassets */, 98 | 077536842434820300E04BED /* CustomUIViewFromXib.entitlements */, 99 | EDCE3EFB1D411F9200428254 /* Info.plist */, 100 | ); 101 | path = "Supporting Files"; 102 | sourceTree = ""; 103 | }; 104 | EDCE3F051D411FE400428254 /* Storyboard */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | EDCE3EF31D411F9200428254 /* Main.storyboard */, 108 | ); 109 | path = Storyboard; 110 | sourceTree = ""; 111 | }; 112 | /* End PBXGroup section */ 113 | 114 | /* Begin PBXNativeTarget section */ 115 | EDCE3EEB1D411F9100428254 /* CustomUIViewFromXib */ = { 116 | isa = PBXNativeTarget; 117 | buildConfigurationList = EDCE3EFE1D411F9200428254 /* Build configuration list for PBXNativeTarget "CustomUIViewFromXib" */; 118 | buildPhases = ( 119 | EDCE3EE81D411F9100428254 /* Sources */, 120 | EDCE3EE91D411F9100428254 /* Frameworks */, 121 | EDCE3EEA1D411F9100428254 /* Resources */, 122 | ); 123 | buildRules = ( 124 | ); 125 | dependencies = ( 126 | ); 127 | name = CustomUIViewFromXib; 128 | productName = CustomUIViewFromXib; 129 | productReference = EDCE3EEC1D411F9100428254 /* CustomUIViewFromXib.app */; 130 | productType = "com.apple.product-type.application"; 131 | }; 132 | /* End PBXNativeTarget section */ 133 | 134 | /* Begin PBXProject section */ 135 | EDCE3EE41D411F9100428254 /* Project object */ = { 136 | isa = PBXProject; 137 | attributes = { 138 | LastSwiftUpdateCheck = 0730; 139 | LastUpgradeCheck = 1140; 140 | ORGANIZATIONNAME = "backslash-f"; 141 | TargetAttributes = { 142 | EDCE3EEB1D411F9100428254 = { 143 | CreatedOnToolsVersion = 7.3.1; 144 | DevelopmentTeam = UKS358BH88; 145 | LastSwiftMigration = 1140; 146 | }; 147 | }; 148 | }; 149 | buildConfigurationList = EDCE3EE71D411F9100428254 /* Build configuration list for PBXProject "CustomUIViewFromXib" */; 150 | compatibilityVersion = "Xcode 3.2"; 151 | developmentRegion = en; 152 | hasScannedForEncodings = 0; 153 | knownRegions = ( 154 | en, 155 | Base, 156 | ); 157 | mainGroup = EDCE3EE31D411F9100428254; 158 | productRefGroup = EDCE3EED1D411F9100428254 /* Products */; 159 | projectDirPath = ""; 160 | projectRoot = ""; 161 | targets = ( 162 | EDCE3EEB1D411F9100428254 /* CustomUIViewFromXib */, 163 | ); 164 | }; 165 | /* End PBXProject section */ 166 | 167 | /* Begin PBXResourcesBuildPhase section */ 168 | EDCE3EEA1D411F9100428254 /* Resources */ = { 169 | isa = PBXResourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | EDCE3F071D41238200428254 /* Pokemon.xib in Resources */, 173 | EDCE3EF71D411F9200428254 /* Assets.xcassets in Resources */, 174 | EDCE3EF51D411F9200428254 /* Main.storyboard in Resources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXResourcesBuildPhase section */ 179 | 180 | /* Begin PBXSourcesBuildPhase section */ 181 | EDCE3EE81D411F9100428254 /* Sources */ = { 182 | isa = PBXSourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | EDCE3EF21D411F9200428254 /* ViewController.swift in Sources */, 186 | EDCE3EF01D411F9200428254 /* AppDelegate.swift in Sources */, 187 | EDCE3F091D412ECA00428254 /* Pokemon.swift in Sources */, 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | }; 191 | /* End PBXSourcesBuildPhase section */ 192 | 193 | /* Begin PBXVariantGroup section */ 194 | EDCE3EF31D411F9200428254 /* Main.storyboard */ = { 195 | isa = PBXVariantGroup; 196 | children = ( 197 | EDCE3EF41D411F9200428254 /* Base */, 198 | ); 199 | name = Main.storyboard; 200 | path = .; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXVariantGroup section */ 204 | 205 | /* Begin XCBuildConfiguration section */ 206 | EDCE3EFC1D411F9200428254 /* Debug */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 211 | CLANG_ANALYZER_NONNULL = YES; 212 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 213 | CLANG_CXX_LIBRARY = "libc++"; 214 | CLANG_ENABLE_MODULES = YES; 215 | CLANG_ENABLE_OBJC_ARC = YES; 216 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 217 | CLANG_WARN_BOOL_CONVERSION = YES; 218 | CLANG_WARN_COMMA = YES; 219 | CLANG_WARN_CONSTANT_CONVERSION = YES; 220 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 221 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 222 | CLANG_WARN_EMPTY_BODY = YES; 223 | CLANG_WARN_ENUM_CONVERSION = YES; 224 | CLANG_WARN_INFINITE_RECURSION = YES; 225 | CLANG_WARN_INT_CONVERSION = YES; 226 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 227 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 228 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 229 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 230 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 231 | CLANG_WARN_STRICT_PROTOTYPES = YES; 232 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 233 | CLANG_WARN_UNREACHABLE_CODE = YES; 234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 235 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 236 | COPY_PHASE_STRIP = NO; 237 | DEBUG_INFORMATION_FORMAT = dwarf; 238 | ENABLE_STRICT_OBJC_MSGSEND = YES; 239 | ENABLE_TESTABILITY = YES; 240 | GCC_C_LANGUAGE_STANDARD = gnu99; 241 | GCC_DYNAMIC_NO_PIC = NO; 242 | GCC_NO_COMMON_BLOCKS = YES; 243 | GCC_OPTIMIZATION_LEVEL = 0; 244 | GCC_PREPROCESSOR_DEFINITIONS = ( 245 | "DEBUG=1", 246 | "$(inherited)", 247 | ); 248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 250 | GCC_WARN_UNDECLARED_SELECTOR = YES; 251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 252 | GCC_WARN_UNUSED_FUNCTION = YES; 253 | GCC_WARN_UNUSED_VARIABLE = YES; 254 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 255 | MTL_ENABLE_DEBUG_INFO = YES; 256 | ONLY_ACTIVE_ARCH = YES; 257 | SDKROOT = iphoneos; 258 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 259 | }; 260 | name = Debug; 261 | }; 262 | EDCE3EFD1D411F9200428254 /* Release */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ALWAYS_SEARCH_USER_PATHS = NO; 266 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 267 | CLANG_ANALYZER_NONNULL = YES; 268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 269 | CLANG_CXX_LIBRARY = "libc++"; 270 | CLANG_ENABLE_MODULES = YES; 271 | CLANG_ENABLE_OBJC_ARC = YES; 272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_COMMA = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 278 | CLANG_WARN_EMPTY_BODY = YES; 279 | CLANG_WARN_ENUM_CONVERSION = YES; 280 | CLANG_WARN_INFINITE_RECURSION = YES; 281 | CLANG_WARN_INT_CONVERSION = YES; 282 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 283 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 284 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 287 | CLANG_WARN_STRICT_PROTOTYPES = YES; 288 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 289 | CLANG_WARN_UNREACHABLE_CODE = YES; 290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 292 | COPY_PHASE_STRIP = NO; 293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 294 | ENABLE_NS_ASSERTIONS = NO; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | GCC_C_LANGUAGE_STANDARD = gnu99; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 300 | GCC_WARN_UNDECLARED_SELECTOR = YES; 301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 302 | GCC_WARN_UNUSED_FUNCTION = YES; 303 | GCC_WARN_UNUSED_VARIABLE = YES; 304 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 305 | MTL_ENABLE_DEBUG_INFO = NO; 306 | SDKROOT = iphoneos; 307 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 308 | VALIDATE_PRODUCT = YES; 309 | }; 310 | name = Release; 311 | }; 312 | EDCE3EFF1D411F9200428254 /* Debug */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | CODE_SIGN_ENTITLEMENTS = "CustomUIViewFromXib/Supporting Files/CustomUIViewFromXib.entitlements"; 317 | DEVELOPMENT_TEAM = UKS358BH88; 318 | INFOPLIST_FILE = "CustomUIViewFromXib/Supporting Files/Info.plist"; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 320 | PRODUCT_BUNDLE_IDENTIFIER = "com.backslash-f.CustomUIViewFromXib"; 321 | PRODUCT_NAME = "$(TARGET_NAME)"; 322 | SUPPORTS_MACCATALYST = YES; 323 | SWIFT_VERSION = 5.0; 324 | TARGETED_DEVICE_FAMILY = "1,2"; 325 | }; 326 | name = Debug; 327 | }; 328 | EDCE3F001D411F9200428254 /* Release */ = { 329 | isa = XCBuildConfiguration; 330 | buildSettings = { 331 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 332 | CODE_SIGN_ENTITLEMENTS = "CustomUIViewFromXib/Supporting Files/CustomUIViewFromXib.entitlements"; 333 | DEVELOPMENT_TEAM = UKS358BH88; 334 | INFOPLIST_FILE = "CustomUIViewFromXib/Supporting Files/Info.plist"; 335 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 336 | PRODUCT_BUNDLE_IDENTIFIER = "com.backslash-f.CustomUIViewFromXib"; 337 | PRODUCT_NAME = "$(TARGET_NAME)"; 338 | SUPPORTS_MACCATALYST = YES; 339 | SWIFT_VERSION = 5.0; 340 | TARGETED_DEVICE_FAMILY = "1,2"; 341 | }; 342 | name = Release; 343 | }; 344 | /* End XCBuildConfiguration section */ 345 | 346 | /* Begin XCConfigurationList section */ 347 | EDCE3EE71D411F9100428254 /* Build configuration list for PBXProject "CustomUIViewFromXib" */ = { 348 | isa = XCConfigurationList; 349 | buildConfigurations = ( 350 | EDCE3EFC1D411F9200428254 /* Debug */, 351 | EDCE3EFD1D411F9200428254 /* Release */, 352 | ); 353 | defaultConfigurationIsVisible = 0; 354 | defaultConfigurationName = Release; 355 | }; 356 | EDCE3EFE1D411F9200428254 /* Build configuration list for PBXNativeTarget "CustomUIViewFromXib" */ = { 357 | isa = XCConfigurationList; 358 | buildConfigurations = ( 359 | EDCE3EFF1D411F9200428254 /* Debug */, 360 | EDCE3F001D411F9200428254 /* Release */, 361 | ); 362 | defaultConfigurationIsVisible = 0; 363 | defaultConfigurationName = Release; 364 | }; 365 | /* End XCConfigurationList section */ 366 | }; 367 | rootObject = EDCE3EE41D411F9100428254 /* Project object */; 368 | } 369 | -------------------------------------------------------------------------------- /CustomUIViewFromXib.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CustomUIViewFromXib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Controller/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // CustomUIViewFromXib 4 | // 5 | // Created by Fernando Fernandes on 7/21/16. 6 | // Copyright © 2016 backslash-f. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | } 13 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Storyboard/Base.lproj/Main.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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CustomUIViewFromXib 4 | // 5 | // Created by Fernando Fernandes on 7/21/16. 6 | // Copyright © 2016 backslash-f. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | return true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/76@2x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/83.5@2x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "filename" : "Pika-iphone-29@2x.png", 15 | "idiom" : "iphone", 16 | "scale" : "2x", 17 | "size" : "29x29" 18 | }, 19 | { 20 | "filename" : "Pika-iphone-29@3x.png", 21 | "idiom" : "iphone", 22 | "scale" : "3x", 23 | "size" : "29x29" 24 | }, 25 | { 26 | "filename" : "Pika-iphone-40@2x.png", 27 | "idiom" : "iphone", 28 | "scale" : "2x", 29 | "size" : "40x40" 30 | }, 31 | { 32 | "filename" : "Pika-iphone-40@3x.png", 33 | "idiom" : "iphone", 34 | "scale" : "3x", 35 | "size" : "40x40" 36 | }, 37 | { 38 | "filename" : "Pika-iphone-60@2x.png", 39 | "idiom" : "iphone", 40 | "scale" : "2x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "filename" : "Pika-iphone-60@3x.png", 45 | "idiom" : "iphone", 46 | "scale" : "3x", 47 | "size" : "60x60" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "scale" : "1x", 52 | "size" : "20x20" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "scale" : "2x", 57 | "size" : "20x20" 58 | }, 59 | { 60 | "idiom" : "ipad", 61 | "scale" : "1x", 62 | "size" : "29x29" 63 | }, 64 | { 65 | "idiom" : "ipad", 66 | "scale" : "2x", 67 | "size" : "29x29" 68 | }, 69 | { 70 | "idiom" : "ipad", 71 | "scale" : "1x", 72 | "size" : "40x40" 73 | }, 74 | { 75 | "idiom" : "ipad", 76 | "scale" : "2x", 77 | "size" : "40x40" 78 | }, 79 | { 80 | "idiom" : "ipad", 81 | "scale" : "1x", 82 | "size" : "76x76" 83 | }, 84 | { 85 | "filename" : "76@2x.png", 86 | "idiom" : "ipad", 87 | "scale" : "2x", 88 | "size" : "76x76" 89 | }, 90 | { 91 | "filename" : "83.5@2x.png", 92 | "idiom" : "ipad", 93 | "scale" : "2x", 94 | "size" : "83.5x83.5" 95 | }, 96 | { 97 | "filename" : "pika.png", 98 | "idiom" : "ios-marketing", 99 | "scale" : "1x", 100 | "size" : "1024x1024" 101 | } 102 | ], 103 | "info" : { 104 | "author" : "xcode", 105 | "version" : 1 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-29@2x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-29@3x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-40@2x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-40@3x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-60@2x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/Pika-iphone-60@3x.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/pika.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/AppIcon.appiconset/pika.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/Charizard.imageset/Charizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/Charizard.imageset/Charizard.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/Charizard.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Charizard.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/Mewtwo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Mewtwo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/Assets.xcassets/Mewtwo.imageset/Mewtwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/backslash-f/custom-uiviews-from-xib/8f8cd873b59269e8a60265ab9df6844effe71277/CustomUIViewFromXib/Supporting Files/Assets.xcassets/Mewtwo.imageset/Mewtwo.png -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/CustomUIViewFromXib.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/Supporting Files/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | Main 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/View/Pokemon.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pokemon.swift 3 | // CustomUIViewFromXib 4 | // 5 | // Created by Fernando Fernandes on 7/21/16. 6 | // Copyright © 2016 backslash-f. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable class Pokemon: UIView { 12 | 13 | // MARK: - Properties 14 | 15 | @IBOutlet weak var imageView: UIImageView! 16 | 17 | @IBInspectable var image: UIImage? { 18 | get { 19 | return imageView.image 20 | } 21 | set(image) { 22 | imageView.image = image 23 | } 24 | } 25 | 26 | // MARK: - Actions 27 | 28 | @IBAction func switchTapped(_ sender: UISwitch) { 29 | imageView.alpha = sender.isOn ? 1.0 : 0.2 30 | } 31 | 32 | // MARK: - Initializers 33 | 34 | override init(frame: CGRect) { 35 | super.init(frame: frame) 36 | setupView() 37 | } 38 | 39 | required init?(coder aDecoder: NSCoder) { 40 | super.init(coder: aDecoder) 41 | setupView() 42 | } 43 | 44 | // MARK: - Private Helper Methods 45 | 46 | // Performs the initial setup. 47 | fileprivate func setupView() { 48 | let view = viewFromNibForClass() 49 | view.frame = bounds 50 | view.autoresizingMask = [ 51 | UIView.AutoresizingMask.flexibleWidth, 52 | UIView.AutoresizingMask.flexibleHeight 53 | ] 54 | addSubview(view) 55 | } 56 | 57 | // Loads a XIB file into a view and returns this view. 58 | fileprivate func viewFromNibForClass() -> UIView { 59 | let bundle = Bundle(for: type(of: self)) 60 | let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle) 61 | let view = nib.instantiate(withOwner: self, options: nil)[0] as! UIView 62 | return view 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /CustomUIViewFromXib/View/Pokemon.xib: -------------------------------------------------------------------------------- 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 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Fernando Fernandes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # custom-uiviews-from-xib 2 | 3 | Example on how to create custom UIViews from XIB files + IBDesignable + IBInspectable. 4 | This is for [the new StackOverflow Documentation thing](http://blog.stackoverflow.com/2016/07/introducing-stack-overflow-documentation-beta/?cb=1). 5 | The document is live [here](https://stackoverflow.com/documentation/ios/1362/custom-uiviews-from-xib-files/4443/wiring-elements#t=201706141541493196345). 6 | --------------------------------------------------------------------------------