├── .gitignore ├── AppInfo.podspec ├── AppInfo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── AppInfo ├── AppInfo.h ├── Classes │ └── AppInfo.swift └── Info.plist ├── AppInfoTests ├── AppInfoTests.swift └── Info.plist ├── Example ├── DemoApp.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── DemoApp.xcworkspace │ └── contents.xcworkspacedata ├── DemoApp │ ├── AppDelegate.swift │ ├── AppInfoItemsViewController.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ └── Info.plist ├── Podfile └── Podfile.lock ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | ### Objective-C ### 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | 25 | # CocoaPods 26 | # 27 | # We recommend against adding the Pods directory to your .gitignore. However 28 | # you should judge for yourself, the pros and cons are mentioned at: 29 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 30 | # 31 | # Note: if you ignore the Pods directory, make sure to uncomment 32 | # `pod install` in .travis.yml 33 | # 34 | 35 | Pods/ 36 | 37 | -------------------------------------------------------------------------------- /AppInfo.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "AppInfo" 3 | s.version = "0.0.1" 4 | s.summary = "AppInfo - Swift way to get information about your app with static type safe API" 5 | 6 | s.homepage = "https://github.com/kostiakoval/AppInfo" 7 | s.license = { :type => "MIT", :file => "LICENSE" } 8 | s.author = { "Kostiantyn Koval" => "konstantin.koval1@gmail.com" } 9 | s.social_media_url = "http://twitter.com/kostiakoval" 10 | 11 | s.platform = :ios, "8.0" 12 | s.source = { :git => "https://github.com/kostiakoval/AppInfo.git", :tag => s.version } 13 | 14 | s.source_files = "AppInfo/Classes/**/*.{swift}" 15 | s.requires_arc = true 16 | end 17 | -------------------------------------------------------------------------------- /AppInfo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B58CABB71AAA55CF00BC2F8D /* AppInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CABB61AAA55CF00BC2F8D /* AppInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | B58CABBD1AAA55D000BC2F8D /* AppInfo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B58CABB11AAA55CF00BC2F8D /* AppInfo.framework */; }; 12 | B58CABC41AAA55D000BC2F8D /* AppInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B58CABC31AAA55D000BC2F8D /* AppInfoTests.swift */; }; 13 | B5EDEE5E1AAC2C910057D5B2 /* AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EDEE5D1AAC2C910057D5B2 /* AppInfo.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | B58CABBE1AAA55D000BC2F8D /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = B58CABA81AAA55CF00BC2F8D /* Project object */; 20 | proxyType = 1; 21 | remoteGlobalIDString = B58CABB01AAA55CF00BC2F8D; 22 | remoteInfo = AppInfo; 23 | }; 24 | /* End PBXContainerItemProxy section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | B58CABB11AAA55CF00BC2F8D /* AppInfo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AppInfo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | B58CABB51AAA55CF00BC2F8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | B58CABB61AAA55CF00BC2F8D /* AppInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = ""; }; 30 | B58CABBC1AAA55D000BC2F8D /* AppInfoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppInfoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | B58CABC21AAA55D000BC2F8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | B58CABC31AAA55D000BC2F8D /* AppInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppInfoTests.swift; sourceTree = ""; }; 33 | B5EBF9F31AAC29EE001B140D /* AppInfo.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = AppInfo.podspec; sourceTree = ""; }; 34 | B5EBF9F41AAC29F8001B140D /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 35 | B5EBF9F51AAC29F8001B140D /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 36 | B5EDEE5D1AAC2C910057D5B2 /* AppInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppInfo.swift; path = Classes/AppInfo.swift; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | B58CABAD1AAA55CF00BC2F8D /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | B58CABB91AAA55D000BC2F8D /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | B58CABBD1AAA55D000BC2F8D /* AppInfo.framework in Frameworks */, 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | B58CABA71AAA55CF00BC2F8D = { 59 | isa = PBXGroup; 60 | children = ( 61 | B5EBF9F21AAC29D8001B140D /* Podspec Metadata */, 62 | B58CABB31AAA55CF00BC2F8D /* AppInfo */, 63 | B58CABC01AAA55D000BC2F8D /* AppInfoTests */, 64 | B58CABB21AAA55CF00BC2F8D /* Products */, 65 | ); 66 | sourceTree = ""; 67 | }; 68 | B58CABB21AAA55CF00BC2F8D /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | B58CABB11AAA55CF00BC2F8D /* AppInfo.framework */, 72 | B58CABBC1AAA55D000BC2F8D /* AppInfoTests.xctest */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | B58CABB31AAA55CF00BC2F8D /* AppInfo */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | B58CABCF1AAA587B00BC2F8D /* Source */, 81 | B58CABB61AAA55CF00BC2F8D /* AppInfo.h */, 82 | B58CABB41AAA55CF00BC2F8D /* Supporting Files */, 83 | ); 84 | path = AppInfo; 85 | sourceTree = ""; 86 | }; 87 | B58CABB41AAA55CF00BC2F8D /* Supporting Files */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | B58CABB51AAA55CF00BC2F8D /* Info.plist */, 91 | ); 92 | name = "Supporting Files"; 93 | sourceTree = ""; 94 | }; 95 | B58CABC01AAA55D000BC2F8D /* AppInfoTests */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | B58CABC31AAA55D000BC2F8D /* AppInfoTests.swift */, 99 | B58CABC11AAA55D000BC2F8D /* Supporting Files */, 100 | ); 101 | path = AppInfoTests; 102 | sourceTree = ""; 103 | }; 104 | B58CABC11AAA55D000BC2F8D /* Supporting Files */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | B58CABC21AAA55D000BC2F8D /* Info.plist */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | B58CABCF1AAA587B00BC2F8D /* Source */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | B5EDEE5D1AAC2C910057D5B2 /* AppInfo.swift */, 116 | ); 117 | name = Source; 118 | sourceTree = ""; 119 | }; 120 | B5EBF9F21AAC29D8001B140D /* Podspec Metadata */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | B5EBF9F41AAC29F8001B140D /* LICENSE */, 124 | B5EBF9F51AAC29F8001B140D /* README.md */, 125 | B5EBF9F31AAC29EE001B140D /* AppInfo.podspec */, 126 | ); 127 | name = "Podspec Metadata"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXHeadersBuildPhase section */ 133 | B58CABAE1AAA55CF00BC2F8D /* Headers */ = { 134 | isa = PBXHeadersBuildPhase; 135 | buildActionMask = 2147483647; 136 | files = ( 137 | B58CABB71AAA55CF00BC2F8D /* AppInfo.h in Headers */, 138 | ); 139 | runOnlyForDeploymentPostprocessing = 0; 140 | }; 141 | /* End PBXHeadersBuildPhase section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | B58CABB01AAA55CF00BC2F8D /* AppInfo */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = B58CABC71AAA55D000BC2F8D /* Build configuration list for PBXNativeTarget "AppInfo" */; 147 | buildPhases = ( 148 | B58CABAC1AAA55CF00BC2F8D /* Sources */, 149 | B58CABAD1AAA55CF00BC2F8D /* Frameworks */, 150 | B58CABAE1AAA55CF00BC2F8D /* Headers */, 151 | B58CABAF1AAA55CF00BC2F8D /* Resources */, 152 | ); 153 | buildRules = ( 154 | ); 155 | dependencies = ( 156 | ); 157 | name = AppInfo; 158 | productName = AppInfo; 159 | productReference = B58CABB11AAA55CF00BC2F8D /* AppInfo.framework */; 160 | productType = "com.apple.product-type.framework"; 161 | }; 162 | B58CABBB1AAA55D000BC2F8D /* AppInfoTests */ = { 163 | isa = PBXNativeTarget; 164 | buildConfigurationList = B58CABCA1AAA55D000BC2F8D /* Build configuration list for PBXNativeTarget "AppInfoTests" */; 165 | buildPhases = ( 166 | B58CABB81AAA55D000BC2F8D /* Sources */, 167 | B58CABB91AAA55D000BC2F8D /* Frameworks */, 168 | B58CABBA1AAA55D000BC2F8D /* Resources */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | B58CABBF1AAA55D000BC2F8D /* PBXTargetDependency */, 174 | ); 175 | name = AppInfoTests; 176 | productName = AppInfoTests; 177 | productReference = B58CABBC1AAA55D000BC2F8D /* AppInfoTests.xctest */; 178 | productType = "com.apple.product-type.bundle.unit-test"; 179 | }; 180 | /* End PBXNativeTarget section */ 181 | 182 | /* Begin PBXProject section */ 183 | B58CABA81AAA55CF00BC2F8D /* Project object */ = { 184 | isa = PBXProject; 185 | attributes = { 186 | LastUpgradeCheck = 0630; 187 | ORGANIZATIONNAME = "Kostiantyn Koval"; 188 | TargetAttributes = { 189 | B58CABB01AAA55CF00BC2F8D = { 190 | CreatedOnToolsVersion = 6.3; 191 | }; 192 | B58CABBB1AAA55D000BC2F8D = { 193 | CreatedOnToolsVersion = 6.3; 194 | }; 195 | }; 196 | }; 197 | buildConfigurationList = B58CABAB1AAA55CF00BC2F8D /* Build configuration list for PBXProject "AppInfo" */; 198 | compatibilityVersion = "Xcode 3.2"; 199 | developmentRegion = English; 200 | hasScannedForEncodings = 0; 201 | knownRegions = ( 202 | en, 203 | ); 204 | mainGroup = B58CABA71AAA55CF00BC2F8D; 205 | productRefGroup = B58CABB21AAA55CF00BC2F8D /* Products */; 206 | projectDirPath = ""; 207 | projectRoot = ""; 208 | targets = ( 209 | B58CABB01AAA55CF00BC2F8D /* AppInfo */, 210 | B58CABBB1AAA55D000BC2F8D /* AppInfoTests */, 211 | ); 212 | }; 213 | /* End PBXProject section */ 214 | 215 | /* Begin PBXResourcesBuildPhase section */ 216 | B58CABAF1AAA55CF00BC2F8D /* Resources */ = { 217 | isa = PBXResourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | B58CABBA1AAA55D000BC2F8D /* Resources */ = { 224 | isa = PBXResourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | /* End PBXResourcesBuildPhase section */ 231 | 232 | /* Begin PBXSourcesBuildPhase section */ 233 | B58CABAC1AAA55CF00BC2F8D /* Sources */ = { 234 | isa = PBXSourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | B5EDEE5E1AAC2C910057D5B2 /* AppInfo.swift in Sources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | B58CABB81AAA55D000BC2F8D /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | B58CABC41AAA55D000BC2F8D /* AppInfoTests.swift in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin PBXTargetDependency section */ 252 | B58CABBF1AAA55D000BC2F8D /* PBXTargetDependency */ = { 253 | isa = PBXTargetDependency; 254 | target = B58CABB01AAA55CF00BC2F8D /* AppInfo */; 255 | targetProxy = B58CABBE1AAA55D000BC2F8D /* PBXContainerItemProxy */; 256 | }; 257 | /* End PBXTargetDependency section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | B58CABC51AAA55D000BC2F8D /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 265 | CLANG_CXX_LIBRARY = "libc++"; 266 | CLANG_ENABLE_MODULES = YES; 267 | CLANG_ENABLE_OBJC_ARC = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_CONSTANT_CONVERSION = YES; 270 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 271 | CLANG_WARN_EMPTY_BODY = YES; 272 | CLANG_WARN_ENUM_CONVERSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_UNREACHABLE_CODE = YES; 276 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 277 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 278 | COPY_PHASE_STRIP = NO; 279 | CURRENT_PROJECT_VERSION = 1; 280 | DEBUG_INFORMATION_FORMAT = dwarf; 281 | ENABLE_STRICT_OBJC_MSGSEND = YES; 282 | GCC_C_LANGUAGE_STANDARD = gnu99; 283 | GCC_DYNAMIC_NO_PIC = NO; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_OPTIMIZATION_LEVEL = 0; 286 | GCC_PREPROCESSOR_DEFINITIONS = ( 287 | "DEBUG=1", 288 | "$(inherited)", 289 | ); 290 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 293 | GCC_WARN_UNDECLARED_SELECTOR = YES; 294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 295 | GCC_WARN_UNUSED_FUNCTION = YES; 296 | GCC_WARN_UNUSED_VARIABLE = YES; 297 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 298 | MTL_ENABLE_DEBUG_INFO = YES; 299 | ONLY_ACTIVE_ARCH = YES; 300 | SDKROOT = iphoneos; 301 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 302 | TARGETED_DEVICE_FAMILY = "1,2"; 303 | VERSIONING_SYSTEM = "apple-generic"; 304 | VERSION_INFO_PREFIX = ""; 305 | }; 306 | name = Debug; 307 | }; 308 | B58CABC61AAA55D000BC2F8D /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_MODULES = YES; 315 | CLANG_ENABLE_OBJC_ARC = YES; 316 | CLANG_WARN_BOOL_CONVERSION = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_EMPTY_BODY = YES; 320 | CLANG_WARN_ENUM_CONVERSION = YES; 321 | CLANG_WARN_INT_CONVERSION = YES; 322 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 323 | CLANG_WARN_UNREACHABLE_CODE = YES; 324 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 325 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 326 | COPY_PHASE_STRIP = NO; 327 | CURRENT_PROJECT_VERSION = 1; 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | ENABLE_NS_ASSERTIONS = NO; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_NO_COMMON_BLOCKS = YES; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 340 | MTL_ENABLE_DEBUG_INFO = NO; 341 | SDKROOT = iphoneos; 342 | TARGETED_DEVICE_FAMILY = "1,2"; 343 | VALIDATE_PRODUCT = YES; 344 | VERSIONING_SYSTEM = "apple-generic"; 345 | VERSION_INFO_PREFIX = ""; 346 | }; 347 | name = Release; 348 | }; 349 | B58CABC81AAA55D000BC2F8D /* Debug */ = { 350 | isa = XCBuildConfiguration; 351 | buildSettings = { 352 | CLANG_ENABLE_MODULES = YES; 353 | DEFINES_MODULE = YES; 354 | DYLIB_COMPATIBILITY_VERSION = 1; 355 | DYLIB_CURRENT_VERSION = 1; 356 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 357 | INFOPLIST_FILE = AppInfo/Info.plist; 358 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 359 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 360 | PRODUCT_NAME = "$(TARGET_NAME)"; 361 | SKIP_INSTALL = YES; 362 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 363 | }; 364 | name = Debug; 365 | }; 366 | B58CABC91AAA55D000BC2F8D /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | CLANG_ENABLE_MODULES = YES; 370 | DEFINES_MODULE = YES; 371 | DYLIB_COMPATIBILITY_VERSION = 1; 372 | DYLIB_CURRENT_VERSION = 1; 373 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 374 | INFOPLIST_FILE = AppInfo/Info.plist; 375 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | SKIP_INSTALL = YES; 379 | }; 380 | name = Release; 381 | }; 382 | B58CABCB1AAA55D000BC2F8D /* Debug */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | FRAMEWORK_SEARCH_PATHS = ( 386 | "$(SDKROOT)/Developer/Library/Frameworks", 387 | "$(inherited)", 388 | ); 389 | GCC_PREPROCESSOR_DEFINITIONS = ( 390 | "DEBUG=1", 391 | "$(inherited)", 392 | ); 393 | INFOPLIST_FILE = AppInfoTests/Info.plist; 394 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 395 | PRODUCT_NAME = "$(TARGET_NAME)"; 396 | }; 397 | name = Debug; 398 | }; 399 | B58CABCC1AAA55D000BC2F8D /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | FRAMEWORK_SEARCH_PATHS = ( 403 | "$(SDKROOT)/Developer/Library/Frameworks", 404 | "$(inherited)", 405 | ); 406 | INFOPLIST_FILE = AppInfoTests/Info.plist; 407 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | }; 410 | name = Release; 411 | }; 412 | /* End XCBuildConfiguration section */ 413 | 414 | /* Begin XCConfigurationList section */ 415 | B58CABAB1AAA55CF00BC2F8D /* Build configuration list for PBXProject "AppInfo" */ = { 416 | isa = XCConfigurationList; 417 | buildConfigurations = ( 418 | B58CABC51AAA55D000BC2F8D /* Debug */, 419 | B58CABC61AAA55D000BC2F8D /* Release */, 420 | ); 421 | defaultConfigurationIsVisible = 0; 422 | defaultConfigurationName = Release; 423 | }; 424 | B58CABC71AAA55D000BC2F8D /* Build configuration list for PBXNativeTarget "AppInfo" */ = { 425 | isa = XCConfigurationList; 426 | buildConfigurations = ( 427 | B58CABC81AAA55D000BC2F8D /* Debug */, 428 | B58CABC91AAA55D000BC2F8D /* Release */, 429 | ); 430 | defaultConfigurationIsVisible = 0; 431 | defaultConfigurationName = Release; 432 | }; 433 | B58CABCA1AAA55D000BC2F8D /* Build configuration list for PBXNativeTarget "AppInfoTests" */ = { 434 | isa = XCConfigurationList; 435 | buildConfigurations = ( 436 | B58CABCB1AAA55D000BC2F8D /* Debug */, 437 | B58CABCC1AAA55D000BC2F8D /* Release */, 438 | ); 439 | defaultConfigurationIsVisible = 0; 440 | defaultConfigurationName = Release; 441 | }; 442 | /* End XCConfigurationList section */ 443 | }; 444 | rootObject = B58CABA81AAA55CF00BC2F8D /* Project object */; 445 | } 446 | -------------------------------------------------------------------------------- /AppInfo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AppInfo/AppInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppInfo.h 3 | // AppInfo 4 | // 5 | // Created by Konstantin Koval on 06/03/15. 6 | // Copyright (c) 2015 Kostiantyn Koval. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for AppInfo. 12 | FOUNDATION_EXPORT double AppInfoVersionNumber; 13 | 14 | //! Project version string for AppInfo. 15 | FOUNDATION_EXPORT const unsigned char AppInfoVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /AppInfo/Classes/AppInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppInfo.swift 3 | // AppInfo 4 | // 5 | // Created by Konstantin Koval on 06/03/15. 6 | // Copyright (c) 2015 Kostiantyn Koval. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | //MARK: - Convertors 12 | 13 | infix operator >> { associativity right precedence 90 } 14 | func >> (x: T, f: (T) -> R) -> R { 15 | return f(x) 16 | } 17 | 18 | private func string(object: AnyObject?) -> String? { 19 | return object as? String 20 | } 21 | 22 | private func stringToInt(object: AnyObject?) -> Int? { 23 | return (object as? String)?.toInt() 24 | } 25 | 26 | private func int(object: AnyObject?) -> Int? { 27 | return object as? Int 28 | } 29 | 30 | private func array(object: AnyObject?) -> Array? { 31 | return object as? Array 32 | } 33 | 34 | public struct AppInfo { 35 | private static let bundleInfo = NSBundle.mainBundle().infoDictionary as! Dictionary 36 | 37 | public static var CFBundleIdentifier: String? { 38 | return bundleInfo["CFBundleIdentifier"] >> string 39 | } 40 | 41 | public static var DTPlatformName: String? { 42 | return bundleInfo["DTPlatformName"] >> string 43 | } 44 | 45 | public static var UIMainStoryboardFile: String? { 46 | return bundleInfo["UIMainStoryboardFile"] >> string 47 | } 48 | 49 | public static var CFBundleVersion: Int? { 50 | return bundleInfo["CFBundleVersion"] >> stringToInt 51 | } 52 | 53 | public static var CFBundleSignature: String? { 54 | return bundleInfo["CFBundleSignature"] >> string 55 | } 56 | 57 | public static var CFBundleExecutable: String? { 58 | return bundleInfo["CFBundleExecutable"] >> string 59 | } 60 | 61 | public static var LSRequiresIPhoneOS: Int? { 62 | return bundleInfo["LSRequiresIPhoneOS"] >> int 63 | } 64 | 65 | public static var CFBundleName: String? { 66 | return bundleInfo["CFBundleName"] >> string 67 | } 68 | 69 | public static var UILaunchStoryboardName: String? { 70 | return bundleInfo["UILaunchStoryboardName"] >> string 71 | } 72 | 73 | public static var CFBundleSupportedPlatforms: Array? { 74 | return bundleInfo["CFBundleSupportedPlatforms"] >> array 75 | } 76 | 77 | public static var CFBundlePackageType: String? { 78 | return bundleInfo["CFBundlePackageType"] >> string 79 | } 80 | 81 | public static var CFBundleNumericVersion: Int? { 82 | return bundleInfo["CFBundleNumericVersion"] >> int 83 | } 84 | 85 | public static var CFBundleInfoDictionaryVersion: String? { 86 | return bundleInfo["CFBundleInfoDictionaryVersion"] >> string 87 | } 88 | 89 | public static var UIRequiredDeviceCapabilities: Array? { 90 | return bundleInfo["UIRequiredDeviceCapabilities"] >> array 91 | } 92 | 93 | public static var UISupportedInterfaceOrientations: Array? { 94 | return bundleInfo["UISupportedInterfaceOrientations"] >> array 95 | } 96 | 97 | public static var CFBundleInfoPlistURL: String? { 98 | return bundleInfo["CFBundleInfoPlistURL"] >> string 99 | } 100 | 101 | public static var CFBundleDevelopmentRegion: String? { 102 | return bundleInfo["CFBundleDevelopmentRegion"] >> string 103 | } 104 | 105 | public static var DTSDKName: String? { 106 | return bundleInfo["DTSDKName"] >> string 107 | } 108 | 109 | public static var UIDeviceFamily: Array? { 110 | return bundleInfo["UIDeviceFamily"] >> array 111 | } 112 | 113 | public static var CFBundleShortVersionString: String? { 114 | return bundleInfo["CFBundleShortVersionString"] >> string 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /AppInfo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | kkoval.$(PRODUCT_NAME:rfc1034identifier) 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 | -------------------------------------------------------------------------------- /AppInfoTests/AppInfoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppInfoTests.swift 3 | // AppInfoTests 4 | // 5 | // Created by Konstantin Koval on 06/03/15. 6 | // Copyright (c) 2015 Kostiantyn Koval. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class AppInfoTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /AppInfoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | kkoval.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/DemoApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A8D85E927387BAF640EB0F56 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 447C894D45564556AB0C6D08 /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 11 | B57E89D01AAA26E400DD47BF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57E89CF1AAA26E400DD47BF /* AppDelegate.swift */; }; 12 | B57E89D51AAA26E400DD47BF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B57E89D31AAA26E400DD47BF /* Main.storyboard */; }; 13 | B57E89D71AAA26E400DD47BF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B57E89D61AAA26E400DD47BF /* Images.xcassets */; }; 14 | B57E89DA1AAA26E400DD47BF /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = B57E89D81AAA26E400DD47BF /* LaunchScreen.xib */; }; 15 | B5EBF9EB1AAB5D73001B140D /* AppInfoItemsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EBF9EA1AAB5D73001B140D /* AppInfoItemsViewController.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 447C894D45564556AB0C6D08 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 497617EDE93480241CC263D9 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 21 | B57E89CA1AAA26E400DD47BF /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | B57E89CE1AAA26E400DD47BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 23 | B57E89CF1AAA26E400DD47BF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 24 | B57E89D41AAA26E400DD47BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | B57E89D61AAA26E400DD47BF /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 26 | B57E89D91AAA26E400DD47BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 27 | B5EBF9EA1AAB5D73001B140D /* AppInfoItemsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppInfoItemsViewController.swift; sourceTree = ""; }; 28 | CC17B30581848786E7B80E59 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | B57E89C71AAA26E400DD47BF /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | A8D85E927387BAF640EB0F56 /* Pods.framework in Frameworks */, 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | 13F32295E3E772E9629A7B5F /* Pods */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | CC17B30581848786E7B80E59 /* Pods.debug.xcconfig */, 47 | 497617EDE93480241CC263D9 /* Pods.release.xcconfig */, 48 | ); 49 | name = Pods; 50 | sourceTree = ""; 51 | }; 52 | 73FE2CF26A513E50450B6CD8 /* Frameworks */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 447C894D45564556AB0C6D08 /* Pods.framework */, 56 | ); 57 | name = Frameworks; 58 | sourceTree = ""; 59 | }; 60 | B57E89C11AAA26E400DD47BF = { 61 | isa = PBXGroup; 62 | children = ( 63 | B57E89CC1AAA26E400DD47BF /* DemoApp */, 64 | B57E89CB1AAA26E400DD47BF /* Products */, 65 | 13F32295E3E772E9629A7B5F /* Pods */, 66 | 73FE2CF26A513E50450B6CD8 /* Frameworks */, 67 | ); 68 | sourceTree = ""; 69 | }; 70 | B57E89CB1AAA26E400DD47BF /* Products */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | B57E89CA1AAA26E400DD47BF /* DemoApp.app */, 74 | ); 75 | name = Products; 76 | sourceTree = ""; 77 | }; 78 | B57E89CC1AAA26E400DD47BF /* DemoApp */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | B57E89CF1AAA26E400DD47BF /* AppDelegate.swift */, 82 | B5EBF9EA1AAB5D73001B140D /* AppInfoItemsViewController.swift */, 83 | B57E89D31AAA26E400DD47BF /* Main.storyboard */, 84 | B57E89D61AAA26E400DD47BF /* Images.xcassets */, 85 | B57E89D81AAA26E400DD47BF /* LaunchScreen.xib */, 86 | B57E89CD1AAA26E400DD47BF /* Supporting Files */, 87 | ); 88 | path = DemoApp; 89 | sourceTree = ""; 90 | }; 91 | B57E89CD1AAA26E400DD47BF /* Supporting Files */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | B57E89CE1AAA26E400DD47BF /* Info.plist */, 95 | ); 96 | name = "Supporting Files"; 97 | sourceTree = ""; 98 | }; 99 | /* End PBXGroup section */ 100 | 101 | /* Begin PBXNativeTarget section */ 102 | B57E89C91AAA26E400DD47BF /* DemoApp */ = { 103 | isa = PBXNativeTarget; 104 | buildConfigurationList = B57E89E91AAA26E400DD47BF /* Build configuration list for PBXNativeTarget "DemoApp" */; 105 | buildPhases = ( 106 | 1CF688AB52D2D951B4C613A8 /* Check Pods Manifest.lock */, 107 | B57E89C61AAA26E400DD47BF /* Sources */, 108 | B57E89C71AAA26E400DD47BF /* Frameworks */, 109 | B57E89C81AAA26E400DD47BF /* Resources */, 110 | F05E446CA638EA8D1F4BB51D /* Embed Pods Frameworks */, 111 | 59C160CAB9B5827299C9DB00 /* Copy Pods Resources */, 112 | ); 113 | buildRules = ( 114 | ); 115 | dependencies = ( 116 | ); 117 | name = DemoApp; 118 | productName = DemoApp; 119 | productReference = B57E89CA1AAA26E400DD47BF /* DemoApp.app */; 120 | productType = "com.apple.product-type.application"; 121 | }; 122 | /* End PBXNativeTarget section */ 123 | 124 | /* Begin PBXProject section */ 125 | B57E89C21AAA26E400DD47BF /* Project object */ = { 126 | isa = PBXProject; 127 | attributes = { 128 | LastUpgradeCheck = 0630; 129 | ORGANIZATIONNAME = "Kostiantyn Koval"; 130 | TargetAttributes = { 131 | B57E89C91AAA26E400DD47BF = { 132 | CreatedOnToolsVersion = 6.3; 133 | }; 134 | }; 135 | }; 136 | buildConfigurationList = B57E89C51AAA26E400DD47BF /* Build configuration list for PBXProject "DemoApp" */; 137 | compatibilityVersion = "Xcode 3.2"; 138 | developmentRegion = English; 139 | hasScannedForEncodings = 0; 140 | knownRegions = ( 141 | en, 142 | Base, 143 | ); 144 | mainGroup = B57E89C11AAA26E400DD47BF; 145 | productRefGroup = B57E89CB1AAA26E400DD47BF /* Products */; 146 | projectDirPath = ""; 147 | projectRoot = ""; 148 | targets = ( 149 | B57E89C91AAA26E400DD47BF /* DemoApp */, 150 | ); 151 | }; 152 | /* End PBXProject section */ 153 | 154 | /* Begin PBXResourcesBuildPhase section */ 155 | B57E89C81AAA26E400DD47BF /* Resources */ = { 156 | isa = PBXResourcesBuildPhase; 157 | buildActionMask = 2147483647; 158 | files = ( 159 | B57E89D51AAA26E400DD47BF /* Main.storyboard in Resources */, 160 | B57E89DA1AAA26E400DD47BF /* LaunchScreen.xib in Resources */, 161 | B57E89D71AAA26E400DD47BF /* Images.xcassets in Resources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXResourcesBuildPhase section */ 166 | 167 | /* Begin PBXShellScriptBuildPhase section */ 168 | 1CF688AB52D2D951B4C613A8 /* Check Pods Manifest.lock */ = { 169 | isa = PBXShellScriptBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | ); 173 | inputPaths = ( 174 | ); 175 | name = "Check Pods Manifest.lock"; 176 | outputPaths = ( 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | shellPath = /bin/sh; 180 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 181 | showEnvVarsInLog = 0; 182 | }; 183 | 59C160CAB9B5827299C9DB00 /* Copy Pods Resources */ = { 184 | isa = PBXShellScriptBuildPhase; 185 | buildActionMask = 2147483647; 186 | files = ( 187 | ); 188 | inputPaths = ( 189 | ); 190 | name = "Copy Pods Resources"; 191 | outputPaths = ( 192 | ); 193 | runOnlyForDeploymentPostprocessing = 0; 194 | shellPath = /bin/sh; 195 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 196 | showEnvVarsInLog = 0; 197 | }; 198 | F05E446CA638EA8D1F4BB51D /* Embed Pods Frameworks */ = { 199 | isa = PBXShellScriptBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | ); 203 | inputPaths = ( 204 | ); 205 | name = "Embed Pods Frameworks"; 206 | outputPaths = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | shellPath = /bin/sh; 210 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; 211 | showEnvVarsInLog = 0; 212 | }; 213 | /* End PBXShellScriptBuildPhase section */ 214 | 215 | /* Begin PBXSourcesBuildPhase section */ 216 | B57E89C61AAA26E400DD47BF /* Sources */ = { 217 | isa = PBXSourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | B57E89D01AAA26E400DD47BF /* AppDelegate.swift in Sources */, 221 | B5EBF9EB1AAB5D73001B140D /* AppInfoItemsViewController.swift in Sources */, 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | /* End PBXSourcesBuildPhase section */ 226 | 227 | /* Begin PBXVariantGroup section */ 228 | B57E89D31AAA26E400DD47BF /* Main.storyboard */ = { 229 | isa = PBXVariantGroup; 230 | children = ( 231 | B57E89D41AAA26E400DD47BF /* Base */, 232 | ); 233 | name = Main.storyboard; 234 | sourceTree = ""; 235 | }; 236 | B57E89D81AAA26E400DD47BF /* LaunchScreen.xib */ = { 237 | isa = PBXVariantGroup; 238 | children = ( 239 | B57E89D91AAA26E400DD47BF /* Base */, 240 | ); 241 | name = LaunchScreen.xib; 242 | sourceTree = ""; 243 | }; 244 | /* End PBXVariantGroup section */ 245 | 246 | /* Begin XCBuildConfiguration section */ 247 | B57E89E71AAA26E400DD47BF /* Debug */ = { 248 | isa = XCBuildConfiguration; 249 | buildSettings = { 250 | ALWAYS_SEARCH_USER_PATHS = NO; 251 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 252 | CLANG_CXX_LIBRARY = "libc++"; 253 | CLANG_ENABLE_MODULES = YES; 254 | CLANG_ENABLE_OBJC_ARC = YES; 255 | CLANG_WARN_BOOL_CONVERSION = YES; 256 | CLANG_WARN_CONSTANT_CONVERSION = YES; 257 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INT_CONVERSION = YES; 261 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = dwarf; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_DYNAMIC_NO_PIC = NO; 270 | GCC_NO_COMMON_BLOCKS = YES; 271 | GCC_OPTIMIZATION_LEVEL = 0; 272 | GCC_PREPROCESSOR_DEFINITIONS = ( 273 | "DEBUG=1", 274 | "$(inherited)", 275 | ); 276 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 284 | MTL_ENABLE_DEBUG_INFO = YES; 285 | ONLY_ACTIVE_ARCH = YES; 286 | SDKROOT = iphoneos; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 288 | }; 289 | name = Debug; 290 | }; 291 | B57E89E81AAA26E400DD47BF /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ALWAYS_SEARCH_USER_PATHS = NO; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_MODULES = YES; 298 | CLANG_ENABLE_OBJC_ARC = YES; 299 | CLANG_WARN_BOOL_CONVERSION = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 302 | CLANG_WARN_EMPTY_BODY = YES; 303 | CLANG_WARN_ENUM_CONVERSION = YES; 304 | CLANG_WARN_INT_CONVERSION = YES; 305 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 306 | CLANG_WARN_UNREACHABLE_CODE = YES; 307 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 308 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 309 | COPY_PHASE_STRIP = NO; 310 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 311 | ENABLE_NS_ASSERTIONS = NO; 312 | ENABLE_STRICT_OBJC_MSGSEND = YES; 313 | GCC_C_LANGUAGE_STANDARD = gnu99; 314 | GCC_NO_COMMON_BLOCKS = YES; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 317 | GCC_WARN_UNDECLARED_SELECTOR = YES; 318 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 319 | GCC_WARN_UNUSED_FUNCTION = YES; 320 | GCC_WARN_UNUSED_VARIABLE = YES; 321 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 322 | MTL_ENABLE_DEBUG_INFO = NO; 323 | SDKROOT = iphoneos; 324 | VALIDATE_PRODUCT = YES; 325 | }; 326 | name = Release; 327 | }; 328 | B57E89EA1AAA26E400DD47BF /* Debug */ = { 329 | isa = XCBuildConfiguration; 330 | baseConfigurationReference = CC17B30581848786E7B80E59 /* Pods.debug.xcconfig */; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 334 | INFOPLIST_FILE = DemoApp/Info.plist; 335 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 336 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 337 | PRODUCT_NAME = "$(TARGET_NAME)"; 338 | }; 339 | name = Debug; 340 | }; 341 | B57E89EB1AAA26E400DD47BF /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | baseConfigurationReference = 497617EDE93480241CC263D9 /* Pods.release.xcconfig */; 344 | buildSettings = { 345 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 346 | FRAMEWORK_SEARCH_PATHS = "$(inherited)"; 347 | INFOPLIST_FILE = DemoApp/Info.plist; 348 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 349 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 350 | PRODUCT_NAME = "$(TARGET_NAME)"; 351 | }; 352 | name = Release; 353 | }; 354 | /* End XCBuildConfiguration section */ 355 | 356 | /* Begin XCConfigurationList section */ 357 | B57E89C51AAA26E400DD47BF /* Build configuration list for PBXProject "DemoApp" */ = { 358 | isa = XCConfigurationList; 359 | buildConfigurations = ( 360 | B57E89E71AAA26E400DD47BF /* Debug */, 361 | B57E89E81AAA26E400DD47BF /* Release */, 362 | ); 363 | defaultConfigurationIsVisible = 0; 364 | defaultConfigurationName = Release; 365 | }; 366 | B57E89E91AAA26E400DD47BF /* Build configuration list for PBXNativeTarget "DemoApp" */ = { 367 | isa = XCConfigurationList; 368 | buildConfigurations = ( 369 | B57E89EA1AAA26E400DD47BF /* Debug */, 370 | B57E89EB1AAA26E400DD47BF /* Release */, 371 | ); 372 | defaultConfigurationIsVisible = 0; 373 | defaultConfigurationName = Release; 374 | }; 375 | /* End XCConfigurationList section */ 376 | }; 377 | rootObject = B57E89C21AAA26E400DD47BF /* Project object */; 378 | } 379 | -------------------------------------------------------------------------------- /Example/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /Example/DemoApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/DemoApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DemoApp 4 | // 5 | // Created by Konstantin Koval on 06/03/15. 6 | // Copyright (c) 2015 Kostiantyn Koval. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AppInfo 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | return true 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Example/DemoApp/AppInfoItemsViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppInfoItemsViewController.swift 3 | // DemoApp 4 | // 5 | // Created by Konstantin Koval on 07/03/15. 6 | // Copyright (c) 2015 Kostiantyn Koval. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import AppInfo 11 | 12 | struct AppInfoItem { 13 | let name: String 14 | let value: String? 15 | } 16 | 17 | class AppInfoItemsViewController: UITableViewController { 18 | 19 | var items: Array = [] 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | loadItems() 24 | } 25 | 26 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 27 | return items.count 28 | } 29 | 30 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 31 | 32 | let cell = tableView.dequeueReusableCellWithIdentifier("AppInfoItemCell", forIndexPath: indexPath) as! UITableViewCell 33 | 34 | let item = items[indexPath.row] 35 | cell.textLabel?.text = item.name 36 | cell.detailTextLabel?.text = item.value 37 | 38 | return cell 39 | } 40 | 41 | private func loadItems() { 42 | 43 | items.append(AppInfoItem(name: "CFBundleIdentifier", value:AppInfo.CFBundleIdentifier)) 44 | items.append(AppInfoItem(name: "DTPlatformName", value: AppInfo.DTPlatformName)) 45 | items.append(AppInfoItem(name: "UIMainStoryboardFile", value:AppInfo.UIMainStoryboardFile)) 46 | items.append(AppInfoItem(name: "CFBundleVersion", value:"\(AppInfo.CFBundleVersion!)")) 47 | items.append(AppInfoItem(name: "CFBundleSignature", value:AppInfo.CFBundleSignature)) 48 | items.append(AppInfoItem(name: "CFBundleExecutable", value:AppInfo.CFBundleExecutable)) 49 | items.append(AppInfoItem(name: "LSRequiresIPhoneOS", value:AppInfo.LSRequiresIPhoneOS!>||)) 50 | items.append(AppInfoItem(name: "CFBundleName", value:AppInfo.CFBundleName)) 51 | items.append(AppInfoItem(name: "UILaunchStoryboardName", value:AppInfo.UILaunchStoryboardName!>||)) 52 | items.append(AppInfoItem(name: "CFBundleSupportedPlatforms", value:AppInfo.CFBundleSupportedPlatforms!>||)) 53 | items.append(AppInfoItem(name: "CFBundlePackageType", value:AppInfo.CFBundlePackageType)) 54 | items.append(AppInfoItem(name: "CFBundleNumericVersion", value:AppInfo.CFBundleNumericVersion!>||)) 55 | items.append(AppInfoItem(name: "CFBundleInfoDictionaryVersion", value:AppInfo.CFBundleInfoDictionaryVersion)) 56 | items.append(AppInfoItem(name: "UIRequiredDeviceCapabilities", value:AppInfo.UIRequiredDeviceCapabilities!>||)) 57 | items.append(AppInfoItem(name: "UISupportedInterfaceOrientations", value:AppInfo.UISupportedInterfaceOrientations!>||)) 58 | items.append(AppInfoItem(name: "CFBundleInfoPlistURL", value:AppInfo.CFBundleInfoPlistURL)) 59 | items.append(AppInfoItem(name: "CFBundleDevelopmentRegion", value:AppInfo.CFBundleDevelopmentRegion)) 60 | items.append(AppInfoItem(name: "DTSDKName", value:AppInfo.DTSDKName)) 61 | items.append(AppInfoItem(name: "UIDeviceFamily", value:AppInfo.UIDeviceFamily!>||)) 62 | items.append(AppInfoItem(name: "CFBundleShortVersionString", value:AppInfo.CFBundleShortVersionString)) 63 | } 64 | } 65 | 66 | postfix operator >|| {} 67 | postfix func >|| (x: T ) -> String { 68 | return "\(x)" 69 | } 70 | 71 | private func string(object: AnyObject?) -> String? { 72 | return object as? String 73 | } 74 | 75 | -------------------------------------------------------------------------------- /Example/DemoApp/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/DemoApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Example/DemoApp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/DemoApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | kkoval.$(PRODUCT_NAME:rfc1034identifier) 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 | 2 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '8.0' 3 | 4 | inhibit_all_warnings! 5 | use_frameworks! 6 | 7 | pod "AppInfo", :path => "../" 8 | 9 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AppInfo (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - AppInfo (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | AppInfo: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | AppInfo: f2c1b5352bff71c963e6968e3af49f0a4bf96d07 13 | 14 | COCOAPODS: 0.36.0.rc.1 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Kostiantyn Koval 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AppInfo 2 | ======= 3 | 4 | Get information about your app in Swifty way 5 | 6 | ## The Idea 7 | 8 | Do you remember yourself doing this? Can remember all the keys? How many times have you searched for the right names? 9 | 10 | ```swift 11 | let text = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] 12 | 13 | // Keys 14 | "CFBundleDisplayName", "CFBundleVersion", "UIRequiredDeviceCapabilities", "UIMainStoryboardFile", ... 15 | ``` 16 | Wouldn't it be awesome to have Xcode to show them *all*? And be staticly typed!? 17 | 18 | Enter **AppInfo**. 19 | 20 | ## Usage 21 | 22 | AppInfo provides an static typed API for working with `infoDictionary`. 23 | 24 | ```swift 25 | let name = AppInfo.CFBundleName 26 | let build = AppInfo.CFBundleVersion 27 | let version = AppInfo.CFBundleShortVersionString 28 | let devices = AppInfo.UIDeviceFamily 29 | 30 | /* 31 | Results: 32 | Name - "DemeApp", String 33 | build - 2, Int 34 | version - "1.0", String 35 | devices - ["armv7"], Array 36 | /* 37 | ``` 38 | 39 | ## Benefits 40 | 41 | - Static typed keys. No string keys anymore 42 | - Static typed values. Correct key values: Int, String, Array ... 43 | 44 | ## Installation 45 | 46 | ### Copied files 47 | 48 | The simplest way - copy `AppInfo/Classes/AppInfo.swift` to your project. That's it! 49 | 50 | ### CocoaPods 51 | 52 | ```ruby 53 | use_frameworks! 54 | pod 'AppInfo' 55 | ``` 56 | Then import it to your project: 57 | ```swift 58 | import AppInfo 59 | ``` 60 | 61 | Note: This requires CocoaPods 0.36 as well as iOS 8 62 | 63 | ## Contribute 64 | 65 | Please open an issue with bugs and missing features, functionality or ideas for improvements. 66 | 67 | Also you can contribute by following this guidelines: 68 | 69 | 1. Fork it 70 | 2. Create your feature branch (`git checkout -b my-new-feature`) 71 | 3. Commit your changes (`git commit -am 'Add some feature'`) 72 | 4. Push to the branch (`git push origin my-new-feature`) 73 | 5. Create pull request 74 | 75 | ## Author 76 | 77 | Kostiantyn Koval, [@KostiaKoval](https://twitter.com/KostiaKoval) 78 | 79 | ## License 80 | 81 | AppInfo is available under the MIT license. See the LICENSE file for more info. 82 | --------------------------------------------------------------------------------