diff --git a/.travis.yml b/.travis.yml index 3c98947..f2afbd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode7.1 +osx_image: xcode7.2 env: - SCHEME="BothamUIProject" @@ -9,10 +9,8 @@ before_install: - brew install swiftlint - gem install xcpretty - gem install cocoapods - -install: - - pod install + - gem install xcpretty-travis-formatter script: - swiftlint - - set -o pipefail && xcodebuild -workspace BothamUI.xcworkspace -scheme "$SCHEME" -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -c + - set -o pipefail && xcodebuild -workspace BothamUI.xcworkspace -scheme "$SCHEME" -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -f `xcpretty-travis-formatter` diff --git a/BothamUI.xcodeproj/project.pbxproj b/BothamUI.xcodeproj/project.pbxproj index 264e91b..abc5390 100644 --- a/BothamUI.xcodeproj/project.pbxproj +++ b/BothamUI.xcodeproj/project.pbxproj @@ -11,6 +11,22 @@ 6B0736FD1BFDCB83000E0E7D /* BothamTableViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B0736FC1BFDCB83000E0E7D /* BothamTableViewDataSource.swift */; }; 6B0737001BFDCBF3000E0E7D /* BothamViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B0736FF1BFDCBF3000E0E7D /* BothamViewCell.swift */; }; 6B1BACCE1BDD27E100AC5E9B /* BothamUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B1BACCD1BDD27E100AC5E9B /* BothamUI.swift */; }; + 6B2902561C6DE3300072E04D /* BothamUICocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B2902551C6DE3300072E04D /* BothamUICocoa.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6B29025D1C6DE3300072E04D /* BothamUICocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B2902531C6DE3300072E04D /* BothamUICocoa.framework */; }; + 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E1C1C0398390030EB8B /* NSBundle.swift */; }; + 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD481C075A2C009247FB /* BothamPullToRefreshPresenter.swift */; }; + 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD4C1C077A0E009247FB /* BothamPullToResfreshUI.swift */; }; + 6B2902731C6DE36C0072E04D /* BothamViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B0736FF1BFDCBF3000E0E7D /* BothamViewCell.swift */; }; + 6B2902771C6DE36C0072E04D /* BothamViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B8E73271C101D240006F9E1 /* BothamViewDataSource.swift */; }; + 6B2902781C6DE36C0072E04D /* BothamPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B6CCD521BDD12C40015A4D4 /* BothamPresenter.swift */; }; + 6B2902791C6DE36C0072E04D /* BothamNavigationPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B8E732B1C101DBA0006F9E1 /* BothamNavigationPresenter.swift */; }; + 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E241C04BB1F0030EB8B /* BothamLoadingUI.swift */; }; + 6B29027E1C6DE36C0072E04D /* BothamUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B1BACCD1BDD27E100AC5E9B /* BothamUI.swift */; }; + 6B29027F1C6DE36C0072E04D /* BothamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B6CCD501BDD11810015A4D4 /* BothamViewController.swift */; }; + 6B2902811C6DE36C0072E04D /* BothamStoryboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B8E73301C101FA90006F9E1 /* BothamStoryboard.swift */; }; + 6B2902831C6DE36C0072E04D /* BothamUI.h in Sources */ = {isa = PBXBuildFile; fileRef = 6B6CCD331BDD0FFB0015A4D4 /* BothamUI.h */; }; + 6B2902841C6DE36C0072E04D /* Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 6B6CCD351BDD0FFB0015A4D4 /* Info.plist */; }; + 6B2902871C6DF9050072E04D /* AppKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902861C6DF9050072E04D /* AppKit.swift */; }; 6B2C2D1E1BFBB19B00576464 /* BothamTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2C2D1D1BFBB19B00576464 /* BothamTableViewController.swift */; }; 6B2D38AF1C4EAC2D00BC2B88 /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D38AE1C4EAC2D00BC2B88 /* UICollectionView.swift */; }; 6B6CCD341BDD0FFB0015A4D4 /* BothamUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B6CCD331BDD0FFB0015A4D4 /* BothamUI.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -43,6 +59,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 6B29025E1C6DE3300072E04D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6B6CCD271BDD0FFB0015A4D4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6B2902521C6DE3300072E04D; + remoteInfo = BothamUICocoa; + }; EBEC626C1BFE3A7300662B5F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 6B6CCD271BDD0FFB0015A4D4 /* Project object */; @@ -60,6 +83,12 @@ 6B0736FC1BFDCB83000E0E7D /* BothamTableViewDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BothamTableViewDataSource.swift; sourceTree = ""; }; 6B0736FF1BFDCBF3000E0E7D /* BothamViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BothamViewCell.swift; sourceTree = ""; }; 6B1BACCD1BDD27E100AC5E9B /* BothamUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BothamUI.swift; sourceTree = ""; }; + 6B2902531C6DE3300072E04D /* BothamUICocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BothamUICocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B2902551C6DE3300072E04D /* BothamUICocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BothamUICocoa.h; sourceTree = ""; }; + 6B2902571C6DE3300072E04D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B29025C1C6DE3300072E04D /* BothamUICocoaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BothamUICocoaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B2902631C6DE3300072E04D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B2902861C6DF9050072E04D /* AppKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppKit.swift; sourceTree = ""; }; 6B2C2D1D1BFBB19B00576464 /* BothamTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BothamTableViewController.swift; sourceTree = ""; }; 6B2D38AE1C4EAC2D00BC2B88 /* UICollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UICollectionView.swift; sourceTree = ""; }; 6B6CCD301BDD0FFB0015A4D4 /* BothamUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BothamUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -97,6 +126,21 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 6B29024F1C6DE3300072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B2902591C6DE3300072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B29025D1C6DE3300072E04D /* BothamUICocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6B6CCD2C1BDD0FFB0015A4D4 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -154,6 +198,31 @@ name = ViewCell; sourceTree = ""; }; + 6B2902541C6DE3300072E04D /* BothamUICocoa */ = { + isa = PBXGroup; + children = ( + 6B2902551C6DE3300072E04D /* BothamUICocoa.h */, + 6B2902571C6DE3300072E04D /* Info.plist */, + ); + path = BothamUICocoa; + sourceTree = ""; + }; + 6B2902601C6DE3300072E04D /* BothamUICocoaTests */ = { + isa = PBXGroup; + children = ( + 6B2902631C6DE3300072E04D /* Info.plist */, + ); + path = BothamUICocoaTests; + sourceTree = ""; + }; + 6B2902851C6DF8E90072E04D /* Cocoa */ = { + isa = PBXGroup; + children = ( + 6B2902861C6DF9050072E04D /* AppKit.swift */, + ); + name = Cocoa; + sourceTree = ""; + }; 6B6CCD261BDD0FFB0015A4D4 = { isa = PBXGroup; children = ( @@ -161,6 +230,8 @@ 6B6CCD331BDD0FFB0015A4D4 /* BothamUI.h */, 6B6CCD351BDD0FFB0015A4D4 /* Info.plist */, EBEC62671BFE3A7300662B5F /* BothamUIUnitTests */, + 6B2902541C6DE3300072E04D /* BothamUICocoa */, + 6B2902601C6DE3300072E04D /* BothamUICocoaTests */, 6B6CCD311BDD0FFB0015A4D4 /* Products */, 2E0AFE0FF3BFFAF7B2BDA789 /* Pods */, 37DABA2E9A8E845F148F0BF2 /* Frameworks */, @@ -172,6 +243,8 @@ children = ( 6B6CCD301BDD0FFB0015A4D4 /* BothamUI.framework */, EBEC62661BFE3A7300662B5F /* BothamUIUnitTests.xctest */, + 6B2902531C6DE3300072E04D /* BothamUICocoa.framework */, + 6B29025C1C6DE3300072E04D /* BothamUICocoaTests.xctest */, ); name = Products; sourceTree = ""; @@ -179,6 +252,7 @@ 6B6CCD321BDD0FFB0015A4D4 /* Sources */ = { isa = PBXGroup; children = ( + 6B2902851C6DF8E90072E04D /* Cocoa */, 6BDE3E1B1C0397FA0030EB8B /* Extensions */, 6B82AD451C075A04009247FB /* ScrollView */, 6BDE3E0A1BFFB2F20030EB8B /* UI */, @@ -313,6 +387,14 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 6B2902501C6DE3300072E04D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B2902561C6DE3300072E04D /* BothamUICocoa.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6B6CCD2D1BDD0FFB0015A4D4 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -324,6 +406,42 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 6B2902521C6DE3300072E04D /* BothamUICocoa */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B2902681C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoa" */; + buildPhases = ( + 6B29024E1C6DE3300072E04D /* Sources */, + 6B29024F1C6DE3300072E04D /* Frameworks */, + 6B2902501C6DE3300072E04D /* Headers */, + 6B2902511C6DE3300072E04D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = BothamUICocoa; + productName = BothamUICocoa; + productReference = 6B2902531C6DE3300072E04D /* BothamUICocoa.framework */; + productType = "com.apple.product-type.framework"; + }; + 6B29025B1C6DE3300072E04D /* BothamUICocoaTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B2902691C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoaTests" */; + buildPhases = ( + 6B2902581C6DE3300072E04D /* Sources */, + 6B2902591C6DE3300072E04D /* Frameworks */, + 6B29025A1C6DE3300072E04D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6B29025F1C6DE3300072E04D /* PBXTargetDependency */, + ); + name = BothamUICocoaTests; + productName = BothamUICocoaTests; + productReference = 6B29025C1C6DE3300072E04D /* BothamUICocoaTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 6B6CCD2F1BDD0FFB0015A4D4 /* BothamUI */ = { isa = PBXNativeTarget; buildConfigurationList = 6B6CCD441BDD0FFB0015A4D4 /* Build configuration list for PBXNativeTarget "BothamUI" */; @@ -369,10 +487,16 @@ 6B6CCD271BDD0FFB0015A4D4 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0710; + LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0700; ORGANIZATIONNAME = "GoKarumi S.L."; TargetAttributes = { + 6B2902521C6DE3300072E04D = { + CreatedOnToolsVersion = 7.2.1; + }; + 6B29025B1C6DE3300072E04D = { + CreatedOnToolsVersion = 7.2.1; + }; 6B6CCD2F1BDD0FFB0015A4D4 = { CreatedOnToolsVersion = 7.0.1; }; @@ -395,11 +519,27 @@ targets = ( 6B6CCD2F1BDD0FFB0015A4D4 /* BothamUI */, EBEC62651BFE3A7300662B5F /* BothamUIUnitTests */, + 6B2902521C6DE3300072E04D /* BothamUICocoa */, + 6B29025B1C6DE3300072E04D /* BothamUICocoaTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 6B2902511C6DE3300072E04D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B29025A1C6DE3300072E04D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6B6CCD2E1BDD0FFB0015A4D4 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -466,6 +606,34 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 6B29024E1C6DE3300072E04D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */, + 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */, + 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */, + 6B2902731C6DE36C0072E04D /* BothamViewCell.swift in Sources */, + 6B2902871C6DF9050072E04D /* AppKit.swift in Sources */, + 6B2902771C6DE36C0072E04D /* BothamViewDataSource.swift in Sources */, + 6B2902781C6DE36C0072E04D /* BothamPresenter.swift in Sources */, + 6B2902791C6DE36C0072E04D /* BothamNavigationPresenter.swift in Sources */, + 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */, + 6B29027E1C6DE36C0072E04D /* BothamUI.swift in Sources */, + 6B29027F1C6DE36C0072E04D /* BothamViewController.swift in Sources */, + 6B2902811C6DE36C0072E04D /* BothamStoryboard.swift in Sources */, + 6B2902831C6DE36C0072E04D /* BothamUI.h in Sources */, + 6B2902841C6DE36C0072E04D /* Info.plist in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B2902581C6DE3300072E04D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6B6CCD2B1BDD0FFB0015A4D4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -512,6 +680,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 6B29025F1C6DE3300072E04D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6B2902521C6DE3300072E04D /* BothamUICocoa */; + targetProxy = 6B29025E1C6DE3300072E04D /* PBXContainerItemProxy */; + }; EBEC626D1BFE3A7300662B5F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 6B6CCD2F1BDD0FFB0015A4D4 /* BothamUI */; @@ -520,6 +693,76 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 6B2902641C6DE3300072E04D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = BothamUICocoa/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.BothamUICocoa; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 6B2902651C6DE3300072E04D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = BothamUICocoa/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.BothamUICocoa; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 6B2902661C6DE3300072E04D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = BothamUICocoaTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.BothamUICocoaTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + 6B2902671C6DE3300072E04D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = BothamUICocoaTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.BothamUICocoaTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; 6B6CCD421BDD0FFB0015A4D4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -674,6 +917,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 6B2902681C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoa" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902641C6DE3300072E04D /* Debug */, + 6B2902651C6DE3300072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6B2902691C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoaTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902661C6DE3300072E04D /* Debug */, + 6B2902671C6DE3300072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 6B6CCD2A1BDD0FFB0015A4D4 /* Build configuration list for PBXProject "BothamUI" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/BothamUI.xcodeproj/xcshareddata/xcschemes/BothamUICocoa.xcscheme b/BothamUI.xcodeproj/xcshareddata/xcschemes/BothamUICocoa.xcscheme new file mode 100644 index 0000000..fdf0253 --- /dev/null +++ b/BothamUI.xcodeproj/xcshareddata/xcschemes/BothamUICocoa.xcscheme @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BothamUI.xcworkspace/contents.xcworkspacedata b/BothamUI.xcworkspace/contents.xcworkspacedata index 2087266..3bf8ca6 100644 --- a/BothamUI.xcworkspace/contents.xcworkspacedata +++ b/BothamUI.xcworkspace/contents.xcworkspacedata @@ -7,6 +7,9 @@ + + diff --git a/BothamUICocoa/BothamUICocoa.h b/BothamUICocoa/BothamUICocoa.h new file mode 100644 index 0000000..6ee0b9c --- /dev/null +++ b/BothamUICocoa/BothamUICocoa.h @@ -0,0 +1,19 @@ +// +// BothamUICocoa.h +// BothamUICocoa +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 GoKarumi S.L. All rights reserved. +// + +#import + +//! Project version number for BothamUICocoa. +FOUNDATION_EXPORT double BothamUICocoaVersionNumber; + +//! Project version string for BothamUICocoa. +FOUNDATION_EXPORT const unsigned char BothamUICocoaVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/BothamUICocoa/Info.plist b/BothamUICocoa/Info.plist new file mode 100644 index 0000000..3f20ffc --- /dev/null +++ b/BothamUICocoa/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2016 GoKarumi S.L. All rights reserved. + NSPrincipalClass + + + diff --git a/BothamUICocoaTests/Info.plist b/BothamUICocoaTests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/BothamUICocoaTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Example/Example/CharacterTableViewCell.swift b/Example/Example/CharacterTableViewCell.swift index 31d455a..ca8c729 100644 --- a/Example/Example/CharacterTableViewCell.swift +++ b/Example/Example/CharacterTableViewCell.swift @@ -29,8 +29,8 @@ class CharacterTableViewCell: UITableViewCell, BothamViewCell { let gradient: CAGradientLayer = CAGradientLayer(layer: thumbnailImage.layer) gradient.frame = thumbnailImage.bounds gradient.colors = [UIColor.gradientStartColor.CGColor, UIColor.gradientEndColor.CGColor] - gradient.startPoint = CGPointMake(0.0, 0.6) - gradient.endPoint = CGPointMake(0.0, 1.0) + gradient.startPoint = CGPoint(x: 0.0, y: 0.6) + gradient.endPoint = CGPoint(x: 0.0, y: 1.0) thumbnailImage.layer.insertSublayer(gradient, atIndex: 0) } diff --git a/Example/Example/CharactersViewController.swift b/Example/Example/CharactersViewController.swift index 3f124d7..09492da 100644 --- a/Example/Example/CharactersViewController.swift +++ b/Example/Example/CharactersViewController.swift @@ -11,7 +11,7 @@ import UIKit import BothamUI class CharactersViewController: ExampleViewController, BothamTableViewController, CharactersUI { - + @IBOutlet var tableView: UITableView! var dataSource: BothamTableViewDataSource! var delegate: UITableViewDelegate! @@ -24,4 +24,4 @@ class CharactersViewController: ExampleViewController, BothamTableViewController pullToRefreshHandler.addTo(tableView) super.viewDidLoad() } -} \ No newline at end of file +} diff --git a/Example/Example/SeriesDetailPresenter.swift b/Example/Example/SeriesDetailPresenter.swift index 6470992..a228d5e 100644 --- a/Example/Example/SeriesDetailPresenter.swift +++ b/Example/Example/SeriesDetailPresenter.swift @@ -9,7 +9,7 @@ import Foundation import BothamUI -class SeriesDetailPresenter : BothamPresenter { +class SeriesDetailPresenter: BothamPresenter { private let seriesName: String private weak var ui: SeriesDetailUI? diff --git a/Example/Example/SeriesDetailUI.swift b/Example/Example/SeriesDetailUI.swift index bae07b6..8afce21 100644 --- a/Example/Example/SeriesDetailUI.swift +++ b/Example/Example/SeriesDetailUI.swift @@ -12,8 +12,8 @@ import BothamUI protocol SeriesDetailUI: BothamUI, BothamLoadingUI { var title: String? { get set } - + func configureHeader(series: Series) func showItems(items: [Comic]) -} \ No newline at end of file +} diff --git a/Example/Example/SeriesDetailViewController.swift b/Example/Example/SeriesDetailViewController.swift index b47d601..60c9014 100644 --- a/Example/Example/SeriesDetailViewController.swift +++ b/Example/Example/SeriesDetailViewController.swift @@ -16,7 +16,7 @@ private struct Config { static let footerHeight = 20 static let cellMargin = 20 } -class SeriesDetailViewController : ExampleViewController, BothamCollectionViewController, SeriesDetailUI { +class SeriesDetailViewController: ExampleViewController, BothamCollectionViewController, SeriesDetailUI { var dataSource: SeriesDetailCollectionViewDataSource! diff --git a/Example/Example/SeriesPresenter.swift b/Example/Example/SeriesPresenter.swift index 15825a8..c865fdf 100644 --- a/Example/Example/SeriesPresenter.swift +++ b/Example/Example/SeriesPresenter.swift @@ -10,7 +10,7 @@ import Foundation import BothamUI class SeriesPresenter: BothamPresenter, BothamNavigationPresenter { - + private weak var ui: SeriesUI? private let wireframe: SeriesWireframe @@ -49,4 +49,4 @@ class SeriesPresenter: BothamPresenter, BothamNavigationPresenter { func itemWasTapped(item: Series) { wireframe.presentSeriesDetailViewController(item.name) } -} \ No newline at end of file +} diff --git a/Example/Example/ServiceLocator.swift b/Example/Example/ServiceLocator.swift index d3a089a..45f6269 100644 --- a/Example/Example/ServiceLocator.swift +++ b/Example/Example/ServiceLocator.swift @@ -83,6 +83,6 @@ class ServiceLocator { } func provideSeriesDetailPresenter(ui: SeriesDetailUI, seriesName: String) -> SeriesDetailPresenter { - return SeriesDetailPresenter(ui: ui,seriesName: seriesName) + return SeriesDetailPresenter(ui: ui, seriesName: seriesName) } } \ No newline at end of file diff --git a/Example/Example/UIColor.swift b/Example/Example/UIColor.swift index 3fce6ad..5036f89 100644 --- a/Example/Example/UIColor.swift +++ b/Example/Example/UIColor.swift @@ -12,9 +12,9 @@ import UIKit extension UIColor { convenience init(rgba: String) { - var red: CGFloat = 0.0 + var red: CGFloat = 0.0 var green: CGFloat = 0.0 - var blue: CGFloat = 0.0 + var blue: CGFloat = 0.0 var alpha: CGFloat = 1.0 if rgba.hasPrefix("#") { diff --git a/Example/ExampleAcceptanceTests/KIFTestActor.swift b/Example/ExampleAcceptanceTests/KIFTestActor.swift index e8dca88..cbc502d 100644 --- a/Example/ExampleAcceptanceTests/KIFTestActor.swift +++ b/Example/ExampleAcceptanceTests/KIFTestActor.swift @@ -10,11 +10,11 @@ import Foundation import KIF extension KIFTestActor { - func tester(file : String = __FILE__, line : Int = __LINE__) -> KIFUITestActor { + func tester(file: String = __FILE__, line: Int = __LINE__) -> KIFUITestActor { return KIFUITestActor(inFile: file, atLine: line, delegate: self) } - func system(file : String = __FILE__, line : Int = __LINE__) -> KIFSystemTestActor { + func system(file: String = __FILE__, line: Int = __LINE__) -> KIFSystemTestActor { return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) } } \ No newline at end of file diff --git a/Example/ExampleAcceptanceTests/XCTestCase.swift b/Example/ExampleAcceptanceTests/XCTestCase.swift index a250924..ba7e444 100644 --- a/Example/ExampleAcceptanceTests/XCTestCase.swift +++ b/Example/ExampleAcceptanceTests/XCTestCase.swift @@ -10,11 +10,11 @@ import Foundation import KIF extension XCTestCase { - func tester(file : String = __FILE__, line : Int = __LINE__) -> KIFUITestActor { + func tester(file: String = __FILE__, line: Int = __LINE__) -> KIFUITestActor { return KIFUITestActor(inFile: file, atLine: line, delegate: self) } - func system(file : String = __FILE__, line : Int = __LINE__) -> KIFSystemTestActor { + func system(file: String = __FILE__, line: Int = __LINE__) -> KIFSystemTestActor { return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) } } \ No newline at end of file diff --git a/Example/ExampleTests/ExampleTests.swift b/Example/ExampleTests/ExampleTests.swift index 4fc8f70..18e9128 100644 --- a/Example/ExampleTests/ExampleTests.swift +++ b/Example/ExampleTests/ExampleTests.swift @@ -12,7 +12,7 @@ import BothamUI @testable import Example class ExampleTests: XCTestCase { - + func testShowListOfSeries() { let expectation = expectationWithDescription("Covers will be shown") let fakeSeriesUI = FakeSeriesUI(expectation: expectation) @@ -46,4 +46,4 @@ class ExampleTests: XCTestCase { expect(fakeSeriesWireframe.seriesDetailViewControllerWasPresented).to(beTrue()) } -} \ No newline at end of file +} diff --git a/Example/ExampleTests/FakeCharactersUI.swift b/Example/ExampleTests/FakeCharactersUI.swift index 9d69111..c223c08 100644 --- a/Example/ExampleTests/FakeCharactersUI.swift +++ b/Example/ExampleTests/FakeCharactersUI.swift @@ -11,7 +11,7 @@ import Foundation import BothamUI class FakeCharactersUI: CharactersUI, FakeBothamPullToResfreshUI { - var itemsShowed:[Example.Character] = [] + var itemsShowed: [Example.Character] = [] var didRefresh = false func showItems(items: [Example.Character]) { diff --git a/Example/ExampleTests/FakeSeriesUI.swift b/Example/ExampleTests/FakeSeriesUI.swift index 1f89533..95e9b0e 100644 --- a/Example/ExampleTests/FakeSeriesUI.swift +++ b/Example/ExampleTests/FakeSeriesUI.swift @@ -13,7 +13,7 @@ import XCTest class FakeSeriesUI: SeriesUI, FakeBothamLoadingUI { var loaderWasShowed = false var loaderWasHided = false - var itemsShowed:[Series] = [] + var itemsShowed: [Series] = [] var expectation: XCTestExpectation? diff --git a/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9504960 --- /dev/null +++ b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj @@ -0,0 +1,396 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6B2902951C6E015B0072E04D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902941C6E015B0072E04D /* AppDelegate.swift */; }; + 6B2902971C6E015B0072E04D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902961C6E015B0072E04D /* ViewController.swift */; }; + 6B2902991C6E015B0072E04D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B2902981C6E015B0072E04D /* Assets.xcassets */; }; + 6B29029C1C6E015B0072E04D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B29029A1C6E015B0072E04D /* Main.storyboard */; }; + 6B2902B41C6E02310072E04D /* BothamUICocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6B2902A31C6E015B0072E04D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6B2902891C6E015B0072E04D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6B2902901C6E015B0072E04D; + remoteInfo = ExampleCocoa; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6B2902911C6E015B0072E04D /* ExampleCocoa.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleCocoa.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B2902941C6E015B0072E04D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6B2902961C6E015B0072E04D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6B2902981C6E015B0072E04D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6B29029B1C6E015B0072E04D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6B29029D1C6E015B0072E04D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B2902A21C6E015B0072E04D /* ExampleCocoaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleCocoaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6B2902A81C6E015B0072E04D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6B2902B11C6E02190072E04D /* BothamUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BothamUI.framework; path = "../build/Debug-iphoneos/BothamUI.framework"; sourceTree = ""; }; + 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = BothamUICocoa.framework; path = ../build/Debug/BothamUICocoa.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6B29028E1C6E015B0072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B2902B41C6E02310072E04D /* BothamUICocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B29029F1C6E015B0072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6B2902881C6E015B0072E04D = { + isa = PBXGroup; + children = ( + 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */, + 6B2902B11C6E02190072E04D /* BothamUI.framework */, + 6B2902931C6E015B0072E04D /* ExampleCocoa */, + 6B2902A51C6E015B0072E04D /* ExampleCocoaTests */, + 6B2902921C6E015B0072E04D /* Products */, + ); + sourceTree = ""; + }; + 6B2902921C6E015B0072E04D /* Products */ = { + isa = PBXGroup; + children = ( + 6B2902911C6E015B0072E04D /* ExampleCocoa.app */, + 6B2902A21C6E015B0072E04D /* ExampleCocoaTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6B2902931C6E015B0072E04D /* ExampleCocoa */ = { + isa = PBXGroup; + children = ( + 6B2902941C6E015B0072E04D /* AppDelegate.swift */, + 6B2902961C6E015B0072E04D /* ViewController.swift */, + 6B2902981C6E015B0072E04D /* Assets.xcassets */, + 6B29029A1C6E015B0072E04D /* Main.storyboard */, + 6B29029D1C6E015B0072E04D /* Info.plist */, + ); + path = ExampleCocoa; + sourceTree = ""; + }; + 6B2902A51C6E015B0072E04D /* ExampleCocoaTests */ = { + isa = PBXGroup; + children = ( + 6B2902A81C6E015B0072E04D /* Info.plist */, + ); + path = ExampleCocoaTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6B2902901C6E015B0072E04D /* ExampleCocoa */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B2902AB1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoa" */; + buildPhases = ( + 6B29028D1C6E015B0072E04D /* Sources */, + 6B29028E1C6E015B0072E04D /* Frameworks */, + 6B29028F1C6E015B0072E04D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ExampleCocoa; + productName = ExampleCocoa; + productReference = 6B2902911C6E015B0072E04D /* ExampleCocoa.app */; + productType = "com.apple.product-type.application"; + }; + 6B2902A11C6E015B0072E04D /* ExampleCocoaTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6B2902AE1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoaTests" */; + buildPhases = ( + 6B29029E1C6E015B0072E04D /* Sources */, + 6B29029F1C6E015B0072E04D /* Frameworks */, + 6B2902A01C6E015B0072E04D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6B2902A41C6E015B0072E04D /* PBXTargetDependency */, + ); + name = ExampleCocoaTests; + productName = ExampleCocoaTests; + productReference = 6B2902A21C6E015B0072E04D /* ExampleCocoaTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6B2902891C6E015B0072E04D /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = Karumi; + TargetAttributes = { + 6B2902901C6E015B0072E04D = { + CreatedOnToolsVersion = 7.2.1; + }; + 6B2902A11C6E015B0072E04D = { + CreatedOnToolsVersion = 7.2.1; + TestTargetID = 6B2902901C6E015B0072E04D; + }; + }; + }; + buildConfigurationList = 6B29028C1C6E015B0072E04D /* Build configuration list for PBXProject "ExampleCocoa" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6B2902881C6E015B0072E04D; + productRefGroup = 6B2902921C6E015B0072E04D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6B2902901C6E015B0072E04D /* ExampleCocoa */, + 6B2902A11C6E015B0072E04D /* ExampleCocoaTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6B29028F1C6E015B0072E04D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B2902991C6E015B0072E04D /* Assets.xcassets in Resources */, + 6B29029C1C6E015B0072E04D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B2902A01C6E015B0072E04D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6B29028D1C6E015B0072E04D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B2902971C6E015B0072E04D /* ViewController.swift in Sources */, + 6B2902951C6E015B0072E04D /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B29029E1C6E015B0072E04D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6B2902A41C6E015B0072E04D /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6B2902901C6E015B0072E04D /* ExampleCocoa */; + targetProxy = 6B2902A31C6E015B0072E04D /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6B29029A1C6E015B0072E04D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6B29029B1C6E015B0072E04D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6B2902A91C6E015B0072E04D /* 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_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 6B2902AA1C6E015B0072E04D /* 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_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + }; + name = Release; + }; + 6B2902AC1C6E015B0072E04D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = ExampleCocoa/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.ExampleCocoa; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6B2902AD1C6E015B0072E04D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = ExampleCocoa/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.ExampleCocoa; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6B2902AF1C6E015B0072E04D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = ExampleCocoaTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.ExampleCocoaTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleCocoa.app/Contents/MacOS/ExampleCocoa"; + }; + name = Debug; + }; + 6B2902B01C6E015B0072E04D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = ExampleCocoaTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.karumi.ExampleCocoaTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleCocoa.app/Contents/MacOS/ExampleCocoa"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6B29028C1C6E015B0072E04D /* Build configuration list for PBXProject "ExampleCocoa" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902A91C6E015B0072E04D /* Debug */, + 6B2902AA1C6E015B0072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6B2902AB1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoa" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902AC1C6E015B0072E04D /* Debug */, + 6B2902AD1C6E015B0072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6B2902AE1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoaTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902AF1C6E015B0072E04D /* Debug */, + 6B2902B01C6E015B0072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6B2902891C6E015B0072E04D /* Project object */; +} diff --git a/ExampleCocoa/ExampleCocoa.xcodeproj/xcshareddata/xcschemes/ExampleCocoa.xcscheme b/ExampleCocoa/ExampleCocoa.xcodeproj/xcshareddata/xcschemes/ExampleCocoa.xcscheme new file mode 100644 index 0000000..d6ad602 --- /dev/null +++ b/ExampleCocoa/ExampleCocoa.xcodeproj/xcshareddata/xcschemes/ExampleCocoa.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExampleCocoa/ExampleCocoa/AppDelegate.swift b/ExampleCocoa/ExampleCocoa/AppDelegate.swift new file mode 100644 index 0000000..acc6b17 --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/AppDelegate.swift @@ -0,0 +1,26 @@ +// +// AppDelegate.swift +// ExampleCocoa +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 Karumi. All rights reserved. +// + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + + + func applicationDidFinishLaunching(aNotification: NSNotification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(aNotification: NSNotification) { + // Insert code here to tear down your application + } + + +} + diff --git a/ExampleCocoa/ExampleCocoa/Assets.xcassets/AppIcon.appiconset/Contents.json b/ExampleCocoa/ExampleCocoa/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard b/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard new file mode 100644 index 0000000..876564e --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard @@ -0,0 +1,718 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExampleCocoa/ExampleCocoa/Info.plist b/ExampleCocoa/ExampleCocoa/Info.plist new file mode 100644 index 0000000..e9037ff --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2016 Karumi. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/ExampleCocoa/ExampleCocoa/ViewController.swift b/ExampleCocoa/ExampleCocoa/ViewController.swift new file mode 100644 index 0000000..c5aa0bf --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/ViewController.swift @@ -0,0 +1,34 @@ +// +// ViewController.swift +// ExampleCocoa +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 Karumi. All rights reserved. +// + +import Cocoa +import BothamUICocoa + +struct Presenter: BothamPresenter { + func viewDidLoad() { + + } +} + +class ViewController: BothamViewController { + + override func viewDidLoad() { + self.presenter = Presenter() + + super.viewDidLoad() + } + + override var representedObject: AnyObject? { + didSet { + // Update the view, if already loaded. + } + } + + +} + diff --git a/ExampleCocoa/ExampleCocoaTests/Info.plist b/ExampleCocoa/ExampleCocoaTests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/ExampleCocoa/ExampleCocoaTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Sources/AppKit.swift b/Sources/AppKit.swift new file mode 100644 index 0000000..fe5cc02 --- /dev/null +++ b/Sources/AppKit.swift @@ -0,0 +1,42 @@ +// +// AppKit.swift +// BothamUI +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 GoKarumi S.L. All rights reserved. +// + +import Foundation + +#if os(OSX) + +// MARK: Typealias +typealias UINib = NSNib +typealias UIStoryboard = NSStoryboard + +// MARK: Extension +extension UINib { + convenience init?(nibName name: String, bundle bundleOrNil: NSBundle?) { + self.init(nibNamed: name, bundle: bundleOrNil) + } +} + +extension NSStoryboard { + func instantiateInitialViewController() -> AnyObject? { + return instantiateInitialController() + } + + func instantiateViewControllerWithIdentifier(identifier: String) -> AnyObject { + return instantiateControllerWithIdentifier(identifier) + } +} + +extension NSBundle { + public func loadNibNamed(name: String!, owner: AnyObject!, options: [NSObject : AnyObject]!) -> [AnyObject]! { + var topLevelObjects: NSArray? + self.loadNibNamed(name, owner: owner, topLevelObjects: &topLevelObjects) + return topLevelObjects.map { $0 as [AnyObject] } + } +} + +#endif \ No newline at end of file diff --git a/Sources/BothamCollectionViewController.swift b/Sources/BothamCollectionViewController.swift index 0625440..9a0eb60 100644 --- a/Sources/BothamCollectionViewController.swift +++ b/Sources/BothamCollectionViewController.swift @@ -7,7 +7,6 @@ // import Foundation -import UIKit public protocol BothamCollectionViewController: class { var collectionView: UICollectionView! { get } diff --git a/Sources/BothamCollectionViewDataSource.swift b/Sources/BothamCollectionViewDataSource.swift index 1b25495..b1cbe07 100644 --- a/Sources/BothamCollectionViewDataSource.swift +++ b/Sources/BothamCollectionViewDataSource.swift @@ -7,7 +7,6 @@ // import Foundation -import UIKit public class BothamCollectionViewDataSource : NSObject, UICollectionViewDataSource, BothamViewDataSource { diff --git a/Sources/BothamCustomView.swift b/Sources/BothamCustomView.swift index d0d7314..286351e 100644 --- a/Sources/BothamCustomView.swift +++ b/Sources/BothamCustomView.swift @@ -24,7 +24,11 @@ public class BothamCustomView: UIView { private func xibSetup() { view = loadViewFromNib() view.frame = bounds +#if os(iOS) || os(watchOS) || os(tvOS) view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] +#elseif os(OSX) + view.autoresizingMask = [NSAutoresizingMaskOptions.ViewWidthSizable, NSAutoresizingMaskOptions.ViewHeightSizable] +#endif addSubview(view) } diff --git a/Sources/BothamLoadingView.swift b/Sources/BothamLoadingView.swift index 58329bc..40f77bc 100644 --- a/Sources/BothamLoadingView.swift +++ b/Sources/BothamLoadingView.swift @@ -7,8 +7,6 @@ // import Foundation -import UIKit - @IBDesignable public class BothamLoadingView: BothamCustomView { diff --git a/Sources/BothamPullToRefreshHandler.swift b/Sources/BothamPullToRefreshHandler.swift index 99ea3c8..56f77da 100644 --- a/Sources/BothamPullToRefreshHandler.swift +++ b/Sources/BothamPullToRefreshHandler.swift @@ -28,8 +28,7 @@ public class BothamPullToRefreshHandler: NSObject { refreshControl.removeFromSuperview() } - func refresh(refreshControl: UIRefreshControl) - { + func refresh(refreshControl: UIRefreshControl) { presenter.didStartRefreshing() } diff --git a/Sources/BothamViewController.swift b/Sources/BothamViewController.swift index 7ac5041..fed4e2d 100644 --- a/Sources/BothamViewController.swift +++ b/Sources/BothamViewController.swift @@ -7,7 +7,8 @@ // import Foundation -import UIKit +#if os(iOS) || os(watchOS) || os(tvOS) + import UIKit public class BothamViewController: UIViewController, BothamUI { public var presenter: BothamPresenter! = nil @@ -36,4 +37,36 @@ public class BothamViewController: UIViewController, BothamUI { super.viewDidDisappear(animated) presenter.viewDidDisappear() } -} \ No newline at end of file +} +#elseif os(OSX) + import AppKit + + public class BothamViewController: NSViewController, BothamUI { + public var presenter: BothamPresenter! = nil + + public override func viewDidLoad() { + super.viewDidLoad() + presenter.viewDidLoad() + } + + public override func viewWillAppear() { + super.viewWillAppear() + presenter.viewWillAppear() + } + + public override func viewDidAppear() { + super.viewDidAppear() + presenter.viewDidAppear() + } + + public override func viewWillDisappear() { + super.viewWillDisappear() + presenter.viewWillDisappear() + } + + public override func viewDidDisappear() { + super.viewDidDisappear() + presenter.viewDidDisappear() + } + } +#endif \ No newline at end of file diff --git a/Sources/NSBundle.swift b/Sources/NSBundle.swift index c713065..e10fef0 100644 --- a/Sources/NSBundle.swift +++ b/Sources/NSBundle.swift @@ -9,11 +9,14 @@ import Foundation extension NSBundle { - public func loadNib(name name: String, owner: AnyObject?) -> T { +#if os(iOS) || os(watchOS) || os(tvOS) + + public func loadNib(name name: String, owner: AnyObject? = nil) -> T { return self.loadNibNamed(name, owner: owner, options: nil)[0] as! T } - - public func loadNib(name name: String) -> T { - return self.loadNibNamed(name, owner: nil, options: nil)[0] as! T +#elseif os(OSX) + public func loadNib(name name: String, owner: AnyObject? = nil) -> T { + return self.loadNibNamed(name, owner: owner, options: nil)[0] as! T } +#endif } \ No newline at end of file