Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Release 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rupérez committed Feb 9, 2017
1 parent 11dfb91 commit fb4b31d
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 79 deletions.
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

### IGZLocation 1.0.3

* IGZLocationNotifications deprecated, use NSNotification.Name instead.

### IGZLocation 1.0.4

* Compatible with Swift Package Manager.
* Everything public becomes open.

### IGZLocation 1.0.3

* IGZLocationNotifications deprecated, use NSNotification.Name extension instead.
2 changes: 1 addition & 1 deletion IGZLocation.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "IGZLocation"
s.version = "1.0.3"
s.version = "1.0.4"
s.summary = "CLLocationManager Swift 3 wrapper with multiple closure handlers and delegates allowed, notifications, sequential geofencing, self-authorization and, of course, everything is testable. #InCodeWeTrust"
s.description = <<-DESC
# IGZLocation
Expand Down
18 changes: 9 additions & 9 deletions IGZLocation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
8159B4291E43378400D0D587 /* IGZLocationHandlers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationHandlers.swift; sourceTree = "<group>"; };
8159B4291E43378400D0D587 /* IGZLocationHandlers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocationHandlers.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8159B42B1E4337A900D0D587 /* IGZLocationNotifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationNotifications.swift; sourceTree = "<group>"; };
8159B42D1E4337D100D0D587 /* IGZLocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationManager.swift; sourceTree = "<group>"; };
8159B42F1E4337F300D0D587 /* IGZLocationDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationDelegate.swift; sourceTree = "<group>"; };
8159B4311E43382300D0D587 /* IGZLocationError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationError.swift; sourceTree = "<group>"; };
8159B4331E43389A00D0D587 /* IGZLocationManagerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationManagerDelegate.swift; sourceTree = "<group>"; };
8159B42D1E4337D100D0D587 /* IGZLocationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocationManager.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8159B42F1E4337F300D0D587 /* IGZLocationDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocationDelegate.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8159B4311E43382300D0D587 /* IGZLocationError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocationError.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8159B4331E43389A00D0D587 /* IGZLocationManagerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocationManagerDelegate.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
8159B4351E4339C600D0D587 /* IGZLocationManagerExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocationManagerExtension.swift; sourceTree = "<group>"; };
8159B43B1E447F3C00D0D587 /* IGZLocationMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IGZLocationMap.app; sourceTree = BUILT_PRODUCTS_DIR; };
8159B43D1E447F3C00D0D587 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -85,12 +85,12 @@
8159B4521E447F3D00D0D587 /* IGZLocationMapUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IGZLocationMapUITests.swift; sourceTree = "<group>"; };
8159B4541E447F3D00D0D587 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
81925D161E40AA78001701F3 /* IGZLocation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = IGZLocation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
81925D191E40AA78001701F3 /* IGZLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IGZLocation.h; sourceTree = "<group>"; };
81925D191E40AA78001701F3 /* IGZLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IGZLocation.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
81925D1A1E40AA78001701F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
81925D1F1E40AA78001701F3 /* IGZLocationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IGZLocationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
81925D241E40AA78001701F3 /* IGZLocationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IGZLocationTests.swift; sourceTree = "<group>"; };
81925D261E40AA78001701F3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
81925D301E40AB25001701F3 /* IGZLocation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IGZLocation.swift; sourceTree = "<group>"; };
81925D301E40AB25001701F3 /* IGZLocation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IGZLocation.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -619,7 +619,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3VW789WSMP;
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
DYLIB_CURRENT_VERSION = 1.0.3;
DYLIB_CURRENT_VERSION = 1.0.4;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = IGZLocation/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -640,7 +640,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3VW789WSMP;
DYLIB_COMPATIBILITY_VERSION = 1.0.0;
DYLIB_CURRENT_VERSION = 1.0.3;
DYLIB_CURRENT_VERSION = 1.0.4;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = IGZLocation/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
20 changes: 10 additions & 10 deletions IGZLocation/IGZLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import CoreLocation
The IGZLocation is your entry point to the location service.
*/
public class IGZLocation: NSObject {

public var locationHandlers = [IGZLocationHandler]()
public var locationsHandlers = [IGZLocationsHandler]()
public var errorHandlers = [IGZErrorHandler]()
public var headingHandlers = [IGZHeadingHandler]()
public var regionHandlers = [IGZRegionHandler]()
public var authorizationHandlers = [IGZAuthorizationHandler]()
public var visitHandlers = [IGZVisitHandler]()
public var delegates = [IGZLocationDelegate]()
open class IGZLocation: NSObject {

open var locationHandlers = [IGZLocationHandler]()
open var locationsHandlers = [IGZLocationsHandler]()
open var errorHandlers = [IGZErrorHandler]()
open var headingHandlers = [IGZHeadingHandler]()
open var regionHandlers = [IGZRegionHandler]()
open var authorizationHandlers = [IGZAuthorizationHandler]()
open var visitHandlers = [IGZVisitHandler]()
open var delegates = [IGZLocationDelegate]()

var locationTemporaryHandlers = [IGZLocationHandler]()
var locationsTemporaryHandlers = [IGZLocationsHandler]()
Expand Down
4 changes: 2 additions & 2 deletions IGZLocation/IGZLocationError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import CoreLocation

public class IGZLocationError: NSError {
open class IGZLocationError: NSError {

fileprivate(set) var region: CLRegion?

Expand All @@ -34,7 +34,7 @@ public class IGZLocationError: NSError {
fatalError("init(coder:) has not been implemented")
}

public var underlyingError: NSError? {
open var underlyingError: NSError? {
return userInfo[NSUnderlyingErrorKey] as? NSError
}

Expand Down
28 changes: 14 additions & 14 deletions IGZLocation/IGZLocationManagerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CoreLocation

extension IGZLocation: CLLocationManagerDelegate {

public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
open func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
notificationCenter.post(name: .IGZLocationDidUpdateLocations, object: locations)
delegates.forEach { delegate in
delegate.didUpdateLocations?(locations)
Expand All @@ -36,7 +36,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) {
open func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) {
notificationCenter.post(name: .IGZLocationDidUpdateHeading, object: newHeading)
delegates.forEach { delegate in
delegate.didUpdateHeading?(newHeading)
Expand All @@ -49,11 +49,11 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool {
open func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool {
return displayHeadingCalibration
}

public func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) {
open func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) {
notificationCenter.post(name: .IGZLocationDidUpdateRegion, object: region, userInfo: [IGZLocationRegionStateUserInfoKey: state])
delegates.forEach { delegate in
delegate.didUpdateRegion?(region, state)
Expand All @@ -73,7 +73,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
open func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
notificationCenter.post(name: .IGZLocationDidUpdateRegion, object: region, userInfo: [IGZLocationRegionStateUserInfoKey: CLRegionState.inside])
delegates.forEach { delegate in
delegate.didUpdateRegion?(region, .inside)
Expand All @@ -86,7 +86,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
open func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
notificationCenter.post(name: .IGZLocationDidUpdateRegion, object: region, userInfo: [IGZLocationRegionStateUserInfoKey: CLRegionState.outside])
delegates.forEach { delegate in
delegate.didUpdateRegion?(region, .outside)
Expand All @@ -106,7 +106,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
open func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
let locationError = IGZLocationError(error)
notificationCenter.post(name: .IGZLocationDidFail, object: locationError)
delegates.forEach { delegate in
Expand All @@ -121,7 +121,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) {
open func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) {
let locationError = IGZLocationError(error, region: region)
notificationCenter.post(name: .IGZLocationDidFail, object: locationError)
delegates.forEach { delegate in
Expand All @@ -136,7 +136,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
open func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
notificationCenter.post(name: .IGZLocationDidChangeAuthorization, object: status)
delegates.forEach { delegate in
delegate.didChangeAuthorization?(status)
Expand All @@ -152,7 +152,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) {
open func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) {
notificationCenter.post(name: .IGZLocationDidUpdateRegion, object: region, userInfo: [IGZLocationRegionStateUserInfoKey: CLRegionState.unknown])
delegates.forEach { delegate in
delegate.didUpdateRegion?(region, .unknown)
Expand All @@ -165,15 +165,15 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) {
open func locationManagerDidPauseLocationUpdates(_ manager: CLLocationManager) {

}

public func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) {
open func locationManagerDidResumeLocationUpdates(_ manager: CLLocationManager) {

}

public func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) {
open func locationManager(_ manager: CLLocationManager, didFinishDeferredUpdatesWithError error: Error?) {
if let error = error {
let locationError = IGZLocationError(error)
notificationCenter.post(name: .IGZLocationDidFail, object: locationError)
Expand All @@ -190,7 +190,7 @@ extension IGZLocation: CLLocationManagerDelegate {
}
}

public func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) {
open func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) {
let date = Date()
let visiting = visit.arrivalDate < date && visit.departureDate > date
notificationCenter.post(name: .IGZLocationDidVisit, object: visit, userInfo: [IGZLocationVisitingUserInfoKey: visiting])
Expand Down
Loading

0 comments on commit fb4b31d

Please sign in to comment.