diff --git a/Biome.podspec b/Biome.podspec index 5852e52..ba8c568 100644 --- a/Biome.podspec +++ b/Biome.podspec @@ -1,42 +1,18 @@ -# -# Be sure to run `pod lib lint Biome.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - Pod::Spec.new do |s| s.name = 'Biome' - s.version = '0.1.0' - s.summary = 'A short description of Biome.' - -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - + s.version = '1.0.0' + s.summary = 'Simple environment management for iOS / macOS / tvOS / watchOS!' s.description = <<-DESC -TODO: Add long description of the pod here. +Biome is a simple way to manage sets of variables between environments you might need to work with when developing your application. + +One problem developers face, is the need to create multiple builds in order to test how their application functions in different environments. Biome aims to reduce the amount of re-building that needs to occur, by providing a mechanism to switch configurations during run-time. DESC s.homepage = 'https://github.com/ndizazzo/Biome' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'ndizazzo' => 'nick@twg.io' } + s.author = { 'ndizazzo' => 'nick.dizazzo@gmail.com' } s.source = { :git => 'https://github.com/ndizazzo/Biome.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/' s.ios.deployment_target = '8.0' - s.source_files = 'Biome/Classes/**/*' - - # s.resource_bundles = { - # 'Biome' => ['Biome/Assets/*.png'] - # } - - # s.public_header_files = 'Pod/Classes/**/*.h' - # s.frameworks = 'UIKit', 'MapKit' - # s.dependency 'AFNetworking', '~> 2.3' end diff --git a/Biome.xcodeproj/project.pbxproj b/Biome.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6bf6b1b --- /dev/null +++ b/Biome.xcodeproj/project.pbxproj @@ -0,0 +1,475 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C5EE7B1E1E6DE98200EC5A49 /* Biome.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5EE7B141E6DE98200EC5A49 /* Biome.framework */; }; + C5EE7B251E6DE98200EC5A49 /* Biome.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EE7B171E6DE98200EC5A49 /* Biome.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C5EE7B321E6DEA4100EC5A49 /* Biome.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B2F1E6DEA4100EC5A49 /* Biome.swift */; }; + C5EE7B331E6DEA4100EC5A49 /* BiomeDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B301E6DEA4100EC5A49 /* BiomeDataSource.swift */; }; + C5EE7B341E6DEA4100EC5A49 /* PlistBiomeProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B311E6DEA4100EC5A49 /* PlistBiomeProvider.swift */; }; + C5EE7B3A1E6DEAA100EC5A49 /* BiomeManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B361E6DEAA100EC5A49 /* BiomeManagerTests.swift */; }; + C5EE7B3B1E6DEAA100EC5A49 /* BiomeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B371E6DEAA100EC5A49 /* BiomeTests.swift */; }; + C5EE7B3C1E6DEAA100EC5A49 /* PlistBiomeProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5EE7B381E6DEAA100EC5A49 /* PlistBiomeProviderTests.swift */; }; + C5EE7B3D1E6DEAA100EC5A49 /* testProperties.plist in Resources */ = {isa = PBXBuildFile; fileRef = C5EE7B391E6DEAA100EC5A49 /* testProperties.plist */; }; + C5EE7B611E6DFD3500EC5A49 /* Carthage.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = C5EE7B601E6DFD3500EC5A49 /* Carthage.xcconfig */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + C5EE7B1F1E6DE98200EC5A49 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C5EE7B0B1E6DE98200EC5A49 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C5EE7B131E6DE98200EC5A49; + remoteInfo = Biome; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + C5EE7B141E6DE98200EC5A49 /* Biome.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Biome.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C5EE7B171E6DE98200EC5A49 /* Biome.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Biome.h; sourceTree = ""; }; + C5EE7B181E6DE98200EC5A49 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C5EE7B1D1E6DE98200EC5A49 /* BiomeTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BiomeTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + C5EE7B241E6DE98200EC5A49 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C5EE7B2F1E6DEA4100EC5A49 /* Biome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Biome.swift; path = Classes/Biome.swift; sourceTree = ""; }; + C5EE7B301E6DEA4100EC5A49 /* BiomeDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BiomeDataSource.swift; path = Classes/BiomeDataSource.swift; sourceTree = ""; }; + C5EE7B311E6DEA4100EC5A49 /* PlistBiomeProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PlistBiomeProvider.swift; path = Classes/PlistBiomeProvider.swift; sourceTree = ""; }; + C5EE7B361E6DEAA100EC5A49 /* BiomeManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiomeManagerTests.swift; sourceTree = ""; }; + C5EE7B371E6DEAA100EC5A49 /* BiomeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiomeTests.swift; sourceTree = ""; }; + C5EE7B381E6DEAA100EC5A49 /* PlistBiomeProviderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlistBiomeProviderTests.swift; sourceTree = ""; }; + C5EE7B391E6DEAA100EC5A49 /* testProperties.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = testProperties.plist; sourceTree = ""; }; + C5EE7B601E6DFD3500EC5A49 /* Carthage.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C5EE7B101E6DE98200EC5A49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C5EE7B1A1E6DE98200EC5A49 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B1E1E6DE98200EC5A49 /* Biome.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C5EE7B0A1E6DE98200EC5A49 = { + isa = PBXGroup; + children = ( + C5EE7B601E6DFD3500EC5A49 /* Carthage.xcconfig */, + C5EE7B161E6DE98200EC5A49 /* Biome */, + C5EE7B211E6DE98200EC5A49 /* BiomeTests */, + C5EE7B151E6DE98200EC5A49 /* Products */, + ); + sourceTree = ""; + }; + C5EE7B151E6DE98200EC5A49 /* Products */ = { + isa = PBXGroup; + children = ( + C5EE7B141E6DE98200EC5A49 /* Biome.framework */, + C5EE7B1D1E6DE98200EC5A49 /* BiomeTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + C5EE7B161E6DE98200EC5A49 /* Biome */ = { + isa = PBXGroup; + children = ( + C5EE7B2E1E6DE9DA00EC5A49 /* Biome */, + C5EE7B171E6DE98200EC5A49 /* Biome.h */, + C5EE7B181E6DE98200EC5A49 /* Info.plist */, + ); + path = Biome; + sourceTree = ""; + }; + C5EE7B211E6DE98200EC5A49 /* BiomeTests */ = { + isa = PBXGroup; + children = ( + C5EE7B351E6DEA4B00EC5A49 /* Biome */, + C5EE7B241E6DE98200EC5A49 /* Info.plist */, + ); + path = BiomeTests; + sourceTree = ""; + }; + C5EE7B2E1E6DE9DA00EC5A49 /* Biome */ = { + isa = PBXGroup; + children = ( + C5EE7B2F1E6DEA4100EC5A49 /* Biome.swift */, + C5EE7B301E6DEA4100EC5A49 /* BiomeDataSource.swift */, + C5EE7B311E6DEA4100EC5A49 /* PlistBiomeProvider.swift */, + ); + name = Biome; + sourceTree = ""; + }; + C5EE7B351E6DEA4B00EC5A49 /* Biome */ = { + isa = PBXGroup; + children = ( + C5EE7B361E6DEAA100EC5A49 /* BiomeManagerTests.swift */, + C5EE7B371E6DEAA100EC5A49 /* BiomeTests.swift */, + C5EE7B381E6DEAA100EC5A49 /* PlistBiomeProviderTests.swift */, + C5EE7B391E6DEAA100EC5A49 /* testProperties.plist */, + ); + name = Biome; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + C5EE7B111E6DE98200EC5A49 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B251E6DE98200EC5A49 /* Biome.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + C5EE7B131E6DE98200EC5A49 /* Biome */ = { + isa = PBXNativeTarget; + buildConfigurationList = C5EE7B281E6DE98200EC5A49 /* Build configuration list for PBXNativeTarget "Biome" */; + buildPhases = ( + C5EE7B0F1E6DE98200EC5A49 /* Sources */, + C5EE7B101E6DE98200EC5A49 /* Frameworks */, + C5EE7B111E6DE98200EC5A49 /* Headers */, + C5EE7B121E6DE98200EC5A49 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Biome; + productName = Biome; + productReference = C5EE7B141E6DE98200EC5A49 /* Biome.framework */; + productType = "com.apple.product-type.framework"; + }; + C5EE7B1C1E6DE98200EC5A49 /* BiomeTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C5EE7B2B1E6DE98200EC5A49 /* Build configuration list for PBXNativeTarget "BiomeTests" */; + buildPhases = ( + C5EE7B191E6DE98200EC5A49 /* Sources */, + C5EE7B1A1E6DE98200EC5A49 /* Frameworks */, + C5EE7B1B1E6DE98200EC5A49 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C5EE7B201E6DE98200EC5A49 /* PBXTargetDependency */, + ); + name = BiomeTests; + productName = BiomeTests; + productReference = C5EE7B1D1E6DE98200EC5A49 /* BiomeTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C5EE7B0B1E6DE98200EC5A49 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0820; + LastUpgradeCheck = 0820; + ORGANIZATIONNAME = "Nick DiZazzo"; + TargetAttributes = { + C5EE7B131E6DE98200EC5A49 = { + CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 0820; + ProvisioningStyle = Manual; + }; + C5EE7B1C1E6DE98200EC5A49 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = C5EE7B0E1E6DE98200EC5A49 /* Build configuration list for PBXProject "Biome" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C5EE7B0A1E6DE98200EC5A49; + productRefGroup = C5EE7B151E6DE98200EC5A49 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C5EE7B131E6DE98200EC5A49 /* Biome */, + C5EE7B1C1E6DE98200EC5A49 /* BiomeTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C5EE7B121E6DE98200EC5A49 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B611E6DFD3500EC5A49 /* Carthage.xcconfig in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C5EE7B1B1E6DE98200EC5A49 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B3D1E6DEAA100EC5A49 /* testProperties.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C5EE7B0F1E6DE98200EC5A49 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B341E6DEA4100EC5A49 /* PlistBiomeProvider.swift in Sources */, + C5EE7B321E6DEA4100EC5A49 /* Biome.swift in Sources */, + C5EE7B331E6DEA4100EC5A49 /* BiomeDataSource.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C5EE7B191E6DE98200EC5A49 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C5EE7B3B1E6DEAA100EC5A49 /* BiomeTests.swift in Sources */, + C5EE7B3A1E6DEAA100EC5A49 /* BiomeManagerTests.swift in Sources */, + C5EE7B3C1E6DEAA100EC5A49 /* PlistBiomeProviderTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + C5EE7B201E6DE98200EC5A49 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C5EE7B131E6DE98200EC5A49 /* Biome */; + targetProxy = C5EE7B1F1E6DE98200EC5A49 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + C5EE7B261E6DE98200EC5A49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator macosx"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Debug; + }; + C5EE7B271E6DE98200EC5A49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator appletvos appletvsimulator macosx"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2,3,4"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Release; + }; + C5EE7B291E6DE98200EC5A49 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Biome/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.Biome; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + C5EE7B2A1E6DE98200EC5A49 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Biome/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.Biome; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + C5EE7B2C1E6DE98200EC5A49 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C5EE7B601E6DFD3500EC5A49 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + INFOPLIST_FILE = BiomeTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.BiomeTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + C5EE7B2D1E6DE98200EC5A49 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C5EE7B601E6DFD3500EC5A49 /* Carthage.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + INFOPLIST_FILE = BiomeTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.BiomeTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C5EE7B0E1E6DE98200EC5A49 /* Build configuration list for PBXProject "Biome" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C5EE7B261E6DE98200EC5A49 /* Debug */, + C5EE7B271E6DE98200EC5A49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C5EE7B281E6DE98200EC5A49 /* Build configuration list for PBXNativeTarget "Biome" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C5EE7B291E6DE98200EC5A49 /* Debug */, + C5EE7B2A1E6DE98200EC5A49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C5EE7B2B1E6DE98200EC5A49 /* Build configuration list for PBXNativeTarget "BiomeTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C5EE7B2C1E6DE98200EC5A49 /* Debug */, + C5EE7B2D1E6DE98200EC5A49 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C5EE7B0B1E6DE98200EC5A49 /* Project object */; +} diff --git a/Example/Biome.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Biome.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Example/Biome.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Biome.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/Biome.xcodeproj/xcshareddata/xcschemes/Biome-Example.xcscheme b/Biome.xcodeproj/xcshareddata/xcschemes/Biome.xcscheme similarity index 62% rename from Example/Biome.xcodeproj/xcshareddata/xcschemes/Biome-Example.xcscheme rename to Biome.xcodeproj/xcshareddata/xcschemes/Biome.xcscheme index 7fafef4..3aa7ed2 100644 --- a/Example/Biome.xcodeproj/xcshareddata/xcschemes/Biome-Example.xcscheme +++ b/Biome.xcodeproj/xcshareddata/xcschemes/Biome.xcscheme @@ -14,23 +14,9 @@ buildForAnalyzing = "YES"> - - - - @@ -40,15 +26,16 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> @@ -56,9 +43,9 @@ @@ -75,16 +62,15 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> - + - + @@ -94,16 +80,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> - + - + diff --git a/Biome/Assets/.gitkeep b/Biome/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Biome/Biome.h b/Biome/Biome.h new file mode 100644 index 0000000..8a02c1a --- /dev/null +++ b/Biome/Biome.h @@ -0,0 +1,25 @@ +// +// Biome1.h +// Biome1 +// +// Created by Nick DiZazzo on 2017-03-06. +// Copyright © 2017 Nick DiZazzo. All rights reserved. +// + +#include + +#if TARGET_OS_IPHONE || TARGET_OS_TV || TARGET_IPHONE_SIMULATOR +#import +#else +#import +#endif + +//! Project version number for Biome1. +FOUNDATION_EXPORT double Biome1VersionNumber; + +//! Project version string for Biome1. +FOUNDATION_EXPORT const unsigned char Biome1VersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Biome/Classes/.gitkeep b/Biome/Classes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Biome/Classes/Biome.swift b/Biome/Classes/Biome.swift new file mode 100644 index 0000000..d74266f --- /dev/null +++ b/Biome/Classes/Biome.swift @@ -0,0 +1,116 @@ +// +// Biome.swift +// Biome +// +// Created by Nick DiZazzo on 2017-02-28. +// Copyright © 2017 Nick DiZazzo. All rights reserved. +// + +import Foundation + +// MARK: - +// MARK: BiomeProvider + +public protocol BiomeProvider { + var biomeName: String { get } + func mappedPropertyDictionary() -> [String: Any] +} + +// MARK: - +// MARK: BiomeManager + +public enum BiomeError: Error { + case previouslyRegistered + case notRegistered +} + +public protocol BiomeManagerDelegate { + func switched(to biome: Biome?) +} + +public class BiomeManager { + public static let shared = BiomeManager() + + internal var biomes: Set = Set() + + public var count: Int { get { return self.biomes.count } } + public var current: Biome? { didSet { self.delegate?.switched(to: self.current) } } + public var delegate: BiomeManagerDelegate? + + public var keys: Set { + get { + var unversalKeys = Set() + + for biome in self.biomes { + biome.properties.keys.forEach { unversalKeys.insert($0) } + } + + return unversalKeys + } + } + + public static func register(_ biome: Biome) throws { + if shared.biomes.contains(biome) { + throw BiomeError.previouslyRegistered + } + + if shared.count == 0 { + shared.current = biome + } + + shared.biomes.insert(biome) + } + + public static func remove(_ biome: Biome) throws { + guard shared.biomes.contains(biome) else { + throw BiomeError.notRegistered + } + + shared.biomes.remove(biome) + } + + public func clear() { + self.current = nil + self.biomes.removeAll() + } +} + +// MARK: - +// MARK: Biome +public class Biome { + fileprivate var properties: [String: Any] = [:] + + public private(set) var name: String = "" + public var count: Int { get { return properties.keys.count } } + + public init(named biomeName: String) { + self.name = biomeName + } + + public init(with provider: BiomeProvider) { + self.name = provider.biomeName + self.properties = provider.mappedPropertyDictionary() + } + + public func get(_ key: String) -> Any? { + return self.properties[key] + } + + public func set(_ key: String, value: Any?) { + self.properties[key] = value + } +} + +// MARK: - +// MARK: Equatable +extension Biome: Equatable { + public static func ==(lhs: Biome, rhs: Biome) -> Bool { + return lhs.name == rhs.name + } +} + +// MARK: - +// MARK: Hashable +extension Biome: Hashable { + public var hashValue: Int { get { return self.name.hash } } +} diff --git a/Biome/Classes/BiomeDataSource.swift b/Biome/Classes/BiomeDataSource.swift new file mode 100644 index 0000000..9e6cec4 --- /dev/null +++ b/Biome/Classes/BiomeDataSource.swift @@ -0,0 +1,98 @@ +// +// BiomeDataSource.swift +// Pods +// +// Created by Nick DiZazzo on 2017-03-01. +// +// + +import Foundation + +#if os(iOS) || os(watchOS) || os(tvOS) +// MARK: - +// MARK: BiomeDataSource +public class BiomeDataSource: NSObject { + internal weak var manager: BiomeManager? + internal var biomes: [Biome] + + public init(biomeManager: BiomeManager) { + self.manager = biomeManager + self.biomes = Array(biomeManager.biomes) + } + + fileprivate func biome(at index: Int) -> Biome? { + guard index >= 0 && index < self.biomes.count else { + return nil + } + + return self.biomes[index] + } + + fileprivate func viewModel(for biome: Biome) -> BiomeViewModel { + let isActive = self.manager?.current == biome + let string = biome.count == 1 ? "%d key" : "%d keys" + return BiomeViewModel(name: biome.name, + subtitle: String.init(format: string, biome.count), + active: isActive) + } +} + +// MARK: - +// MARK: UITableViewDataSource +extension BiomeDataSource: UITableViewDataSource { + + public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return self.biomes.count + } + + public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = self.cell(tableView: tableView) + if let biome = self.biome(at: indexPath.row) { + let viewModel = self.viewModel(for: biome) + cell.update(with: viewModel) + } + + return cell + } + + private func cell(tableView: UITableView) -> UITableViewCell { + var cell = tableView.dequeueReusableCell(withIdentifier: "cell") + + if cell == nil { + cell = UITableViewCell(style: .subtitle, reuseIdentifier: "cell") + } + + return cell! + } +} + +// MARK: - +// MARK: UITableViewDelegate +extension BiomeDataSource: UITableViewDelegate { + public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let biome = self.biome(at: indexPath.row) + self.manager?.current = biome + + var indexSet = IndexSet() + indexSet.insert(0) + + tableView.reloadSections(indexSet, with: .automatic) + } +} + +// MARK: - +// MARK: Random view stuff +fileprivate struct BiomeViewModel { + var name: String + var subtitle: String + var active: Bool +} + +extension UITableViewCell { + fileprivate func update(with viewModel: BiomeViewModel) { + self.textLabel?.text = viewModel.name + self.detailTextLabel?.text = viewModel.subtitle + self.accessoryType = viewModel.active ? .checkmark : .none + } +} +#endif diff --git a/Biome/Classes/PlistBiomeProvider.swift b/Biome/Classes/PlistBiomeProvider.swift new file mode 100644 index 0000000..2859aa5 --- /dev/null +++ b/Biome/Classes/PlistBiomeProvider.swift @@ -0,0 +1,31 @@ +// +// PlistBiomeProvider.swift +// Biome +// +// Created by Nick DiZazzo on 2017-02-28. +// Copyright © 2017 Nick DiZazzo. All rights reserved. +// + +import Foundation + +public class PlistBiomeProvider: BiomeProvider { + + var plistFileName: String + var bundle: Bundle + + public var biomeName: String { get { return self.plistFileName } } + + public init(bundle: Bundle, filename: String) { + self.plistFileName = filename + self.bundle = bundle + } + + public func mappedPropertyDictionary() -> [String : Any] { + if let path = self.bundle.path(forResource: self.plistFileName, ofType: "plist"), + let dict = NSDictionary(contentsOfFile: path) as? [String: AnyObject] { + return dict + } + + return [:] + } +} diff --git a/Biome/Classes/ReplaceMe.swift b/Biome/Classes/ReplaceMe.swift deleted file mode 100644 index e69de29..0000000 diff --git a/Biome/Info.plist b/Biome/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/Biome/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/BiomeDemo/BiomeDemo.xcodeproj/project.pbxproj b/BiomeDemo/BiomeDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b301d52 --- /dev/null +++ b/BiomeDemo/BiomeDemo.xcodeproj/project.pbxproj @@ -0,0 +1,428 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C57075AF1E6F15DF00F4C96E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C57075A31E6F15DF00F4C96E /* AppDelegate.swift */; }; + C57075B01E6F15DF00F4C96E /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C57075A51E6F15DF00F4C96E /* LaunchScreen.xib */; }; + C57075B11E6F15DF00F4C96E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C57075A71E6F15DF00F4C96E /* Main.storyboard */; }; + C57075B21E6F15DF00F4C96E /* Development.plist in Resources */ = {isa = PBXBuildFile; fileRef = C57075A91E6F15DF00F4C96E /* Development.plist */; }; + C57075B31E6F15DF00F4C96E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C57075AA1E6F15DF00F4C96E /* Images.xcassets */; }; + C57075B51E6F15DF00F4C96E /* Production.plist in Resources */ = {isa = PBXBuildFile; fileRef = C57075AC1E6F15DF00F4C96E /* Production.plist */; }; + C57075B61E6F15DF00F4C96E /* Staging.plist in Resources */ = {isa = PBXBuildFile; fileRef = C57075AD1E6F15DF00F4C96E /* Staging.plist */; }; + C57075B71E6F15DF00F4C96E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C57075AE1E6F15DF00F4C96E /* ViewController.swift */; }; + C57075C31E6F177E00F4C96E /* Biome.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C57075C01E6F174E00F4C96E /* Biome.framework */; }; + C57075C41E6F177E00F4C96E /* Biome.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C57075C01E6F174E00F4C96E /* Biome.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + C57075BF1E6F174E00F4C96E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C5EE7B141E6DE98200EC5A49; + remoteInfo = Biome; + }; + C57075C11E6F174E00F4C96E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C5EE7B1D1E6DE98200EC5A49; + remoteInfo = BiomeTests; + }; + C57075C51E6F177E00F4C96E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C5EE7B131E6DE98200EC5A49; + remoteInfo = Biome; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + C57075C71E6F177E00F4C96E /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C57075C41E6F177E00F4C96E /* Biome.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + C570758E1E6F15A500F4C96E /* BiomeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BiomeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C57075A31E6F15DF00F4C96E /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + C57075A61E6F15DF00F4C96E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = LaunchScreen.xib; sourceTree = ""; }; + C57075A81E6F15DF00F4C96E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = ""; }; + C57075A91E6F15DF00F4C96E /* Development.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Development.plist; sourceTree = ""; }; + C57075AA1E6F15DF00F4C96E /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + C57075AB1E6F15DF00F4C96E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C57075AC1E6F15DF00F4C96E /* Production.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Production.plist; sourceTree = ""; }; + C57075AD1E6F15DF00F4C96E /* Staging.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Staging.plist; sourceTree = ""; }; + C57075AE1E6F15DF00F4C96E /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Biome.xcodeproj; path = ../Biome.xcodeproj; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C570758B1E6F15A500F4C96E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C57075C31E6F177E00F4C96E /* Biome.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C57075851E6F15A500F4C96E = { + isa = PBXGroup; + children = ( + C57075901E6F15A500F4C96E /* BiomeDemo */, + C570758F1E6F15A500F4C96E /* Products */, + C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */, + ); + sourceTree = ""; + }; + C570758F1E6F15A500F4C96E /* Products */ = { + isa = PBXGroup; + children = ( + C570758E1E6F15A500F4C96E /* BiomeDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + C57075901E6F15A500F4C96E /* BiomeDemo */ = { + isa = PBXGroup; + children = ( + C57075A31E6F15DF00F4C96E /* AppDelegate.swift */, + C57075B91E6F15FC00F4C96E /* View Controllers */, + C57075B81E6F15EF00F4C96E /* Supporting Files */, + ); + path = BiomeDemo; + sourceTree = ""; + }; + C57075B81E6F15EF00F4C96E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C57075A71E6F15DF00F4C96E /* Main.storyboard */, + C57075A51E6F15DF00F4C96E /* LaunchScreen.xib */, + C57075A91E6F15DF00F4C96E /* Development.plist */, + C57075AA1E6F15DF00F4C96E /* Images.xcassets */, + C57075AB1E6F15DF00F4C96E /* Info.plist */, + C57075AC1E6F15DF00F4C96E /* Production.plist */, + C57075AD1E6F15DF00F4C96E /* Staging.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C57075B91E6F15FC00F4C96E /* View Controllers */ = { + isa = PBXGroup; + children = ( + C57075AE1E6F15DF00F4C96E /* ViewController.swift */, + ); + name = "View Controllers"; + sourceTree = ""; + }; + C57075BB1E6F174E00F4C96E /* Products */ = { + isa = PBXGroup; + children = ( + C57075C01E6F174E00F4C96E /* Biome.framework */, + C57075C21E6F174E00F4C96E /* BiomeTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C570758D1E6F15A500F4C96E /* BiomeDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = C57075A01E6F15A500F4C96E /* Build configuration list for PBXNativeTarget "BiomeDemo" */; + buildPhases = ( + C570758A1E6F15A500F4C96E /* Sources */, + C570758B1E6F15A500F4C96E /* Frameworks */, + C570758C1E6F15A500F4C96E /* Resources */, + C57075C71E6F177E00F4C96E /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C57075C61E6F177E00F4C96E /* PBXTargetDependency */, + ); + name = BiomeDemo; + productName = BiomeDemo; + productReference = C570758E1E6F15A500F4C96E /* BiomeDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C57075861E6F15A500F4C96E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0820; + LastUpgradeCheck = 0820; + ORGANIZATIONNAME = "Nick DiZazzo"; + TargetAttributes = { + C570758D1E6F15A500F4C96E = { + CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 0820; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = C57075891E6F15A500F4C96E /* Build configuration list for PBXProject "BiomeDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C57075851E6F15A500F4C96E; + productRefGroup = C570758F1E6F15A500F4C96E /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = C57075BB1E6F174E00F4C96E /* Products */; + ProjectRef = C57075BA1E6F174E00F4C96E /* Biome.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + C570758D1E6F15A500F4C96E /* BiomeDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + C57075C01E6F174E00F4C96E /* Biome.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Biome.framework; + remoteRef = C57075BF1E6F174E00F4C96E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C57075C21E6F174E00F4C96E /* BiomeTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = BiomeTests.xctest; + remoteRef = C57075C11E6F174E00F4C96E /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + C570758C1E6F15A500F4C96E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C57075B01E6F15DF00F4C96E /* LaunchScreen.xib in Resources */, + C57075B11E6F15DF00F4C96E /* Main.storyboard in Resources */, + C57075B31E6F15DF00F4C96E /* Images.xcassets in Resources */, + C57075B51E6F15DF00F4C96E /* Production.plist in Resources */, + C57075B61E6F15DF00F4C96E /* Staging.plist in Resources */, + C57075B21E6F15DF00F4C96E /* Development.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C570758A1E6F15A500F4C96E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C57075B71E6F15DF00F4C96E /* ViewController.swift in Sources */, + C57075AF1E6F15DF00F4C96E /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + C57075C61E6F177E00F4C96E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Biome; + targetProxy = C57075C51E6F177E00F4C96E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + C57075A51E6F15DF00F4C96E /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + C57075A61E6F15DF00F4C96E /* Base */, + ); + name = LaunchScreen.xib; + path = Base.lproj; + sourceTree = ""; + }; + C57075A71E6F15DF00F4C96E /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C57075A81E6F15DF00F4C96E /* Base */, + ); + name = Main.storyboard; + path = Base.lproj; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C570759E1E6F15A500F4C96E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C570759F1E6F15A500F4C96E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C57075A11E6F15A500F4C96E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = BiomeDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.BiomeDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + C57075A21E6F15A500F4C96E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = BiomeDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.ndizazzo.BiomeDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C57075891E6F15A500F4C96E /* Build configuration list for PBXProject "BiomeDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C570759E1E6F15A500F4C96E /* Debug */, + C570759F1E6F15A500F4C96E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C57075A01E6F15A500F4C96E /* Build configuration list for PBXNativeTarget "BiomeDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C57075A11E6F15A500F4C96E /* Debug */, + C57075A21E6F15A500F4C96E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C57075861E6F15A500F4C96E /* Project object */; +} diff --git a/BiomeDemo/BiomeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/BiomeDemo/BiomeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3c480e1 --- /dev/null +++ b/BiomeDemo/BiomeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/BiomeDemo/BiomeDemo/AppDelegate.swift b/BiomeDemo/BiomeDemo/AppDelegate.swift new file mode 100644 index 0000000..b860a0f --- /dev/null +++ b/BiomeDemo/BiomeDemo/AppDelegate.swift @@ -0,0 +1,37 @@ +// +// AppDelegate.swift +// Biome +// +// Created by ndizazzo on 03/01/2017. +// Copyright (c) 2017 ndizazzo. All rights reserved. +// + +import UIKit +import Biome + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + + self.createExampleBiomes() + + return true + } + + func createExampleBiomes() { + let devBiome = Biome(with: PlistBiomeProvider(bundle: Bundle.main, filename: "Development")) + let stagingBiome = Biome(with: PlistBiomeProvider(bundle: Bundle.main, filename: "Staging")) + let prodBiome = Biome(with: PlistBiomeProvider(bundle: Bundle.main, filename: "Production")) + + do { + try BiomeManager.register(devBiome) + try BiomeManager.register(stagingBiome) + try BiomeManager.register(prodBiome) + } catch _ { + assert(false, "Couldn't create a Biome. Is a Plist file missing?") + } + } +} + diff --git a/Example/Biome/Images.xcassets/AppIcon.appiconset/Contents.json b/BiomeDemo/BiomeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 54% rename from Example/Biome/Images.xcassets/AppIcon.appiconset/Contents.json rename to BiomeDemo/BiomeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json index d3942e9..36d2c80 100644 --- a/Example/Biome/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/BiomeDemo/BiomeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -29,10 +29,40 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/Example/Biome/Base.lproj/LaunchScreen.xib b/BiomeDemo/BiomeDemo/Base.lproj/LaunchScreen.xib similarity index 84% rename from Example/Biome/Base.lproj/LaunchScreen.xib rename to BiomeDemo/BiomeDemo/Base.lproj/LaunchScreen.xib index f4c11b8..102b219 100644 --- a/Example/Biome/Base.lproj/LaunchScreen.xib +++ b/BiomeDemo/BiomeDemo/Base.lproj/LaunchScreen.xib @@ -1,8 +1,13 @@ - - + + + + + - + + + @@ -24,7 +29,7 @@ - + diff --git a/BiomeDemo/BiomeDemo/Base.lproj/Main.storyboard b/BiomeDemo/BiomeDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b2de96c --- /dev/null +++ b/BiomeDemo/BiomeDemo/Base.lproj/Main.storyboard @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BiomeDemo/BiomeDemo/Development.plist b/BiomeDemo/BiomeDemo/Development.plist new file mode 100644 index 0000000..9cf7d28 --- /dev/null +++ b/BiomeDemo/BiomeDemo/Development.plist @@ -0,0 +1,8 @@ + + + + + api_url + http://development.api.com + + diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Contents.json b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..577719e --- /dev/null +++ b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,128 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon-App-57x57@1x.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon-App-57x57@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..e5206ae Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..5396423 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..276e84b Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..18b359a Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..79cd971 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..1384364 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..5396423 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..070ab63 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..ba9095a Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png new file mode 100644 index 0000000..ce581ba Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png new file mode 100644 index 0000000..fc6dd8f Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..ba9095a Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..4595b25 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..c1839d4 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..581e701 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..b7f1476 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/Contents.json b/BiomeDemo/BiomeDemo/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/BiomeDemo/BiomeDemo/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/Contents.json b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/Contents.json new file mode 100644 index 0000000..7080a83 --- /dev/null +++ b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "biome.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "biome-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "biome-2.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-1.png b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-1.png new file mode 100644 index 0000000..2351385 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-1.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-2.png b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-2.png new file mode 100644 index 0000000..2351385 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome-2.png differ diff --git a/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome.png b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome.png new file mode 100644 index 0000000..2351385 Binary files /dev/null and b/BiomeDemo/BiomeDemo/Images.xcassets/logo.imageset/biome.png differ diff --git a/Example/Biome/Info.plist b/BiomeDemo/BiomeDemo/Info.plist similarity index 100% rename from Example/Biome/Info.plist rename to BiomeDemo/BiomeDemo/Info.plist diff --git a/BiomeDemo/BiomeDemo/Production.plist b/BiomeDemo/BiomeDemo/Production.plist new file mode 100644 index 0000000..309b5ec --- /dev/null +++ b/BiomeDemo/BiomeDemo/Production.plist @@ -0,0 +1,8 @@ + + + + + api_url + http://production.api.com + + diff --git a/BiomeDemo/BiomeDemo/Staging.plist b/BiomeDemo/BiomeDemo/Staging.plist new file mode 100644 index 0000000..b7b7186 --- /dev/null +++ b/BiomeDemo/BiomeDemo/Staging.plist @@ -0,0 +1,8 @@ + + + + + api_url + http://staging.api.com + + diff --git a/BiomeDemo/BiomeDemo/ViewController.swift b/BiomeDemo/BiomeDemo/ViewController.swift new file mode 100644 index 0000000..5f2fedb --- /dev/null +++ b/BiomeDemo/BiomeDemo/ViewController.swift @@ -0,0 +1,47 @@ +// +// ViewController.swift +// Biome +// +// Created by ndizazzo on 03/01/2017. +// Copyright (c) 2017 ndizazzo. All rights reserved. +// + +import UIKit +import Biome + +class ViewController: UIViewController { + @IBOutlet weak var showBiomesButton: UIButton? + + @IBOutlet weak var apiURLLabel: UILabel? + + var dataSource: BiomeDataSource? + + override func viewDidLoad() { + super.viewDidLoad() + + self.showBiomesButton?.layer.cornerRadius = 3.0 + + let currentBiome = BiomeManager.shared.current + self.apiURLLabel?.text = currentBiome?.get("api_url") as? String + } + + @IBAction func showBiomes(_ sender: Any) { + self.dataSource = BiomeDataSource(biomeManager: BiomeManager.shared) + + BiomeManager.shared.delegate = self + + let tableViewController = UITableViewController(style: .plain) + tableViewController.tableView.delegate = self.dataSource + tableViewController.tableView.dataSource = self.dataSource + tableViewController.title = "Registered Biomes" + + self.navigationController?.pushViewController(tableViewController, animated: true) + } +} + +extension ViewController: BiomeManagerDelegate { + func switched(to biome: Biome?) { + self.apiURLLabel?.text = biome?.get("api_url") as? String + } +} + diff --git a/BiomeTests/BiomeManagerTests.swift b/BiomeTests/BiomeManagerTests.swift new file mode 100644 index 0000000..8683e5c --- /dev/null +++ b/BiomeTests/BiomeManagerTests.swift @@ -0,0 +1,94 @@ +import XCTest +import Biome + +class BiomeManagerTests: XCTestCase { + + var testBiome: Biome! + var biomeManager: BiomeManager! = BiomeManager.shared + + override func setUp() { + super.setUp() + + biomeManager.clear() + + self.testBiome = Biome(named: "test") + self.testBiome.set("testKey", value: "testValue") + } + + override func tearDown() { + super.tearDown() + } + + func testRegisterBiome() { + XCTAssertEqual(biomeManager.count, 0) + + try! BiomeManager.register(testBiome) + XCTAssertEqual(biomeManager.count, 1) + } + + func testRegisteringDuplicateBiome() { + XCTAssertEqual(biomeManager.count, 0) + + try! BiomeManager.register(testBiome) + XCTAssertEqual(biomeManager.count, 1) + + XCTAssertThrowsError( + try BiomeManager.register(testBiome), + "'register' didnt throw expected error", + { error in XCTAssertEqual(error as! BiomeError, .previouslyRegistered) } + ) + } + + func testRemoveBiome() { + try! BiomeManager.register(testBiome) + XCTAssertEqual(biomeManager.count, 1) + + try! BiomeManager.remove(testBiome) + XCTAssertEqual(biomeManager.count, 0) + } + + func testRemovingNonexistantBiome() { + XCTAssertThrowsError( + try BiomeManager.remove(testBiome), + "'remove' didnt throw expected error", + { error in XCTAssertEqual(error as! BiomeError, .notRegistered) } + ) + } + + func testClearingBiomes() { + try! BiomeManager.register(testBiome) + try! BiomeManager.register(Biome(named: "another one")) + XCTAssertEqual(biomeManager.count, 2) + + biomeManager.clear() + + XCTAssertEqual(biomeManager.count, 0) + XCTAssertEqual(biomeManager.current, nil) + } + + func testGatheringKeysAcrossBiomes() { + let firstBiome = Biome(named: "first") + let secondBiome = Biome(named: "second") + + firstBiome.set("firstKey", value: 1) + secondBiome.set("secondKey", value: 2) + + try! BiomeManager.register(firstBiome) + try! BiomeManager.register(secondBiome) + + XCTAssertEqual(BiomeManager.shared.count, 2) + XCTAssertEqual(BiomeManager.shared.keys.count, 2) + XCTAssertEqual(Array(BiomeManager.shared.keys), ["firstKey", "secondKey"]) + } + + func testCurrentBiomeIsSetWhenRegistering() { + try! BiomeManager.register(testBiome) + XCTAssertEqual(biomeManager.current, testBiome) + } + + func testCurrentBiomeRemainsSetWhenRegistering() { + try! BiomeManager.register(testBiome) + try! BiomeManager.register(Biome(named: "second biome")) + XCTAssertEqual(biomeManager.current, testBiome) + } +} diff --git a/BiomeTests/BiomeTests.swift b/BiomeTests/BiomeTests.swift new file mode 100644 index 0000000..aaf5259 --- /dev/null +++ b/BiomeTests/BiomeTests.swift @@ -0,0 +1,59 @@ +import XCTest +import Biome + +final class TestBiomeProvider: BiomeProvider { + var biomeName: String = "testBiome1" + + func mappedPropertyDictionary() -> [String : Any] { + return ["testProviderValue": 1] + } +} + +class BiomeTests: XCTestCase { + var testBiome: Biome! + + override func setUp() { + super.setUp() + + self.testBiome = Biome(named: "test") + self.testBiome.set("testKey", value: "testValue") + } + + override func tearDown() { + super.tearDown() + } + + func testBiomeName() { + XCTAssert(testBiome.name == "test") + } + + func testBiomeCount() { + XCTAssertEqual(self.testBiome.count, 1) + } + + func testGettingBiomeValue() { + try! BiomeManager.register(testBiome) + let testValue = testBiome.get("testKey") as! String + XCTAssertEqual(testValue, "testValue") + } + + func testBiomeEquality() { + let first = Biome(named: "first") + let second = Biome(named: "second") + let duplicate = Biome(named: "first") + + XCTAssertEqual(first, duplicate) + XCTAssertEqual(first, first) + XCTAssertNotEqual(first, second) + } + + func testBiomeWithProvider() { + let biome = Biome(with: TestBiomeProvider()) + XCTAssertEqual(biome.name, "testBiome1") + XCTAssertEqual(biome.count, 1) + + let value = biome.get("testProviderValue") as! Int + XCTAssertEqual(value, 1) + } + +} diff --git a/Example/Tests/Info.plist b/BiomeTests/Info.plist similarity index 100% rename from Example/Tests/Info.plist rename to BiomeTests/Info.plist diff --git a/BiomeTests/PlistBiomeProviderTests.swift b/BiomeTests/PlistBiomeProviderTests.swift new file mode 100644 index 0000000..9e8be54 --- /dev/null +++ b/BiomeTests/PlistBiomeProviderTests.swift @@ -0,0 +1,46 @@ +import XCTest +import Biome + +class PlistBiomeTests: XCTestCase { + + var provider: PlistBiomeProvider! + + override func setUp() { + super.setUp() + + BiomeManager.shared.clear() + self.provider = PlistBiomeProvider(bundle: Bundle(for: BiomeTests.self), filename: "testProperties") + } + + override func tearDown() { + super.tearDown() + } + + func testProviderProperlyProvidesName() { + XCTAssertEqual(self.provider.biomeName, "testProperties") + } + + func testProviderMapsPlistProperties() { + let dict = self.provider.mappedPropertyDictionary() + + XCTAssertEqual(dict.count, 4) + + if let first = dict["test_item_1"] as? String, + let second = dict["test_item_2"] as? Int, + let third = dict["test_item_3"] as? Date, + let fourth = dict["test_item_4"] as? Bool { + XCTAssertEqual(first, "item1") + XCTAssertEqual(second, 0) + XCTAssertEqual(third, Date(timeIntervalSince1970: 1488337200)) + XCTAssertEqual(fourth, false) + } else { + XCTFail("One or more properties were not converted properly") + } + } + + func testProviderReturnsEmptyDictionary() { + let provider = PlistBiomeProvider(bundle: Bundle.main, filename: "doesnt_exist") + let dict = provider.mappedPropertyDictionary() + XCTAssert(dict.isEmpty) + } +} diff --git a/BiomeTests/testProperties.plist b/BiomeTests/testProperties.plist new file mode 100644 index 0000000..fb41657 --- /dev/null +++ b/BiomeTests/testProperties.plist @@ -0,0 +1,14 @@ + + + + + test_item_1 + item1 + test_item_2 + 0 + test_item_3 + 2017-03-01T03:00:00Z + test_item_4 + + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..088292c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +aosndia diff --git a/Carthage.xcconfig b/Carthage.xcconfig new file mode 100644 index 0000000..ba72009 --- /dev/null +++ b/Carthage.xcconfig @@ -0,0 +1,14 @@ +// +// Biome.xcconfig +// Biome +// +// Copyright 2017 Nick DiZazzo +// Simple environment management for iOS / tvOS / watchOS / macOS +// +// https://github.com/ndizazzo/Biome +// + +FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) +FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Example/Biome.xcodeproj/project.pbxproj b/Example/Biome.xcodeproj/project.pbxproj deleted file mode 100644 index 63f3923..0000000 --- a/Example/Biome.xcodeproj/project.pbxproj +++ /dev/null @@ -1,591 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 160D6C99ACB467D862F69AA0 /* Pods_Biome_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 40987F739DAFAC4E3AFCD1E7 /* Pods_Biome_Tests.framework */; }; - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; - 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; - A274BC7EF901CCB9EACAB7D5 /* Pods_Biome_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68277A81DE59560A060864B5 /* Pods_Biome_Example.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 607FACC81AFB9204008FA782 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 607FACCF1AFB9204008FA782; - remoteInfo = Biome; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 123F1145991820198CF3FD54 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = ""; }; - 40987F739DAFAC4E3AFCD1E7 /* Pods_Biome_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Biome_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACD01AFB9204008FA782 /* Biome_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Biome_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 607FACE51AFB9204008FA782 /* Biome_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Biome_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; - 68277A81DE59560A060864B5 /* Pods_Biome_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Biome_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8EDA48D0C57AA2D938A969AB /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - 9E36663531A1101350B98B3F /* Pods-Biome_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Biome_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Biome_Example/Pods-Biome_Example.debug.xcconfig"; sourceTree = ""; }; - B791235A4D5D0513621E0525 /* Pods-Biome_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Biome_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Biome_Example/Pods-Biome_Example.release.xcconfig"; sourceTree = ""; }; - CD551544C9CF793F826D6135 /* Pods-Biome_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Biome_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Biome_Tests/Pods-Biome_Tests.release.xcconfig"; sourceTree = ""; }; - E836313710B95F5DF4152EE1 /* Pods-Biome_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Biome_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Biome_Tests/Pods-Biome_Tests.debug.xcconfig"; sourceTree = ""; }; - FAC44176C68790DF210D40AF /* Biome.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = Biome.podspec; path = ../Biome.podspec; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 607FACCD1AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A274BC7EF901CCB9EACAB7D5 /* Pods_Biome_Example.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE21AFB9204008FA782 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 160D6C99ACB467D862F69AA0 /* Pods_Biome_Tests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3922357F8B370D52F423FD23 /* Pods */ = { - isa = PBXGroup; - children = ( - 9E36663531A1101350B98B3F /* Pods-Biome_Example.debug.xcconfig */, - B791235A4D5D0513621E0525 /* Pods-Biome_Example.release.xcconfig */, - E836313710B95F5DF4152EE1 /* Pods-Biome_Tests.debug.xcconfig */, - CD551544C9CF793F826D6135 /* Pods-Biome_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 529140C1A39F3BC16288FCCF /* Frameworks */ = { - isa = PBXGroup; - children = ( - 68277A81DE59560A060864B5 /* Pods_Biome_Example.framework */, - 40987F739DAFAC4E3AFCD1E7 /* Pods_Biome_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 607FACC71AFB9204008FA782 = { - isa = PBXGroup; - children = ( - 607FACF51AFB993E008FA782 /* Podspec Metadata */, - 607FACD21AFB9204008FA782 /* Example for Biome */, - 607FACE81AFB9204008FA782 /* Tests */, - 607FACD11AFB9204008FA782 /* Products */, - 3922357F8B370D52F423FD23 /* Pods */, - 529140C1A39F3BC16288FCCF /* Frameworks */, - ); - sourceTree = ""; - }; - 607FACD11AFB9204008FA782 /* Products */ = { - isa = PBXGroup; - children = ( - 607FACD01AFB9204008FA782 /* Biome_Example.app */, - 607FACE51AFB9204008FA782 /* Biome_Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 607FACD21AFB9204008FA782 /* Example for Biome */ = { - isa = PBXGroup; - children = ( - 607FACD51AFB9204008FA782 /* AppDelegate.swift */, - 607FACD71AFB9204008FA782 /* ViewController.swift */, - 607FACD91AFB9204008FA782 /* Main.storyboard */, - 607FACDC1AFB9204008FA782 /* Images.xcassets */, - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, - 607FACD31AFB9204008FA782 /* Supporting Files */, - ); - name = "Example for Biome"; - path = Biome; - sourceTree = ""; - }; - 607FACD31AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACD41AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACE81AFB9204008FA782 /* Tests */ = { - isa = PBXGroup; - children = ( - 607FACEB1AFB9204008FA782 /* Tests.swift */, - 607FACE91AFB9204008FA782 /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - 607FACE91AFB9204008FA782 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 607FACEA1AFB9204008FA782 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - FAC44176C68790DF210D40AF /* Biome.podspec */, - 123F1145991820198CF3FD54 /* README.md */, - 8EDA48D0C57AA2D938A969AB /* LICENSE */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 607FACCF1AFB9204008FA782 /* Biome_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Biome_Example" */; - buildPhases = ( - 84C35381466C4448F7C0CCD5 /* [CP] Check Pods Manifest.lock */, - 607FACCC1AFB9204008FA782 /* Sources */, - 607FACCD1AFB9204008FA782 /* Frameworks */, - 607FACCE1AFB9204008FA782 /* Resources */, - 537BB4FA245B9BB8B9D2F734 /* [CP] Embed Pods Frameworks */, - DD80C0D3D9F5727F91BD3588 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Biome_Example; - productName = Biome; - productReference = 607FACD01AFB9204008FA782 /* Biome_Example.app */; - productType = "com.apple.product-type.application"; - }; - 607FACE41AFB9204008FA782 /* Biome_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Biome_Tests" */; - buildPhases = ( - 620FAAA4C3C61141183DCC93 /* [CP] Check Pods Manifest.lock */, - 607FACE11AFB9204008FA782 /* Sources */, - 607FACE21AFB9204008FA782 /* Frameworks */, - 607FACE31AFB9204008FA782 /* Resources */, - 44B3BB3CF6DF85D9F2A2BAEB /* [CP] Embed Pods Frameworks */, - 8ED466B773FE7845B6D53CF3 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 607FACE71AFB9204008FA782 /* PBXTargetDependency */, - ); - name = Biome_Tests; - productName = Tests; - productReference = 607FACE51AFB9204008FA782 /* Biome_Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 607FACC81AFB9204008FA782 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0820; - ORGANIZATIONNAME = CocoaPods; - TargetAttributes = { - 607FACCF1AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0820; - }; - 607FACE41AFB9204008FA782 = { - CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0820; - TestTargetID = 607FACCF1AFB9204008FA782; - }; - }; - }; - buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Biome" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 607FACC71AFB9204008FA782; - productRefGroup = 607FACD11AFB9204008FA782 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 607FACCF1AFB9204008FA782 /* Biome_Example */, - 607FACE41AFB9204008FA782 /* Biome_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 607FACCE1AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, - 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, - 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE31AFB9204008FA782 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 44B3BB3CF6DF85D9F2A2BAEB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Biome_Tests/Pods-Biome_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 537BB4FA245B9BB8B9D2F734 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Biome_Example/Pods-Biome_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 620FAAA4C3C61141183DCC93 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 84C35381466C4448F7C0CCD5 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 8ED466B773FE7845B6D53CF3 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Biome_Tests/Pods-Biome_Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - DD80C0D3D9F5727F91BD3588 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Biome_Example/Pods-Biome_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 607FACCC1AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, - 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 607FACE11AFB9204008FA782 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 607FACCF1AFB9204008FA782 /* Biome_Example */; - targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 607FACD91AFB9204008FA782 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 607FACDA1AFB9204008FA782 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 607FACDF1AFB9204008FA782 /* Base */, - ); - name = LaunchScreen.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 607FACED1AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 607FACEE1AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 607FACF01AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9E36663531A1101350B98B3F /* Pods-Biome_Example.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Biome/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - 607FACF11AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B791235A4D5D0513621E0525 /* Pods-Biome_Example.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Biome/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; - 607FACF31AFB9204008FA782 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E836313710B95F5DF4152EE1 /* Pods-Biome_Tests.debug.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - 607FACF41AFB9204008FA782 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = CD551544C9CF793F826D6135 /* Pods-Biome_Tests.release.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "Biome" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACED1AFB9204008FA782 /* Debug */, - 607FACEE1AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Biome_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF01AFB9204008FA782 /* Debug */, - 607FACF11AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Biome_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 607FACF31AFB9204008FA782 /* Debug */, - 607FACF41AFB9204008FA782 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 607FACC81AFB9204008FA782 /* Project object */; -} diff --git a/Example/Biome/AppDelegate.swift b/Example/Biome/AppDelegate.swift deleted file mode 100644 index 561577a..0000000 --- a/Example/Biome/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// Biome -// -// Created by ndizazzo on 03/01/2017. -// Copyright (c) 2017 ndizazzo. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // 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. - // 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. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // 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. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // 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. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // 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. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/Example/Biome/Base.lproj/Main.storyboard b/Example/Biome/Base.lproj/Main.storyboard deleted file mode 100644 index 52ea29e..0000000 --- a/Example/Biome/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Example/Biome/ViewController.swift b/Example/Biome/ViewController.swift deleted file mode 100644 index 87fa3de..0000000 --- a/Example/Biome/ViewController.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ViewController.swift -// Biome -// -// Created by ndizazzo on 03/01/2017. -// Copyright (c) 2017 ndizazzo. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} - diff --git a/Example/Podfile b/Example/Podfile deleted file mode 100644 index 2930ba4..0000000 --- a/Example/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -use_frameworks! - -target 'Biome_Example' do - pod 'Biome', :path => '../' - - target 'Biome_Tests' do - inherit! :search_paths - - - end -end diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift deleted file mode 100644 index 5c47535..0000000 --- a/Example/Tests/Tests.swift +++ /dev/null @@ -1,29 +0,0 @@ -import UIKit -import XCTest -import Biome - -class Tests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - XCTAssert(true, "Pass") - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure() { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/Images/biome.png b/Images/biome.png new file mode 100644 index 0000000..2351385 Binary files /dev/null and b/Images/biome.png differ diff --git a/LICENSE b/LICENSE index 09a2ac3..f4e6a07 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 ndizazzo +Copyright (c) 2017 ndizazzo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 72a3165..bcf10f6 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,195 @@ -# Biome + -[![CI Status](http://img.shields.io/travis/ndizazzo/Biome.svg?style=flat)](https://travis-ci.org/ndizazzo/Biome) +## Current Status [![Version](https://img.shields.io/cocoapods/v/Biome.svg?style=flat)](http://cocoapods.org/pods/Biome) +[![Downloads](https://img.shields.io/github/downloads/biome/biome/total.svg)](http://cocoapods.org/pods/Biome) +![Supported Platforms](https://img.shields.io/cocoapods/p/Biome.svg) +[![CI Status](http://img.shields.io/travis/ndizazzo/Biome.svg?style=flat)](https://travis-ci.org/ndizazzo/Biome) [![License](https://img.shields.io/cocoapods/l/Biome.svg?style=flat)](http://cocoapods.org/pods/Biome) [![Platform](https://img.shields.io/cocoapods/p/Biome.svg?style=flat)](http://cocoapods.org/pods/Biome) -## Example +## What is Biome? + +Biome is a simple way to manage sets of variables between environments you might need to work with when developing your application. + +One problem developers face, is the need to create multiple builds in order to test how their application functions in different environments. Biome aims to reduce the amount of re-building that needs to occur, by providing a mechanism to switch configurations during run-time. + +## Bio-me? Bi-om-ee? + +Nope. Bi-ohm. + +## What *is* a Biome? + +By definition: + +_noun_ `ECOLOGY` + +> A biome /ˈbaɪoʊm/ is a formation of plants and animals that have common characteristics due to similar climates and can be found over a range of continents. + +Applied for our purposes: + +> A biome is a collection of variables and settings that have common characteristics due to similar environments and can be found across a range of applications. + +## Concept + +### Biome + +The smallest conceptual unit - this object holds simple key / value pairs that define an environment. + +### BiomeProvider -To run the example project, clone the repo, and run `pod install` from the Example directory first. +A protocol that allows mappings from various types of data sets into Biome objects. Conformance to this protocol implies that Biomes will be able to be created from a given provider. -## Requirements +### BiomeManager -## Installation +A centralized place to manage many Biomes. -Biome is available through [CocoaPods](http://cocoapods.org). To install -it, simply add the following line to your Podfile: +## Support +* Xcode 8.0 / Swift 3.0 +* iOS >= 8.0 (Use as an **Embedded** Framework) +* tvOS >= 9.0 +* macOS >= 10.10 (untested, but should still work in theory) + +## Having trouble running the demo? + +* `BiomeDemo/BiomeDemo.xcodeproj` is the demo project for iOS +* Make sure you are running a supported version of Xcode. +* Make sure that your project supports Swift 3.0 + +# Installation + +## Manual Installation + +In order to correctly compile the project: + +1. Drag the `Biome.xcodeproj` to your project +2. Go to your target's settings, hit the "+" under the "Embedded Binaries" section, and select the Biome.framework +3. `@import Biome` +4. When using Swift in an ObjC project: + - You need to import your Bridging Header. Usually it is "*YourProject-Swift.h*". + - (Xcode 8.1 and earlier) Under "Build Options", mark "Embedded Content Contains Swift Code" + - (Xcode 8.2+) Under "Build Options", mark "Always Embed Swift Standard Libraries" + +## CocoaPods Install + +Add the following to your Podfile: -```ruby -pod "Biome" ``` +pod 'Biome' +``` + +and run `pod install` + +## Carthage Install + +Biome includes Carthage prebuilt binaries. + +```carthage +github "ndizazzo/Biome" == 1.0.0 +github "ndizazzo/Biome" ~> 1.0.0 +``` + +In order to build the binaries for a new release, use `carthage build --no-skip-current && carthage archive Biome`. + +# Usage + +## Implementing Biome in your Project +To implement Biome, first `import Biome` into the relevant files where you want to use it. + +Then, create a Biome by calling the `Biome()` constructor, or using the `PlistBiomeProvider(bundle: Bundle, filename: String)`. You can also write a `BiomeProvider` that will return a Biome object out of the provided data. Consider forking and 🔨 contributing back 🔨 to this project. Don't forget to update this README! + +Once you have a `Biome` object, use `BiomeManager.register()` to register it. This does a couple things: +1. Adds it to the set of available Biomes. One uniquely named Biome is allowed per manager. +1. Sets it as the `current` object on `BiomeManager`. This is a property tells you which tells you what Biome is currently active. + +Finally, extend one of your classes: + +```swift +extension MyClass: BiomeManagerDelegate { + func switched(to: Biome) { + print("The active biome has been switched to '\(to.name)'") + } +} +``` + +Use that delegate method to do anything, like clear a CoreData database and reload data into it from a different environment, re-query an API for new data, refresh a view controller's appearance, etc. + +In order to take full advantage of Biome, you'll want to follow the pattern: +```swift + + if let biome = BiomeManager.shared.current, let apiEndpoint = biome.get("api_url") as? String { + myAPIClient.get(apiEndpoint) { response in + // ... + } + } +``` +to gate your application's properties behind Biome so that when you switch environments, the most up-to-date values are always used. + +*NOTE* You are _not_ required to use the shared `BiomeManager`. You can create numerious instances of the class and store them where you wish. + +## Class Descriptions +Implementation of Biome is straightforward. Biome provides several classes and protocols for you to use or customize: +* `class BiomeManager` - A singleton manager object that maintains a list of active 'Biomes' created in your application. + +* `class Biome` - A simple wrapper object that dictates how to access values for keys. You are responsible for knowing the type of data going in, and coming out of a Biome. + +* `protocol BiomeProvider` - A protocol that defines how 'providers' should map keys and values to a Biome. Examples might include: plist files, JSON, XML, user defaults. + +* `class PlistBiomeProvider` - A biome provider that knows how to obtain values from a Plist file. + +# Feature Roadmap + +#### Biome Groups +* You may want to have multiple Biomes active at a given time, or mix and match combinations of variables. Groups would allow the developer to do something like: + * Have a set of variables for API endpoints + * Have a set of style colours to use for UI elements + * Have a set of logging levels + + All without having to make `n!` distinct Biomes to switch between to achieve all possible permutations of variable configurations. + +#### Run-time Property Modification +* Sometimes a developer might need to modify a property at run-time instead of providing it before compile-time. This feature would allow developers to do things like tweak animation timings, for instance. + +# Troubleshooting + +### Can't compile? + +* Please note the difference between installing a compiled framework from CocoaPods or Carthage, and copying the source code. +* Please re-read the usage section. +* Search issues. +* Politely ask in the issues section. + +### Other problems / Feature requests + +* Search issues. +* Politely ask in the issues section. + +# Other + +## 3rd party software + +Biome does not depend on any 3rd party libraries. It's designed to be lightweight and not add tons of overhead to your project. + +## Contributing + +If you have ideas or like what you see here and want to support the project, you could: +* Let people know this library exists (🚀 spread the word 🚀) +* Contribute code, issues and pull requests + +## Questions & Issues + +If you are having questions or problems, you should: + + - Make sure you are using the latest version of the library. Check the [**release-section**](https://github.com/danielgindi/Biome/releases). + - Search or open questions on [**stackoverflow**](http://stackoverflow.com/questions/tagged/ios-biome) with the `ios-biome` tag + - Search [**known issues**](https://github.com/danielgindi/Biome/issues) for your problem (open and closed) + - Create new issues (please **search known issues beforehand** and avoid creating duplicate issues) -## Author +## Documentation +Documentation exists in the form of Xcode quick-help. Please refer to [**Apple's Documentation**](https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/SymbolDocumentation.html) for writing quick help documentation. -ndizazzo, nick@twg.io +Or you can study the [**BiomeDemo**](https://github.com/ndizazzo/biome/tree/master/BiomeDemo) project to learn by example. ## License -Biome is available under the MIT license. See the LICENSE file for more info. +Biome is available under the MIT license. See the LICENSE file for more information. diff --git a/_Pods.xcodeproj b/_Pods.xcodeproj deleted file mode 120000 index 3c5a8e7..0000000 --- a/_Pods.xcodeproj +++ /dev/null @@ -1 +0,0 @@ -Example/Pods/Pods.xcodeproj \ No newline at end of file diff --git a/scripts/build-dependencies.sh b/scripts/build-dependencies.sh new file mode 100755 index 0000000..f33a526 --- /dev/null +++ b/scripts/build-dependencies.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +function build_dependencies { + + has_dependencies=$(ls Carthage/Build/**/*.framework 2> /dev/null | wc -l) + + if [ $has_dependencies != 0 ] + then + echo "Depencies have already been built." + else + echo "Building dependencies..." + carthage bootstrap + fi +} + +function alert_to_install_carthage { + echo "error: Carthage was not found! In order to build Charts you need to use Carthage to build it's dependencies. Carthage can be downloaded from https://github.com/Carthage/Carthage." + exit 1 +} + +if hash carthage 2>/dev/null +then + build_dependencies +else + alert_to_install_carthage +fi \ No newline at end of file diff --git a/scripts/copy-carthage-frameworks.sh b/scripts/copy-carthage-frameworks.sh new file mode 100755 index 0000000..fe47804 --- /dev/null +++ b/scripts/copy-carthage-frameworks.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +case "$PLATFORM_NAME" in + macosx) plat=Mac;; + iphone*) plat=iOS;; + watch*) plat=watchOS;; + appletv*) plat=tvOS;; + *) echo "error: Unknown PLATFORM_NAME: $PLATFORM_NAME"; exit 1;; +esac + +for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do + VAR=SCRIPT_INPUT_FILE_$n + framework=$(basename "${!VAR}") + export SCRIPT_INPUT_FILE_$n="$SRCROOT"/Carthage/Build/$plat/"$framework".framework +done + +/usr/local/bin/carthage copy-frameworks || exit + +for (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do + VAR=SCRIPT_INPUT_FILE_$n + source=${!VAR}.dSYM + dest=${BUILT_PRODUCTS_DIR}/$(basename "$source") + ditto "$source" "$dest" || exit +done \ No newline at end of file