From f56bbebbcb1125eee6ef75fccbdac91d7e70010f Mon Sep 17 00:00:00 2001 From: Andrew Breckenridge Date: Mon, 13 Jun 2016 18:04:27 -0700 Subject: [PATCH 1/4] remove sharedInstance & make all functions static --- .../project.pbxproj | 2 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++ Source/LocalNotificationHelper.swift | 39 +++++++------------ 3 files changed, 22 insertions(+), 27 deletions(-) create mode 100644 LocalNotificationHelper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/LocalNotificationHelper.xcodeproj/project.pbxproj b/LocalNotificationHelper.xcodeproj/project.pbxproj index 1180bbe..e20323d 100644 --- a/LocalNotificationHelper.xcodeproj/project.pbxproj +++ b/LocalNotificationHelper.xcodeproj/project.pbxproj @@ -417,7 +417,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 89QENA8827; INFOPLIST_FILE = LocalNotificationHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelper; @@ -430,7 +429,6 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 89QENA8827; INFOPLIST_FILE = LocalNotificationHelper/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelper; diff --git a/LocalNotificationHelper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/LocalNotificationHelper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/LocalNotificationHelper.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Source/LocalNotificationHelper.swift b/Source/LocalNotificationHelper.swift index 75a4bcf..c0f9b82 100644 --- a/Source/LocalNotificationHelper.swift +++ b/Source/LocalNotificationHelper.swift @@ -15,53 +15,44 @@ import AVKit class LocalNotificationHelper: NSObject { - let LOCAL_NOTIFICATION_CATEGORY : String = "LocalNotificationCategory" - - // MARK: - Shared Instance - - class func sharedInstance() -> LocalNotificationHelper { - struct Singleton { - static var sharedInstance = LocalNotificationHelper() - } - return Singleton.sharedInstance - } + static let LOCAL_NOTIFICATION_CATEGORY : String = "LocalNotificationCategory" // MARK: - Schedule Notification - func scheduleNotificationWithKey(key: String, title: String, message: String, seconds: Double, userInfo: [NSObject: AnyObject]?) { + static func scheduleNotificationWithKey(key: String, title: String, message: String, seconds: Double, userInfo: [NSObject: AnyObject]?) { let date = NSDate(timeIntervalSinceNow: TimeInterval(seconds)) let notification = notificationWithTitle(key: key, title: title, message: message, date: date, userInfo: userInfo, soundName: nil, hasAction: true) notification.category = LOCAL_NOTIFICATION_CATEGORY UIApplication.shared.scheduleLocalNotification(notification) } - func scheduleNotificationWithKey(key: String, title: String, message: String, date: NSDate, userInfo: [NSObject: AnyObject]?){ + static func scheduleNotificationWithKey(key: String, title: String, message: String, date: NSDate, userInfo: [NSObject: AnyObject]?){ let notification = notificationWithTitle(key: key, title: title, message: message, date: date, userInfo: ["key" as NSObject: key as AnyObject], soundName: nil, hasAction: true) notification.category = LOCAL_NOTIFICATION_CATEGORY UIApplication.shared.scheduleLocalNotification(notification) } - func scheduleNotificationWithKey(key: String, title: String, message: String, seconds: Double, soundName: String, userInfo: [NSObject: AnyObject]?){ + static func scheduleNotificationWithKey(key: String, title: String, message: String, seconds: Double, soundName: String, userInfo: [NSObject: AnyObject]?){ let date = NSDate(timeIntervalSinceNow: TimeInterval(seconds)) let notification = notificationWithTitle(key: key, title: title, message: message, date: date, userInfo: ["key" as NSObject: key as AnyObject], soundName: soundName, hasAction: true) UIApplication.shared.scheduleLocalNotification(notification) } - func scheduleNotificationWithKey(key: String, title: String, message: String, date: NSDate, soundName: String, userInfo: [NSObject: AnyObject]?){ + static func scheduleNotificationWithKey(key: String, title: String, message: String, date: NSDate, soundName: String, userInfo: [NSObject: AnyObject]?){ let notification = notificationWithTitle(key: key, title: title, message: message, date: date, userInfo: ["key" as NSObject: key as AnyObject], soundName: soundName, hasAction: true) UIApplication.shared.scheduleLocalNotification(notification) } // MARK: - Present Notification - func presentNotificationWithKey(key: String, title: String, message: String, soundName: String, userInfo: [NSObject: AnyObject]?) { + static func presentNotificationWithKey(key: String, title: String, message: String, soundName: String, userInfo: [NSObject: AnyObject]?) { let notification = notificationWithTitle(key: key, title: title, message: message, date: nil, userInfo: ["key" as NSObject: key as AnyObject], soundName: nil, hasAction: true) UIApplication.shared.presentLocalNotificationNow(notification) } // MARK: - Create Notification - func notificationWithTitle(key : String, title: String, message: String, date: NSDate?, userInfo: [NSObject: AnyObject]?, soundName: String?, hasAction: Bool) -> UILocalNotification { + static func notificationWithTitle(key : String, title: String, message: String, date: NSDate?, userInfo: [NSObject: AnyObject]?, soundName: String?, hasAction: Bool) -> UILocalNotification { var dct : Dictionary! @@ -84,7 +75,7 @@ class LocalNotificationHelper: NSObject { return notification } - func getNotificationWithKey(key : String) -> UILocalNotification { + static func getNotificationWithKey(key : String) -> UILocalNotification { var notif : UILocalNotification? @@ -96,7 +87,7 @@ class LocalNotificationHelper: NSObject { return notif! } - func cancelNotification(key : String){ + static func cancelNotification(key : String){ for notification in UIApplication.shared.scheduledLocalNotifications! where notification.userInfo!["key"] as! String == key{ UIApplication.shared.cancelLocalNotification(notification) @@ -104,16 +95,15 @@ class LocalNotificationHelper: NSObject { } } - func getAllNotifications() -> [UILocalNotification]? { + static func getAllNotifications() -> [UILocalNotification]? { return UIApplication.shared.scheduledLocalNotifications } - func cancelAllNotifications() { + static func cancelAllNotifications() { UIApplication.shared.cancelAllLocalNotifications() } - func registerUserNotificationWithActionButtons(actions : [UIUserNotificationAction]){ - + static func registerUserNotificationWithActionButtons(actions : [UIUserNotificationAction]){ let category = UIMutableUserNotificationCategory() category.identifier = LOCAL_NOTIFICATION_CATEGORY @@ -123,14 +113,13 @@ class LocalNotificationHelper: NSObject { UIApplication.shared.registerUserNotificationSettings(settings) } - func registerUserNotification(){ + static func registerUserNotification(){ let settings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) UIApplication.shared.registerUserNotificationSettings(settings) } - func createUserNotificationActionButton(identifier : String, title : String) -> UIUserNotificationAction{ - + static func createUserNotificationActionButton(identifier : String, title : String) -> UIUserNotificationAction{ let actionButton = UIMutableUserNotificationAction() actionButton.identifier = identifier actionButton.title = title From 39a9516ae72f475f1e8c71b64e1cdeb9501095c5 Mon Sep 17 00:00:00 2001 From: Andrew Breckenridge Date: Mon, 13 Jun 2016 18:05:09 -0700 Subject: [PATCH 2/4] remove all sharedInstance references from demo app --- LocalNotificationHelper/AppDelegate.swift | 6 +++--- LocalNotificationHelper/ViewController.swift | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LocalNotificationHelper/AppDelegate.swift b/LocalNotificationHelper/AppDelegate.swift index 8256419..4968f50 100644 --- a/LocalNotificationHelper/AppDelegate.swift +++ b/LocalNotificationHelper/AppDelegate.swift @@ -21,12 +21,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Override point for customization after application launch. - let actionOne = LocalNotificationHelper.sharedInstance().createUserNotificationActionButton(identifier: ACTION_ONE_IDENTIFIER, title: "Like") - let actionTwo = LocalNotificationHelper.sharedInstance().createUserNotificationActionButton(identifier: ACTION_TWO_IDENTIFIER, title: "Dislike") + let actionOne = LocalNotificationHelper.createUserNotificationActionButton(identifier: ACTION_ONE_IDENTIFIER, title: "Like") + let actionTwo = LocalNotificationHelper.createUserNotificationActionButton(identifier: ACTION_TWO_IDENTIFIER, title: "Dislike") let actions = [actionOne,actionTwo] - LocalNotificationHelper.sharedInstance().registerUserNotificationWithActionButtons(actions: actions) + LocalNotificationHelper.registerUserNotificationWithActionButtons(actions: actions) return true } diff --git a/LocalNotificationHelper/ViewController.swift b/LocalNotificationHelper/ViewController.swift index d7ff9c8..81ade06 100644 --- a/LocalNotificationHelper/ViewController.swift +++ b/LocalNotificationHelper/ViewController.swift @@ -28,9 +28,9 @@ class ViewController: UIViewController { } @IBAction func sendNotificationTapped(sender: AnyObject) { - + let userInfo = ["url" : "www.mobiwise.co"] - LocalNotificationHelper.sharedInstance().scheduleNotificationWithKey(key: "mobiwise", title: "mobiwise", message: "Lets take a break", seconds: 5, userInfo: userInfo as [NSObject : AnyObject]?) + LocalNotificationHelper.scheduleNotificationWithKey(key: "mobiwise", title: "mobiwise", message: "Lets take a break", seconds: 5, userInfo: userInfo as [NSObject : AnyObject]?) } From f51d24101352294d80c44a45f469e958826f7558 Mon Sep 17 00:00:00 2001 From: Andrew Breckenridge Date: Mon, 13 Jun 2016 18:07:01 -0700 Subject: [PATCH 3/4] remove useless test targets --- .../project.pbxproj | 232 +----------------- LocalNotificationHelperTests/Info.plist | 24 -- .../LocalNotificationHelperTests.swift | 36 --- LocalNotificationHelperUITests/Info.plist | 24 -- .../LocalNotificationHelperUITests.swift | 36 --- 5 files changed, 8 insertions(+), 344 deletions(-) delete mode 100644 LocalNotificationHelperTests/Info.plist delete mode 100644 LocalNotificationHelperTests/LocalNotificationHelperTests.swift delete mode 100644 LocalNotificationHelperUITests/Info.plist delete mode 100644 LocalNotificationHelperUITests/LocalNotificationHelperUITests.swift diff --git a/LocalNotificationHelper.xcodeproj/project.pbxproj b/LocalNotificationHelper.xcodeproj/project.pbxproj index e20323d..8a54448 100644 --- a/LocalNotificationHelper.xcodeproj/project.pbxproj +++ b/LocalNotificationHelper.xcodeproj/project.pbxproj @@ -12,42 +12,17 @@ 59A39E891BD2CF2F00157004 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59A39E871BD2CF2F00157004 /* Main.storyboard */; }; 59A39E8B1BD2CF2F00157004 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 59A39E8A1BD2CF2F00157004 /* Assets.xcassets */; }; 59A39E8E1BD2CF2F00157004 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59A39E8C1BD2CF2F00157004 /* LaunchScreen.storyboard */; }; - 59A39E991BD2CF2F00157004 /* LocalNotificationHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39E981BD2CF2F00157004 /* LocalNotificationHelperTests.swift */; }; - 59A39EA41BD2CF2F00157004 /* LocalNotificationHelperUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39EA31BD2CF2F00157004 /* LocalNotificationHelperUITests.swift */; }; 59A39EB31BD2CFA600157004 /* LocalNotificationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39EB21BD2CFA600157004 /* LocalNotificationHelper.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 59A39E951BD2CF2F00157004 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 59A39E781BD2CF2E00157004 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 59A39E7F1BD2CF2F00157004; - remoteInfo = LocalNotificationHelper; - }; - 59A39EA01BD2CF2F00157004 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 59A39E781BD2CF2E00157004 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 59A39E7F1BD2CF2F00157004; - remoteInfo = LocalNotificationHelper; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ - 59A39E801BD2CF2F00157004 /* LocalNotificationHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LocalNotificationHelper.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 59A39E801BD2CF2F00157004 /* LocalNotificationHelperDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LocalNotificationHelperDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 59A39E831BD2CF2F00157004 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59A39E851BD2CF2F00157004 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 59A39E881BD2CF2F00157004 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 59A39E8A1BD2CF2F00157004 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 59A39E8D1BD2CF2F00157004 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59A39E8F1BD2CF2F00157004 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 59A39E941BD2CF2F00157004 /* LocalNotificationHelperTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LocalNotificationHelperTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 59A39E981BD2CF2F00157004 /* LocalNotificationHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationHelperTests.swift; sourceTree = ""; }; - 59A39E9A1BD2CF2F00157004 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 59A39E9F1BD2CF2F00157004 /* LocalNotificationHelperUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LocalNotificationHelperUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 59A39EA31BD2CF2F00157004 /* LocalNotificationHelperUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalNotificationHelperUITests.swift; sourceTree = ""; }; - 59A39EA51BD2CF2F00157004 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59A39EB21BD2CFA600157004 /* LocalNotificationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocalNotificationHelper.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -59,20 +34,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 59A39E911BD2CF2F00157004 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 59A39E9C1BD2CF2F00157004 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -80,8 +41,6 @@ isa = PBXGroup; children = ( 59A39E821BD2CF2F00157004 /* LocalNotificationHelper */, - 59A39E971BD2CF2F00157004 /* LocalNotificationHelperTests */, - 59A39EA21BD2CF2F00157004 /* LocalNotificationHelperUITests */, 59A39E811BD2CF2F00157004 /* Products */, ); sourceTree = ""; @@ -89,9 +48,7 @@ 59A39E811BD2CF2F00157004 /* Products */ = { isa = PBXGroup; children = ( - 59A39E801BD2CF2F00157004 /* LocalNotificationHelper.app */, - 59A39E941BD2CF2F00157004 /* LocalNotificationHelperTests.xctest */, - 59A39E9F1BD2CF2F00157004 /* LocalNotificationHelperUITests.xctest */, + 59A39E801BD2CF2F00157004 /* LocalNotificationHelperDemo.app */, ); name = Products; sourceTree = ""; @@ -110,24 +67,6 @@ path = LocalNotificationHelper; sourceTree = ""; }; - 59A39E971BD2CF2F00157004 /* LocalNotificationHelperTests */ = { - isa = PBXGroup; - children = ( - 59A39E981BD2CF2F00157004 /* LocalNotificationHelperTests.swift */, - 59A39E9A1BD2CF2F00157004 /* Info.plist */, - ); - path = LocalNotificationHelperTests; - sourceTree = ""; - }; - 59A39EA21BD2CF2F00157004 /* LocalNotificationHelperUITests */ = { - isa = PBXGroup; - children = ( - 59A39EA31BD2CF2F00157004 /* LocalNotificationHelperUITests.swift */, - 59A39EA51BD2CF2F00157004 /* Info.plist */, - ); - path = LocalNotificationHelperUITests; - sourceTree = ""; - }; 59A39EB11BD2CF6000157004 /* Source */ = { isa = PBXGroup; children = ( @@ -140,9 +79,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelper */ = { + 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelperDemo */ = { isa = PBXNativeTarget; - buildConfigurationList = 59A39EA81BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelper" */; + buildConfigurationList = 59A39EA81BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperDemo" */; buildPhases = ( 59A39E7C1BD2CF2F00157004 /* Sources */, 59A39E7D1BD2CF2F00157004 /* Frameworks */, @@ -152,47 +91,11 @@ ); dependencies = ( ); - name = LocalNotificationHelper; + name = LocalNotificationHelperDemo; productName = LocalNotificationHelper; - productReference = 59A39E801BD2CF2F00157004 /* LocalNotificationHelper.app */; + productReference = 59A39E801BD2CF2F00157004 /* LocalNotificationHelperDemo.app */; productType = "com.apple.product-type.application"; }; - 59A39E931BD2CF2F00157004 /* LocalNotificationHelperTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 59A39EAB1BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperTests" */; - buildPhases = ( - 59A39E901BD2CF2F00157004 /* Sources */, - 59A39E911BD2CF2F00157004 /* Frameworks */, - 59A39E921BD2CF2F00157004 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 59A39E961BD2CF2F00157004 /* PBXTargetDependency */, - ); - name = LocalNotificationHelperTests; - productName = LocalNotificationHelperTests; - productReference = 59A39E941BD2CF2F00157004 /* LocalNotificationHelperTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 59A39E9E1BD2CF2F00157004 /* LocalNotificationHelperUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 59A39EAE1BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperUITests" */; - buildPhases = ( - 59A39E9B1BD2CF2F00157004 /* Sources */, - 59A39E9C1BD2CF2F00157004 /* Frameworks */, - 59A39E9D1BD2CF2F00157004 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 59A39EA11BD2CF2F00157004 /* PBXTargetDependency */, - ); - name = LocalNotificationHelperUITests; - productName = LocalNotificationHelperUITests; - productReference = 59A39E9F1BD2CF2F00157004 /* LocalNotificationHelperUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -234,9 +137,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelper */, - 59A39E931BD2CF2F00157004 /* LocalNotificationHelperTests */, - 59A39E9E1BD2CF2F00157004 /* LocalNotificationHelperUITests */, + 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelperDemo */, ); }; /* End PBXProject section */ @@ -252,20 +153,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 59A39E921BD2CF2F00157004 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 59A39E9D1BD2CF2F00157004 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -279,37 +166,8 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 59A39E901BD2CF2F00157004 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 59A39E991BD2CF2F00157004 /* LocalNotificationHelperTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 59A39E9B1BD2CF2F00157004 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 59A39EA41BD2CF2F00157004 /* LocalNotificationHelperUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 59A39E961BD2CF2F00157004 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelper */; - targetProxy = 59A39E951BD2CF2F00157004 /* PBXContainerItemProxy */; - }; - 59A39EA11BD2CF2F00157004 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelper */; - targetProxy = 59A39EA01BD2CF2F00157004 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 59A39E871BD2CF2F00157004 /* Main.storyboard */ = { isa = PBXVariantGroup; @@ -437,62 +295,6 @@ }; name = Release; }; - 59A39EAC1BD2CF2F00157004 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 89QENA8827; - INFOPLIST_FILE = LocalNotificationHelperTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelperTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LocalNotificationHelper.app/LocalNotificationHelper"; - }; - name = Debug; - }; - 59A39EAD1BD2CF2F00157004 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 89QENA8827; - INFOPLIST_FILE = LocalNotificationHelperTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelperTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LocalNotificationHelper.app/LocalNotificationHelper"; - }; - name = Release; - }; - 59A39EAF1BD2CF2F00157004 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEVELOPMENT_TEAM = 89QENA8827; - INFOPLIST_FILE = LocalNotificationHelperUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelperUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_TARGET_NAME = LocalNotificationHelper; - USES_XCTRUNNER = YES; - }; - name = Debug; - }; - 59A39EB01BD2CF2F00157004 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEVELOPMENT_TEAM = 89QENA8827; - INFOPLIST_FILE = LocalNotificationHelperUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = co.mobiwise.LocalNotificationHelperUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_TARGET_NAME = LocalNotificationHelper; - USES_XCTRUNNER = YES; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -505,7 +307,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 59A39EA81BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelper" */ = { + 59A39EA81BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 59A39EA91BD2CF2F00157004 /* Debug */, @@ -514,24 +316,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 59A39EAB1BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 59A39EAC1BD2CF2F00157004 /* Debug */, - 59A39EAD1BD2CF2F00157004 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 59A39EAE1BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 59A39EAF1BD2CF2F00157004 /* Debug */, - 59A39EB01BD2CF2F00157004 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 59A39E781BD2CF2E00157004 /* Project object */; diff --git a/LocalNotificationHelperTests/Info.plist b/LocalNotificationHelperTests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/LocalNotificationHelperTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 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/LocalNotificationHelperTests/LocalNotificationHelperTests.swift b/LocalNotificationHelperTests/LocalNotificationHelperTests.swift deleted file mode 100644 index b7a04e2..0000000 --- a/LocalNotificationHelperTests/LocalNotificationHelperTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// LocalNotificationHelperTests.swift -// LocalNotificationHelperTests -// -// Created by Ahmet Keskin on 17/10/15. -// Copyright © 2015 Ahmet Keskin. All rights reserved. -// - -import XCTest -@testable import LocalNotificationHelper - -class LocalNotificationHelperTests: 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/LocalNotificationHelperUITests/Info.plist b/LocalNotificationHelperUITests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/LocalNotificationHelperUITests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - 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/LocalNotificationHelperUITests/LocalNotificationHelperUITests.swift b/LocalNotificationHelperUITests/LocalNotificationHelperUITests.swift deleted file mode 100644 index 6c8c2d3..0000000 --- a/LocalNotificationHelperUITests/LocalNotificationHelperUITests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// LocalNotificationHelperUITests.swift -// LocalNotificationHelperUITests -// -// Created by Ahmet Keskin on 17/10/15. -// Copyright © 2015 Ahmet Keskin. All rights reserved. -// - -import XCTest - -class LocalNotificationHelperUITests: XCTestCase { - - override func setUp() { - super.setUp() - - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. - XCUIApplication().launch() - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - 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() { - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - -} From d3c0706b4b0c686fe896628a727e66db9821ec94 Mon Sep 17 00:00:00 2001 From: Andrew Breckenridge Date: Mon, 13 Jun 2016 18:08:26 -0700 Subject: [PATCH 4/4] create shared scheme for carthage --- .../project.pbxproj | 121 ++++++++++++++++++ .../LocalNotificationHelper.xcscheme | 80 ++++++++++++ LocalNotificationHelper/Info.plist | 29 +---- .../LocalNotificationHelper.h | 19 +++ 4 files changed, 224 insertions(+), 25 deletions(-) create mode 100644 LocalNotificationHelper.xcodeproj/xcshareddata/xcschemes/LocalNotificationHelper.xcscheme create mode 100644 LocalNotificationHelper/LocalNotificationHelper.h diff --git a/LocalNotificationHelper.xcodeproj/project.pbxproj b/LocalNotificationHelper.xcodeproj/project.pbxproj index 8a54448..9be94a6 100644 --- a/LocalNotificationHelper.xcodeproj/project.pbxproj +++ b/LocalNotificationHelper.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 466ECD8B1D0F904C00C828A0 /* LocalNotificationHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 466ECD8A1D0F904C00C828A0 /* LocalNotificationHelper.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 466ECD901D0F905000C828A0 /* LocalNotificationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39EB21BD2CFA600157004 /* LocalNotificationHelper.swift */; }; 59A39E841BD2CF2F00157004 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39E831BD2CF2F00157004 /* AppDelegate.swift */; }; 59A39E861BD2CF2F00157004 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A39E851BD2CF2F00157004 /* ViewController.swift */; }; 59A39E891BD2CF2F00157004 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 59A39E871BD2CF2F00157004 /* Main.storyboard */; }; @@ -16,6 +18,9 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 466ECD881D0F904C00C828A0 /* LocalNotificationHelper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LocalNotificationHelper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 466ECD8A1D0F904C00C828A0 /* LocalNotificationHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalNotificationHelper.h; sourceTree = ""; }; + 466ECD8C1D0F904C00C828A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 59A39E801BD2CF2F00157004 /* LocalNotificationHelperDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LocalNotificationHelperDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 59A39E831BD2CF2F00157004 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59A39E851BD2CF2F00157004 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -27,6 +32,13 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 466ECD841D0F904C00C828A0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 59A39E7D1BD2CF2F00157004 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -37,10 +49,20 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 466ECD891D0F904C00C828A0 /* LocalNotificationHelper */ = { + isa = PBXGroup; + children = ( + 466ECD8A1D0F904C00C828A0 /* LocalNotificationHelper.h */, + 466ECD8C1D0F904C00C828A0 /* Info.plist */, + ); + path = LocalNotificationHelper; + sourceTree = ""; + }; 59A39E771BD2CF2E00157004 = { isa = PBXGroup; children = ( 59A39E821BD2CF2F00157004 /* LocalNotificationHelper */, + 466ECD891D0F904C00C828A0 /* LocalNotificationHelper */, 59A39E811BD2CF2F00157004 /* Products */, ); sourceTree = ""; @@ -49,6 +71,7 @@ isa = PBXGroup; children = ( 59A39E801BD2CF2F00157004 /* LocalNotificationHelperDemo.app */, + 466ECD881D0F904C00C828A0 /* LocalNotificationHelper.framework */, ); name = Products; sourceTree = ""; @@ -78,7 +101,36 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 466ECD851D0F904C00C828A0 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 466ECD8B1D0F904C00C828A0 /* LocalNotificationHelper.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ + 466ECD871D0F904C00C828A0 /* LocalNotificationHelper */ = { + isa = PBXNativeTarget; + buildConfigurationList = 466ECD8D1D0F904C00C828A0 /* Build configuration list for PBXNativeTarget "LocalNotificationHelper" */; + buildPhases = ( + 466ECD831D0F904C00C828A0 /* Sources */, + 466ECD841D0F904C00C828A0 /* Frameworks */, + 466ECD851D0F904C00C828A0 /* Headers */, + 466ECD861D0F904C00C828A0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LocalNotificationHelper; + productName = LocalNotificationHelper; + productReference = 466ECD881D0F904C00C828A0 /* LocalNotificationHelper.framework */; + productType = "com.apple.product-type.framework"; + }; 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelperDemo */ = { isa = PBXNativeTarget; buildConfigurationList = 59A39EA81BD2CF2F00157004 /* Build configuration list for PBXNativeTarget "LocalNotificationHelperDemo" */; @@ -105,6 +157,9 @@ LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Ahmet Keskin"; TargetAttributes = { + 466ECD871D0F904C00C828A0 = { + CreatedOnToolsVersion = 7.3.1; + }; 59A39E7F1BD2CF2F00157004 = { CreatedOnToolsVersion = 7.0.1; DevelopmentTeam = 89QENA8827; @@ -138,11 +193,19 @@ projectRoot = ""; targets = ( 59A39E7F1BD2CF2F00157004 /* LocalNotificationHelperDemo */, + 466ECD871D0F904C00C828A0 /* LocalNotificationHelper */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 466ECD861D0F904C00C828A0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 59A39E7E1BD2CF2F00157004 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -156,6 +219,14 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 466ECD831D0F904C00C828A0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 466ECD901D0F905000C828A0 /* LocalNotificationHelper.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 59A39E7C1BD2CF2F00157004 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -188,6 +259,48 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 466ECD8E1D0F904C00C828A0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = LocalNotificationHelper/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = AhmettKeskin.LocalNotificationHelper; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 466ECD8F1D0F904C00C828A0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = LocalNotificationHelper/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = AhmettKeskin.LocalNotificationHelper; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; 59A39EA61BD2CF2F00157004 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -298,6 +411,14 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 466ECD8D1D0F904C00C828A0 /* Build configuration list for PBXNativeTarget "LocalNotificationHelper" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 466ECD8E1D0F904C00C828A0 /* Debug */, + 466ECD8F1D0F904C00C828A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; 59A39E7B1BD2CF2E00157004 /* Build configuration list for PBXProject "LocalNotificationHelper" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/LocalNotificationHelper.xcodeproj/xcshareddata/xcschemes/LocalNotificationHelper.xcscheme b/LocalNotificationHelper.xcodeproj/xcshareddata/xcschemes/LocalNotificationHelper.xcscheme new file mode 100644 index 0000000..1860f53 --- /dev/null +++ b/LocalNotificationHelper.xcodeproj/xcshareddata/xcschemes/LocalNotificationHelper.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LocalNotificationHelper/Info.plist b/LocalNotificationHelper/Info.plist index 40c6215..d3de8ee 100644 --- a/LocalNotificationHelper/Info.plist +++ b/LocalNotificationHelper/Info.plist @@ -13,35 +13,14 @@ CFBundleName $(PRODUCT_NAME) CFBundlePackageType - APPL + FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + diff --git a/LocalNotificationHelper/LocalNotificationHelper.h b/LocalNotificationHelper/LocalNotificationHelper.h new file mode 100644 index 0000000..3afab10 --- /dev/null +++ b/LocalNotificationHelper/LocalNotificationHelper.h @@ -0,0 +1,19 @@ +// +// LocalNotificationHelper.h +// LocalNotificationHelper +// +// Created by Andrew Breckenridge on 6/13/16. +// Copyright © 2016 Ahmet Keskin. All rights reserved. +// + +#import + +//! Project version number for LocalNotificationHelper. +FOUNDATION_EXPORT double LocalNotificationHelperVersionNumber; + +//! Project version string for LocalNotificationHelper. +FOUNDATION_EXPORT const unsigned char LocalNotificationHelperVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +