From c1873efc148f4dad3535c5f78be23e6f70c5cab5 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Fri, 12 Feb 2016 13:00:08 +0100 Subject: [PATCH 01/10] Add support for AppKit --- BothamUI.xcodeproj/project.pbxproj | 273 +++++++++++++++++- .../xcschemes/BothamUICocoa.xcscheme | 99 +++++++ BothamUICocoa/BothamUICocoa.h | 19 ++ BothamUICocoa/Info.plist | 28 ++ BothamUICocoaTests/BothamUICocoaTests.swift | 36 +++ BothamUICocoaTests/Info.plist | 24 ++ Sources/AppKit.swift | 61 ++++ Sources/BothamCollectionViewController.swift | 1 - Sources/BothamCollectionViewDataSource.swift | 1 - Sources/BothamCustomView.swift | 4 + Sources/BothamLoadingView.swift | 2 - Sources/BothamViewController.swift | 37 ++- 12 files changed, 578 insertions(+), 7 deletions(-) create mode 100644 BothamUI.xcodeproj/xcshareddata/xcschemes/BothamUICocoa.xcscheme create mode 100644 BothamUICocoa/BothamUICocoa.h create mode 100644 BothamUICocoa/Info.plist create mode 100644 BothamUICocoaTests/BothamUICocoaTests.swift create mode 100644 BothamUICocoaTests/Info.plist create mode 100644 Sources/AppKit.swift diff --git a/BothamUI.xcodeproj/project.pbxproj b/BothamUI.xcodeproj/project.pbxproj index 264e91b..f72b927 100644 --- a/BothamUI.xcodeproj/project.pbxproj +++ b/BothamUI.xcodeproj/project.pbxproj @@ -11,6 +11,27 @@ 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 */; }; + 6B2902621C6DE3300072E04D /* BothamUICocoaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */; }; + 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E1C1C0398390030EB8B /* NSBundle.swift */; }; + 6B29026C1C6DE36C0072E04D /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D38AE1C4EAC2D00BC2B88 /* UICollectionView.swift */; }; + 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD481C075A2C009247FB /* BothamPullToRefreshPresenter.swift */; }; + 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD4C1C077A0E009247FB /* BothamPullToResfreshUI.swift */; }; + 6B2902721C6DE36C0072E04D /* BothamCustomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E161C0355A40030EB8B /* BothamCustomView.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 */; }; + 6B29027A1C6DE36C0072E04D /* BothamCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E001BFE23B30030EB8B /* BothamCollectionViewController.swift */; }; + 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E241C04BB1F0030EB8B /* BothamLoadingUI.swift */; }; + 6B29027D1C6DE36C0072E04D /* BothamTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2C2D1D1BFBB19B00576464 /* BothamTableViewController.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 +64,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 +88,13 @@ 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; }; + 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BothamUICocoaTests.swift; sourceTree = ""; }; + 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 +132,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 +204,32 @@ name = ViewCell; sourceTree = ""; }; + 6B2902541C6DE3300072E04D /* BothamUICocoa */ = { + isa = PBXGroup; + children = ( + 6B2902551C6DE3300072E04D /* BothamUICocoa.h */, + 6B2902571C6DE3300072E04D /* Info.plist */, + ); + path = BothamUICocoa; + sourceTree = ""; + }; + 6B2902601C6DE3300072E04D /* BothamUICocoaTests */ = { + isa = PBXGroup; + children = ( + 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */, + 6B2902631C6DE3300072E04D /* Info.plist */, + ); + path = BothamUICocoaTests; + sourceTree = ""; + }; + 6B2902851C6DF8E90072E04D /* Cocoa */ = { + isa = PBXGroup; + children = ( + 6B2902861C6DF9050072E04D /* AppKit.swift */, + ); + name = Cocoa; + sourceTree = ""; + }; 6B6CCD261BDD0FFB0015A4D4 = { isa = PBXGroup; children = ( @@ -161,6 +237,8 @@ 6B6CCD331BDD0FFB0015A4D4 /* BothamUI.h */, 6B6CCD351BDD0FFB0015A4D4 /* Info.plist */, EBEC62671BFE3A7300662B5F /* BothamUIUnitTests */, + 6B2902541C6DE3300072E04D /* BothamUICocoa */, + 6B2902601C6DE3300072E04D /* BothamUICocoaTests */, 6B6CCD311BDD0FFB0015A4D4 /* Products */, 2E0AFE0FF3BFFAF7B2BDA789 /* Pods */, 37DABA2E9A8E845F148F0BF2 /* Frameworks */, @@ -172,6 +250,8 @@ children = ( 6B6CCD301BDD0FFB0015A4D4 /* BothamUI.framework */, EBEC62661BFE3A7300662B5F /* BothamUIUnitTests.xctest */, + 6B2902531C6DE3300072E04D /* BothamUICocoa.framework */, + 6B29025C1C6DE3300072E04D /* BothamUICocoaTests.xctest */, ); name = Products; sourceTree = ""; @@ -179,6 +259,7 @@ 6B6CCD321BDD0FFB0015A4D4 /* Sources */ = { isa = PBXGroup; children = ( + 6B2902851C6DF8E90072E04D /* Cocoa */, 6BDE3E1B1C0397FA0030EB8B /* Extensions */, 6B82AD451C075A04009247FB /* ScrollView */, 6BDE3E0A1BFFB2F20030EB8B /* UI */, @@ -313,6 +394,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 +413,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 +494,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 +526,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 +613,39 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 6B29024E1C6DE3300072E04D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */, + 6B29026C1C6DE36C0072E04D /* UICollectionView.swift in Sources */, + 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */, + 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */, + 6B2902721C6DE36C0072E04D /* BothamCustomView.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 */, + 6B29027A1C6DE36C0072E04D /* BothamCollectionViewController.swift in Sources */, + 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */, + 6B29027D1C6DE36C0072E04D /* BothamTableViewController.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 = ( + 6B2902621C6DE3300072E04D /* BothamUICocoaTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6B6CCD2B1BDD0FFB0015A4D4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -512,6 +692,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 +705,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 +929,22 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 6B2902681C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoa" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902641C6DE3300072E04D /* Debug */, + 6B2902651C6DE3300072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 6B2902691C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoaTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902661C6DE3300072E04D /* Debug */, + 6B2902671C6DE3300072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 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/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/BothamUICocoaTests.swift b/BothamUICocoaTests/BothamUICocoaTests.swift new file mode 100644 index 0000000..d2f678a --- /dev/null +++ b/BothamUICocoaTests/BothamUICocoaTests.swift @@ -0,0 +1,36 @@ +// +// BothamUICocoaTests.swift +// BothamUICocoaTests +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 GoKarumi S.L. All rights reserved. +// + +import XCTest +@testable import BothamUICocoa + +class BothamUICocoaTests: 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. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock { + // Put the code you want to measure the time of here. + } + } + +} 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/Sources/AppKit.swift b/Sources/AppKit.swift new file mode 100644 index 0000000..3187bd9 --- /dev/null +++ b/Sources/AppKit.swift @@ -0,0 +1,61 @@ +// +// AppKit.swift +// BothamUI +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 GoKarumi S.L. All rights reserved. +// + +import Foundation + +// MARK: Constant +let UICollectionElementKindSectionHeader = NSCollectionElementKindSectionHeader +let UICollectionElementKindSectionFooter = NSCollectionElementKindSectionFooter + +// MARK: Typealias +public typealias UIViewController = NSViewController +public typealias UITableView = NSTableView +public typealias UIView = NSView +typealias UITableViewDelegate = NSTableViewDelegate +typealias UITableViewDataSource = NSTableViewDataSource +typealias UICollectionViewDataSource = NSCollectionViewDataSource +public typealias UICollectionView = NSCollectionView +public typealias UICollectionViewCell = NSCollectionViewItem +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 UICollectionView { + func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String) { + self.registerNib(nib, forItemWithIdentifier: identifier) + NSCollectionElementKindSectionHeader + } + + func registerNib(nib: UINib?, forSupplementaryViewOfKind kind: String, withReuseIdentifier identifier: String) { + registerNib(nib, forSupplementaryViewOfKind: kind, withIdentifier: identifier) + } +} + +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] } + } +} \ 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/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 From efee38f3e31f51e84d6e23411da0accc3e228a78 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Fri, 12 Feb 2016 13:04:59 +0100 Subject: [PATCH 02/10] Add Cocoa Example --- BothamUI.xcworkspace/contents.xcworkspacedata | 3 + .../ExampleCocoa.xcodeproj/project.pbxproj | 392 ++++++++++ .../xcschemes/ExampleCocoa.xcscheme | 101 +++ ExampleCocoa/ExampleCocoa/AppDelegate.swift | 26 + .../AppIcon.appiconset/Contents.json | 58 ++ .../ExampleCocoa/Base.lproj/Main.storyboard | 681 ++++++++++++++++++ ExampleCocoa/ExampleCocoa/Info.plist | 34 + .../ExampleCocoa/ViewController.swift | 27 + .../ExampleCocoaTests/ExampleCocoaTests.swift | 36 + ExampleCocoa/ExampleCocoaTests/Info.plist | 24 + 10 files changed, 1382 insertions(+) create mode 100644 ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj create mode 100644 ExampleCocoa/ExampleCocoa.xcodeproj/xcshareddata/xcschemes/ExampleCocoa.xcscheme create mode 100644 ExampleCocoa/ExampleCocoa/AppDelegate.swift create mode 100644 ExampleCocoa/ExampleCocoa/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard create mode 100644 ExampleCocoa/ExampleCocoa/Info.plist create mode 100644 ExampleCocoa/ExampleCocoa/ViewController.swift create mode 100644 ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift create mode 100644 ExampleCocoa/ExampleCocoaTests/Info.plist 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/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2647409 --- /dev/null +++ b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj @@ -0,0 +1,392 @@ +// !$*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 */; }; + 6B2902A71C6E015B0072E04D /* ExampleCocoaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */; }; +/* 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; }; + 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleCocoaTests.swift; sourceTree = ""; }; + 6B2902A81C6E015B0072E04D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6B29028E1C6E015B0072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6B29029F1C6E015B0072E04D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6B2902881C6E015B0072E04D = { + isa = PBXGroup; + children = ( + 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 = ( + 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */, + 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 = ( + 6B2902A71C6E015B0072E04D /* ExampleCocoaTests.swift in Sources */, + ); + 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; + }; + 6B2902AE1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoaTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6B2902AF1C6E015B0072E04D /* Debug */, + 6B2902B01C6E015B0072E04D /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* 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..5edc090 --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard @@ -0,0 +1,681 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..7f10b4d --- /dev/null +++ b/ExampleCocoa/ExampleCocoa/ViewController.swift @@ -0,0 +1,27 @@ +// +// ViewController.swift +// ExampleCocoa +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 Karumi. All rights reserved. +// + +import Cocoa + +class ViewController: NSViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + override var representedObject: AnyObject? { + didSet { + // Update the view, if already loaded. + } + } + + +} + diff --git a/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift b/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift new file mode 100644 index 0000000..99d4b9d --- /dev/null +++ b/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift @@ -0,0 +1,36 @@ +// +// ExampleCocoaTests.swift +// ExampleCocoaTests +// +// Created by Davide Mendolia on 12/02/16. +// Copyright © 2016 Karumi. All rights reserved. +// + +import XCTest +@testable import ExampleCocoa + +class ExampleCocoaTests: 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. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock { + // Put the code you want to measure the time of here. + } + } + +} 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 + + From 63d37d6386e474371a7a28ea2a9b0dc767c5a329 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Fri, 12 Feb 2016 13:10:25 +0100 Subject: [PATCH 03/10] Set ViewController as BothamViewController --- ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj | 6 ++++++ ExampleCocoa/ExampleCocoa/ViewController.swift | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj index 2647409..e34d150 100644 --- a/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj +++ b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ 6B2902991C6E015B0072E04D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B2902981C6E015B0072E04D /* Assets.xcassets */; }; 6B29029C1C6E015B0072E04D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B29029A1C6E015B0072E04D /* Main.storyboard */; }; 6B2902A71C6E015B0072E04D /* ExampleCocoaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */; }; + 6B2902B41C6E02310072E04D /* BothamUICocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -34,6 +35,8 @@ 6B2902A21C6E015B0072E04D /* ExampleCocoaTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleCocoaTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleCocoaTests.swift; sourceTree = ""; }; 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 */ @@ -41,6 +44,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6B2902B41C6E02310072E04D /* BothamUICocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -57,6 +61,8 @@ 6B2902881C6E015B0072E04D = { isa = PBXGroup; children = ( + 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */, + 6B2902B11C6E02190072E04D /* BothamUI.framework */, 6B2902931C6E015B0072E04D /* ExampleCocoa */, 6B2902A51C6E015B0072E04D /* ExampleCocoaTests */, 6B2902921C6E015B0072E04D /* Products */, diff --git a/ExampleCocoa/ExampleCocoa/ViewController.swift b/ExampleCocoa/ExampleCocoa/ViewController.swift index 7f10b4d..c5aa0bf 100644 --- a/ExampleCocoa/ExampleCocoa/ViewController.swift +++ b/ExampleCocoa/ExampleCocoa/ViewController.swift @@ -7,13 +7,20 @@ // import Cocoa +import BothamUICocoa -class ViewController: NSViewController { +struct Presenter: BothamPresenter { + func viewDidLoad() { + + } +} + +class ViewController: BothamViewController { override func viewDidLoad() { - super.viewDidLoad() + self.presenter = Presenter() - // Do any additional setup after loading the view. + super.viewDidLoad() } override var representedObject: AnyObject? { From aa8a048a1f58efe8ce39811dc895b9c314495a01 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Fri, 12 Feb 2016 13:31:13 +0100 Subject: [PATCH 04/10] Add tab bar controller --- .../ExampleCocoa/Base.lproj/Main.storyboard | 59 +++++++++++++++---- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard b/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard index 5edc090..876564e 100644 --- a/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard +++ b/ExampleCocoa/ExampleCocoa/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -641,12 +642,12 @@ - + - + @@ -657,25 +658,61 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - + - + From a2890f66c716f332c2e3b77aa793496e37dd0c3a Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Wed, 2 Mar 2016 20:28:03 +0100 Subject: [PATCH 05/10] update travis config --- .travis.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index afb84d5..5350925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,13 @@ language: objective-c -osx_image: xcode7.1 +osx_image: xcode7.2 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 'BothamUIProject' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -c - - set -o pipefail && xcodebuild -workspace BothamUI.xcworkspace -scheme 'Example' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -c + - set -o pipefail && xcodebuild -workspace BothamUI.xcworkspace -scheme 'BothamUIProject' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -f `xcpretty-travis-formatter` + - set -o pipefail && xcodebuild -workspace BothamUI.xcworkspace -scheme 'Example' -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test CODE_SIGN_IDENTITY=- | xcpretty -f `xcpretty-travis-formatter` From 508da4e6a2bc779ed86b26f89c33402f0db8ef7f Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Wed, 2 Mar 2016 21:08:30 +0100 Subject: [PATCH 06/10] Disable swxftlint rule --- Sources/AppKit.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/AppKit.swift b/Sources/AppKit.swift index 3187bd9..fdb3989 100644 --- a/Sources/AppKit.swift +++ b/Sources/AppKit.swift @@ -9,8 +9,10 @@ import Foundation // MARK: Constant +// swiftlint:disable variable_name let UICollectionElementKindSectionHeader = NSCollectionElementKindSectionHeader let UICollectionElementKindSectionFooter = NSCollectionElementKindSectionFooter +// swiftlint:enable variable_name // MARK: Typealias public typealias UIViewController = NSViewController From 037fa239448e2243fce3a5cc0d6e190b2a5540a5 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Wed, 2 Mar 2016 21:10:30 +0100 Subject: [PATCH 07/10] Fix swiftlint warning --- BothamUICocoaTests/BothamUICocoaTests.swift | 10 +++++----- Example/Example/CharacterTableViewCell.swift | 4 ++-- Example/Example/CharactersViewController.swift | 4 ++-- Example/Example/SeriesDetailPresenter.swift | 2 +- Example/Example/SeriesDetailUI.swift | 4 ++-- Example/Example/SeriesDetailViewController.swift | 2 +- Example/Example/SeriesPresenter.swift | 4 ++-- Example/Example/ServiceLocator.swift | 2 +- Example/Example/UIColor.swift | 4 ++-- Example/ExampleAcceptanceTests/KIFTestActor.swift | 4 ++-- Example/ExampleAcceptanceTests/XCTestCase.swift | 4 ++-- Example/ExampleTests/ExampleTests.swift | 4 ++-- Example/ExampleTests/FakeCharactersUI.swift | 2 +- Example/ExampleTests/FakeSeriesUI.swift | 2 +- ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift | 10 +++++----- Sources/AppKit.swift | 2 +- Sources/BothamPullToRefreshHandler.swift | 3 +-- 17 files changed, 33 insertions(+), 34 deletions(-) diff --git a/BothamUICocoaTests/BothamUICocoaTests.swift b/BothamUICocoaTests/BothamUICocoaTests.swift index d2f678a..6bec18d 100644 --- a/BothamUICocoaTests/BothamUICocoaTests.swift +++ b/BothamUICocoaTests/BothamUICocoaTests.swift @@ -10,27 +10,27 @@ import XCTest @testable import BothamUICocoa class BothamUICocoaTests: 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. // Use XCTAssert and related functions to verify your tests produce the correct results. } - + func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } - + } 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/ExampleCocoaTests/ExampleCocoaTests.swift b/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift index 99d4b9d..3978660 100644 --- a/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift +++ b/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift @@ -10,27 +10,27 @@ import XCTest @testable import ExampleCocoa class ExampleCocoaTests: 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. // Use XCTAssert and related functions to verify your tests produce the correct results. } - + func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock { // Put the code you want to measure the time of here. } } - + } diff --git a/Sources/AppKit.swift b/Sources/AppKit.swift index fdb3989..2333d5f 100644 --- a/Sources/AppKit.swift +++ b/Sources/AppKit.swift @@ -56,7 +56,7 @@ extension NSStoryboard { extension NSBundle { public func loadNibNamed(name: String!, owner: AnyObject!, options: [NSObject : AnyObject]!) -> [AnyObject]! { - var topLevelObjects:NSArray? + var topLevelObjects: NSArray? self.loadNibNamed(name, owner: owner, topLevelObjects: &topLevelObjects) return topLevelObjects.map { $0 as [AnyObject] } } diff --git a/Sources/BothamPullToRefreshHandler.swift b/Sources/BothamPullToRefreshHandler.swift index 83711f5..697f979 100644 --- a/Sources/BothamPullToRefreshHandler.swift +++ b/Sources/BothamPullToRefreshHandler.swift @@ -23,8 +23,7 @@ public class BothamPullToRefreshHandler: NSObject { scrollView.alwaysBounceVertical = true } - func refresh(refreshControl: UIRefreshControl) - { + func refresh(refreshControl: UIRefreshControl) { presenter.didStartRefreshing() } From 8742a99c0ba3605c94f642b6034c2ed61e12c7ef Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Thu, 3 Mar 2016 20:43:43 +0100 Subject: [PATCH 08/10] Remove unused files --- BothamUI.xcodeproj/project.pbxproj | 6 ++-- BothamUICocoaTests/BothamUICocoaTests.swift | 36 ------------------- .../ExampleCocoa.xcodeproj/project.pbxproj | 6 ++-- .../ExampleCocoaTests/ExampleCocoaTests.swift | 36 ------------------- 4 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 BothamUICocoaTests/BothamUICocoaTests.swift delete mode 100644 ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift diff --git a/BothamUI.xcodeproj/project.pbxproj b/BothamUI.xcodeproj/project.pbxproj index f72b927..8bae804 100644 --- a/BothamUI.xcodeproj/project.pbxproj +++ b/BothamUI.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ 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 */; }; - 6B2902621C6DE3300072E04D /* BothamUICocoaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */; }; 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E1C1C0398390030EB8B /* NSBundle.swift */; }; 6B29026C1C6DE36C0072E04D /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D38AE1C4EAC2D00BC2B88 /* UICollectionView.swift */; }; 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD481C075A2C009247FB /* BothamPullToRefreshPresenter.swift */; }; @@ -92,7 +91,6 @@ 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; }; - 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BothamUICocoaTests.swift; sourceTree = ""; }; 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 = ""; }; @@ -216,7 +214,6 @@ 6B2902601C6DE3300072E04D /* BothamUICocoaTests */ = { isa = PBXGroup; children = ( - 6B2902611C6DE3300072E04D /* BothamUICocoaTests.swift */, 6B2902631C6DE3300072E04D /* Info.plist */, ); path = BothamUICocoaTests; @@ -642,7 +639,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6B2902621C6DE3300072E04D /* BothamUICocoaTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -936,6 +932,7 @@ 6B2902651C6DE3300072E04D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 6B2902691C6DE3300072E04D /* Build configuration list for PBXNativeTarget "BothamUICocoaTests" */ = { isa = XCConfigurationList; @@ -944,6 +941,7 @@ 6B2902671C6DE3300072E04D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 6B6CCD2A1BDD0FFB0015A4D4 /* Build configuration list for PBXProject "BothamUI" */ = { isa = XCConfigurationList; diff --git a/BothamUICocoaTests/BothamUICocoaTests.swift b/BothamUICocoaTests/BothamUICocoaTests.swift deleted file mode 100644 index 6bec18d..0000000 --- a/BothamUICocoaTests/BothamUICocoaTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// BothamUICocoaTests.swift -// BothamUICocoaTests -// -// Created by Davide Mendolia on 12/02/16. -// Copyright © 2016 GoKarumi S.L. All rights reserved. -// - -import XCTest -@testable import BothamUICocoa - -class BothamUICocoaTests: 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. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. - } - } - -} diff --git a/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj index e34d150..9504960 100644 --- a/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj +++ b/ExampleCocoa/ExampleCocoa.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 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 */; }; - 6B2902A71C6E015B0072E04D /* ExampleCocoaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */; }; 6B2902B41C6E02310072E04D /* BothamUICocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B2902B31C6E02310072E04D /* BothamUICocoa.framework */; }; /* End PBXBuildFile section */ @@ -33,7 +32,6 @@ 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; }; - 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleCocoaTests.swift; sourceTree = ""; }; 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 = ""; }; @@ -93,7 +91,6 @@ 6B2902A51C6E015B0072E04D /* ExampleCocoaTests */ = { isa = PBXGroup; children = ( - 6B2902A61C6E015B0072E04D /* ExampleCocoaTests.swift */, 6B2902A81C6E015B0072E04D /* Info.plist */, ); path = ExampleCocoaTests; @@ -208,7 +205,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6B2902A71C6E015B0072E04D /* ExampleCocoaTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -383,6 +379,7 @@ 6B2902AD1C6E015B0072E04D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 6B2902AE1C6E015B0072E04D /* Build configuration list for PBXNativeTarget "ExampleCocoaTests" */ = { isa = XCConfigurationList; @@ -391,6 +388,7 @@ 6B2902B01C6E015B0072E04D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift b/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift deleted file mode 100644 index 3978660..0000000 --- a/ExampleCocoa/ExampleCocoaTests/ExampleCocoaTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ExampleCocoaTests.swift -// ExampleCocoaTests -// -// Created by Davide Mendolia on 12/02/16. -// Copyright © 2016 Karumi. All rights reserved. -// - -import XCTest -@testable import ExampleCocoa - -class ExampleCocoaTests: 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. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. - } - } - -} From f7c8656b9bb1688fa52bbb51fb7cc900778e5720 Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Thu, 3 Mar 2016 20:56:36 +0100 Subject: [PATCH 09/10] Remove unused methods --- BothamUI.xcodeproj/project.pbxproj | 8 -------- Sources/AppKit.swift | 25 ------------------------- Sources/NSBundle.swift | 11 +++++++---- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/BothamUI.xcodeproj/project.pbxproj b/BothamUI.xcodeproj/project.pbxproj index 8bae804..abc5390 100644 --- a/BothamUI.xcodeproj/project.pbxproj +++ b/BothamUI.xcodeproj/project.pbxproj @@ -14,17 +14,13 @@ 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 */; }; - 6B29026C1C6DE36C0072E04D /* UICollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2D38AE1C4EAC2D00BC2B88 /* UICollectionView.swift */; }; 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD481C075A2C009247FB /* BothamPullToRefreshPresenter.swift */; }; 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B82AD4C1C077A0E009247FB /* BothamPullToResfreshUI.swift */; }; - 6B2902721C6DE36C0072E04D /* BothamCustomView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E161C0355A40030EB8B /* BothamCustomView.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 */; }; - 6B29027A1C6DE36C0072E04D /* BothamCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E001BFE23B30030EB8B /* BothamCollectionViewController.swift */; }; 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BDE3E241C04BB1F0030EB8B /* BothamLoadingUI.swift */; }; - 6B29027D1C6DE36C0072E04D /* BothamTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B2C2D1D1BFBB19B00576464 /* BothamTableViewController.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 */; }; @@ -615,18 +611,14 @@ buildActionMask = 2147483647; files = ( 6B29026A1C6DE36C0072E04D /* NSBundle.swift in Sources */, - 6B29026C1C6DE36C0072E04D /* UICollectionView.swift in Sources */, 6B29026E1C6DE36C0072E04D /* BothamPullToRefreshPresenter.swift in Sources */, 6B29026F1C6DE36C0072E04D /* BothamPullToResfreshUI.swift in Sources */, - 6B2902721C6DE36C0072E04D /* BothamCustomView.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 */, - 6B29027A1C6DE36C0072E04D /* BothamCollectionViewController.swift in Sources */, 6B29027B1C6DE36C0072E04D /* BothamLoadingUI.swift in Sources */, - 6B29027D1C6DE36C0072E04D /* BothamTableViewController.swift in Sources */, 6B29027E1C6DE36C0072E04D /* BothamUI.swift in Sources */, 6B29027F1C6DE36C0072E04D /* BothamViewController.swift in Sources */, 6B2902811C6DE36C0072E04D /* BothamStoryboard.swift in Sources */, diff --git a/Sources/AppKit.swift b/Sources/AppKit.swift index 2333d5f..f52f20f 100644 --- a/Sources/AppKit.swift +++ b/Sources/AppKit.swift @@ -8,21 +8,7 @@ import Foundation -// MARK: Constant -// swiftlint:disable variable_name -let UICollectionElementKindSectionHeader = NSCollectionElementKindSectionHeader -let UICollectionElementKindSectionFooter = NSCollectionElementKindSectionFooter -// swiftlint:enable variable_name - // MARK: Typealias -public typealias UIViewController = NSViewController -public typealias UITableView = NSTableView -public typealias UIView = NSView -typealias UITableViewDelegate = NSTableViewDelegate -typealias UITableViewDataSource = NSTableViewDataSource -typealias UICollectionViewDataSource = NSCollectionViewDataSource -public typealias UICollectionView = NSCollectionView -public typealias UICollectionViewCell = NSCollectionViewItem typealias UINib = NSNib typealias UIStoryboard = NSStoryboard @@ -33,17 +19,6 @@ extension UINib { } } -extension UICollectionView { - func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String) { - self.registerNib(nib, forItemWithIdentifier: identifier) - NSCollectionElementKindSectionHeader - } - - func registerNib(nib: UINib?, forSupplementaryViewOfKind kind: String, withReuseIdentifier identifier: String) { - registerNib(nib, forSupplementaryViewOfKind: kind, withIdentifier: identifier) - } -} - extension NSStoryboard { func instantiateInitialViewController() -> AnyObject? { return instantiateInitialController() 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 From 4a036c54756a62d16f933c41a2c6d385224eb7db Mon Sep 17 00:00:00 2001 From: Davide Mendolia Date: Fri, 11 Mar 2016 16:42:30 +0100 Subject: [PATCH 10/10] Add if OSX on AppKit code --- Sources/AppKit.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/AppKit.swift b/Sources/AppKit.swift index f52f20f..fe5cc02 100644 --- a/Sources/AppKit.swift +++ b/Sources/AppKit.swift @@ -8,6 +8,8 @@ import Foundation +#if os(OSX) + // MARK: Typealias typealias UINib = NSNib typealias UIStoryboard = NSStoryboard @@ -35,4 +37,6 @@ extension NSBundle { self.loadNibNamed(name, owner: owner, topLevelObjects: &topLevelObjects) return topLevelObjects.map { $0 as [AnyObject] } } -} \ No newline at end of file +} + +#endif \ No newline at end of file