From 7da54bd52551d14361eb39842637cf2e5e1ce96a Mon Sep 17 00:00:00 2001 From: daltron Date: Tue, 25 Sep 2018 15:34:26 -0500 Subject: [PATCH] [master] - Release v1.3.0 --- .swift-version | 1 - AlamoRecord.podspec | 3 +- AlamoRecord/Classes/AlamoRecordObject.swift | 24 +++++----- AlamoRecord/Classes/Logger.swift | 2 +- AlamoRecord/Classes/RequestManager.swift | 14 +++--- Example/AlamoRecord.xcodeproj/project.pbxproj | 30 ++++++++++--- .../xcschemes/AlamoRecord-Example.xcscheme | 2 +- Example/AlamoRecord/AppDelegate.swift | 2 +- Example/AlamoRecord/Comment.swift | 4 +- Example/AlamoRecord/CommentsView.swift | 4 +- Example/AlamoRecord/PostsView.swift | 4 +- Example/Pods/Pods.xcodeproj/project.pbxproj | 44 +++++++++---------- Example/Tests/ApplicationError.swift | 4 ++ Example/Tests/ApplicationRequestManager.swift | 2 +- Example/Tests/Post.swift | 4 +- README.md | 14 +++--- 16 files changed, 89 insertions(+), 69 deletions(-) delete mode 100644 .swift-version diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 9f55b2c..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -3.0 diff --git a/AlamoRecord.podspec b/AlamoRecord.podspec index 2127695..7cc72d5 100644 --- a/AlamoRecord.podspec +++ b/AlamoRecord.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'AlamoRecord' - s.version = '1.2.2' + s.version = '1.3.0' s.summary = 'An elegant Alamofire wrapper inspired by ActiveRecord.' s.description = <<-DESC AlamoRecord is a powerful yet simple framework that eliminates the often complex networking layer that exists between your networking framework and your application. AlamoRecord uses the power of AlamoFire, AlamofireObjectMapper and the concepts behind the ActiveRecord pattern to create a networking layer that makes interacting with your API easier than ever. @@ -11,6 +11,7 @@ AlamoRecord is a powerful yet simple framework that eliminates the often complex s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Tunespeak' => 'daltonhint4@gmail.com' } s.source = { :git => 'https://github.com/tunespeak/AlamoRecord.git', :tag => s.version.to_s } + s.swift_version = '4.2' s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.11' diff --git a/AlamoRecord/Classes/AlamoRecordObject.swift b/AlamoRecord/Classes/AlamoRecordObject.swift index 884ef44..e7b952b 100644 --- a/AlamoRecord/Classes/AlamoRecordObject.swift +++ b/AlamoRecord/Classes/AlamoRecordObject.swift @@ -20,23 +20,23 @@ import Alamofire import AlamofireObjectMapper import ObjectMapper -open class AlamoRecordObject: NSObject, Mappable { +open class AlamoRecordObject: NSObject, Mappable { /// Key to encode/decode the id variable private let idKey: String = "id" /// The RequestManager that is tied to all instances of this class - open class var requestManager: RequestManager { + open class var requestManager: RequestManager { fatalError("requestManager must be overriden in your AlamoRecordObject subclass") } /// The RequestManager that is tied to this instance - open var requestManager: RequestManager { + open var requestManager: RequestManager { return type(of: self).requestManager } - /// The id of this instance. This can be a String or an Int. - open var id: Any! + /// The id of this instance. This should be a String or an Int. + open var id: IDType! /// The root of all instances of this class. This is used when making URL's that relate to a component of this class. // Example: '/comment/id' --> '/\(Comment.root)/id' @@ -188,7 +188,7 @@ open class AlamoRecordObject: NSObject, Map - parameter failure: The block to execute if the request fails */ @discardableResult - open class func find(id: Any, + open class func find(id: IDType, parameters: Parameters? = nil, encoding: ParameterEncoding = URLEncoding.default, headers: HTTPHeaders? = nil, @@ -237,7 +237,7 @@ open class AlamoRecordObject: NSObject, Map - parameter failure: The block to execute if the request fails */ @discardableResult - open class func update(id: Any, + open class func update(id: IDType, parameters: Parameters? = nil, encoding: ParameterEncoding = URLEncoding.default, headers: HTTPHeaders? = nil, @@ -263,7 +263,7 @@ open class AlamoRecordObject: NSObject, Map - parameter failure: The block to execute if the request fails */ @discardableResult - open class func update(id: Any, + open class func update(id: IDType, parameters: Parameters? = nil, encoding: ParameterEncoding = URLEncoding.default, headers: HTTPHeaders? = nil, @@ -335,7 +335,7 @@ open class AlamoRecordObject: NSObject, Map - parameter failure: The block to execute if the request fails */ @discardableResult - open class func destroy(id: Any, + open class func destroy(id: IDType, parameters: Parameters? = nil, encoding: ParameterEncoding = URLEncoding.default, headers: HTTPHeaders? = nil, @@ -365,7 +365,7 @@ open class AlamoRecordObject: NSObject, Map The URL to use when making a find request for all objects of this instance - parameter id: The id of the object to find */ - open class func urlForFind(_ id: Any) -> U { + open class func urlForFind(_ id: IDType) -> U { return U(url: "\(pluralRoot)/\(id)") } @@ -377,7 +377,7 @@ open class AlamoRecordObject: NSObject, Map The URL to use when making an update request for all objects of this instance - parameter id: The id of the object to update */ - open class func urlForUpdate(_ id: Any) -> U { + open class func urlForUpdate(_ id: IDType) -> U { return U(url: "\(pluralRoot)/\(id)") } @@ -389,7 +389,7 @@ open class AlamoRecordObject: NSObject, Map The URL to use when making a destroy request for all objects this instance - parameter id: The id of the object to destroy */ - open class func urlForDestroy(_ id: Any) -> U { + open class func urlForDestroy(_ id: IDType) -> U { return U(url: "\(pluralRoot)/\(id)") } diff --git a/AlamoRecord/Classes/Logger.swift b/AlamoRecord/Classes/Logger.swift index 7c39226..c34620c 100644 --- a/AlamoRecord/Classes/Logger.swift +++ b/AlamoRecord/Classes/Logger.swift @@ -55,7 +55,7 @@ class Logger: NSObject { let statusCode = responseObject.statusCode let statusCodeString = statusCodeStrings[statusCode] let duration = String(response.timeline.totalDuration) - let trimmedDuration = duration.substring(to: duration.index(duration.startIndex, offsetBy: 4)) + let trimmedDuration = String(duration[duration.startIndex..: NSObject { +open class RequestManager: NSObject { public typealias Parameters = [String: Any] @@ -205,7 +205,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func findObject>(id: Any, + public func findObject>(id: IDType, parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, @@ -233,7 +233,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func findObject>(url: U, + public func findObject>(url: U, parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, @@ -290,7 +290,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func createObject>(parameters: Parameters? = nil, + public func createObject>(parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, headers: HTTPHeaders? = nil, @@ -317,7 +317,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func createObject>(url: U, + public func createObject>(url: U, parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, @@ -371,7 +371,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func updateObject>(id: Any, + public func updateObject>(id: IDType, parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, @@ -399,7 +399,7 @@ open class RequestManager: NSObject { - parameter failure: The block to execute if the request fails */ @discardableResult - public func updateObject>(url: U, + public func updateObject>(url: U, parameters: Parameters? = nil, keyPath: String? = nil, encoding: ParameterEncoding = URLEncoding.default, diff --git a/Example/AlamoRecord.xcodeproj/project.pbxproj b/Example/AlamoRecord.xcodeproj/project.pbxproj index 8d549ea..19f1e28 100644 --- a/Example/AlamoRecord.xcodeproj/project.pbxproj +++ b/Example/AlamoRecord.xcodeproj/project.pbxproj @@ -335,18 +335,18 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 5C6346FA1F0B076B00158A80 = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 0830; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; TestTargetID = 607FACCF1AFB9204008FA782; }; 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1000; }; }; }; @@ -579,7 +579,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AlamoRecord_Example.app/AlamoRecord_Example"; }; name = Debug; @@ -597,7 +597,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.daltron.Tests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AlamoRecord_Example.app/AlamoRecord_Example"; }; name = Release; @@ -610,14 +610,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -657,14 +665,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -700,7 +716,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -715,7 +731,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Example/AlamoRecord.xcodeproj/xcshareddata/xcschemes/AlamoRecord-Example.xcscheme b/Example/AlamoRecord.xcodeproj/xcshareddata/xcschemes/AlamoRecord-Example.xcscheme index fca00bd..7415da1 100644 --- a/Example/AlamoRecord.xcodeproj/xcshareddata/xcschemes/AlamoRecord-Example.xcscheme +++ b/Example/AlamoRecord.xcodeproj/xcshareddata/xcschemes/AlamoRecord-Example.xcscheme @@ -1,6 +1,6 @@ Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. if let _ = NSClassFromString("XCTest") { diff --git a/Example/AlamoRecord/Comment.swift b/Example/AlamoRecord/Comment.swift index efb42e6..db70d68 100644 --- a/Example/AlamoRecord/Comment.swift +++ b/Example/AlamoRecord/Comment.swift @@ -9,9 +9,9 @@ import ObjectMapper import UIKit -class Comment: AlamoRecordObject { +class Comment: AlamoRecordObject { - class override var requestManager: RequestManager { + class override var requestManager: ApplicationRequestManager { return ApplicationRequestManager.default } diff --git a/Example/AlamoRecord/CommentsView.swift b/Example/AlamoRecord/CommentsView.swift index af8a6d7..8d03040 100644 --- a/Example/AlamoRecord/CommentsView.swift +++ b/Example/AlamoRecord/CommentsView.swift @@ -26,11 +26,11 @@ class CommentsView: UIView { tableView = UITableView(frame: .zero, style: .plain) tableView.backgroundColor = .darkWhite tableView.separatorStyle = .none - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 50.0 tableView.dataSource = self tableView.delegate = self - tableView.contentInset = UIEdgeInsetsMake(0, 0, 10, 0) + tableView.contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 10, right: 0) addSubview(tableView) tableView.snp.makeConstraints { (make) in diff --git a/Example/AlamoRecord/PostsView.swift b/Example/AlamoRecord/PostsView.swift index 1c14ab4..9e0ffb0 100644 --- a/Example/AlamoRecord/PostsView.swift +++ b/Example/AlamoRecord/PostsView.swift @@ -29,11 +29,11 @@ class PostsView: UIView { tableView = UITableView(frame: .zero, style: .plain) tableView.backgroundColor = .darkWhite tableView.separatorStyle = .none - tableView.rowHeight = UITableViewAutomaticDimension + tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = 50.0 tableView.dataSource = self tableView.delegate = self - tableView.contentInset = UIEdgeInsetsMake(0, 0, 10, 0) + tableView.contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 10, right: 0) addSubview(tableView) tableView.snp.makeConstraints { (make) in diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 8c33c6f..0d37dc2 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -291,7 +291,7 @@ 0A46AD76AE9B997916B2978E69E46B75 /* AlamofireObjectMapper.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = AlamofireObjectMapper.modulemap; sourceTree = ""; }; 0A8E643185672E622464E17DAEF8E079 /* NotificationBannerUtilities.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NotificationBannerUtilities.swift; path = NotificationBanner/Classes/NotificationBannerUtilities.swift; sourceTree = ""; }; 0AF6D01FABB28313939AB9FC2155FDE2 /* ConstraintMakerFinalizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerFinalizable.swift; path = Source/ConstraintMakerFinalizable.swift; sourceTree = ""; }; - 0B335FD552102E881349FC3267846B65 /* Pods_AlamoRecord_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_AlamoRecord_Example.framework; path = "Pods-AlamoRecord_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 0B335FD552102E881349FC3267846B65 /* Pods_AlamoRecord_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AlamoRecord_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0C616CD08A98BC45BBCAAD5A55F3B213 /* EnumOperators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EnumOperators.swift; path = Sources/EnumOperators.swift; sourceTree = ""; }; 0DD9D58BE5A50D16C6A304037528DBAC /* MarqueeLabel-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MarqueeLabel-umbrella.h"; sourceTree = ""; }; 0F6D96CAB0AC4116A7B3B466F12882B9 /* Debugging.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debugging.swift; path = Source/Debugging.swift; sourceTree = ""; }; @@ -310,7 +310,7 @@ 24F4370F54ACCCE4EBAE52878934F1E8 /* NotificationBannerQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NotificationBannerQueue.swift; path = NotificationBanner/Classes/NotificationBannerQueue.swift; sourceTree = ""; }; 28849CF212F5D9DA00865FA1E82C34B6 /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 289331361BB424DB5E706F5DBEFCB9A8 /* ConstraintMakerEditable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerEditable.swift; path = Source/ConstraintMakerEditable.swift; sourceTree = ""; }; - 2AA29BE88A5E4E1A5E273BC500992B4A /* AlamoRecord.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = AlamoRecord.framework; path = AlamoRecord.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2AA29BE88A5E4E1A5E273BC500992B4A /* AlamoRecord.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamoRecord.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2FC4ACF8F0831133E45E685F6A9236B8 /* Pods-AlamoRecord_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-AlamoRecord_Example.debug.xcconfig"; sourceTree = ""; }; 30528F18D3A5E4B4949486D121D2F7F9 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; 3327B061DC126CD19E4FC5C4F1826AEF /* DataTransform.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DataTransform.swift; path = Sources/DataTransform.swift; sourceTree = ""; }; @@ -365,7 +365,7 @@ 6C6ABE7A32481D53FF6A7C8309407DB7 /* CustomDateFormatTransform.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CustomDateFormatTransform.swift; path = Sources/CustomDateFormatTransform.swift; sourceTree = ""; }; 6CB625EF72686AC7EC65C19C9346F4AE /* SnapKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-umbrella.h"; sourceTree = ""; }; 6EB5F7E09E3793386EE5F1BAEC7DA78A /* BaseNotificationBanner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BaseNotificationBanner.swift; path = NotificationBanner/Classes/BaseNotificationBanner.swift; sourceTree = ""; }; - 6F09BCA30C245DAFC97C0D9F3D5354D1 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + 6F09BCA30C245DAFC97C0D9F3D5354D1 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 70A8EF3A906A9A82DC7D865D8C12B0AA /* ConstraintMakerPriortizable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerPriortizable.swift; path = Source/ConstraintMakerPriortizable.swift; sourceTree = ""; }; 713647C05CCBA504409AFF7D3DE86593 /* NotificationBannerSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NotificationBannerSwift-umbrella.h"; sourceTree = ""; }; 72208DE78565D3CBAB32321F13F86833 /* HexColorTransform.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HexColorTransform.swift; path = Sources/HexColorTransform.swift; sourceTree = ""; }; @@ -376,11 +376,11 @@ 78DDCDE3CE7A555FEB5E497A9D196302 /* SnapKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SnapKit-prefix.pch"; sourceTree = ""; }; 798199B19F5F3F24121509E64B9AE157 /* ConstraintLayoutGuideDSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintLayoutGuideDSL.swift; path = Source/ConstraintLayoutGuideDSL.swift; sourceTree = ""; }; 7A2B7E11D3E2553CF869DE8B6C7D3A6C /* AlamofireObjectMapper-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AlamofireObjectMapper-prefix.pch"; sourceTree = ""; }; - 7A37CD5253FA2D2C6039043A849EF548 /* NotificationBannerSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = NotificationBannerSwift.framework; path = NotificationBannerSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7A37CD5253FA2D2C6039043A849EF548 /* NotificationBannerSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NotificationBannerSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7BCD6C8FC18CEED6DE033C29BF862BE8 /* NotificationBannerSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = NotificationBannerSwift.modulemap; sourceTree = ""; }; 7DA8E434A88F87EB786D6E094402001E /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; 7EF4BD8E225D1AFFAB6A36179A95EE31 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 811E56E17BC4B2BD1FFDF111E661A94D /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 811E56E17BC4B2BD1FFDF111E661A94D /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 819002936FF4C24B82E069EED53E4238 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; 847901FB0D3E839E1B4F3E2410629706 /* KeyboardSpyEvent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KeyboardSpyEvent.swift; path = KeyboardSpy/Classes/KeyboardSpyEvent.swift; sourceTree = ""; }; 875BD4F5EB784036E8973601A892D38E /* AlamoRecord-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AlamoRecord-umbrella.h"; sourceTree = ""; }; @@ -392,7 +392,7 @@ 903792A39ABAEB50B0993AE5D86A4D36 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 919933E2738679132500FB9D5D755B72 /* StatusBarNotificationBanner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StatusBarNotificationBanner.swift; path = NotificationBanner/Classes/StatusBarNotificationBanner.swift; sourceTree = ""; }; 91DE1A6992E3185A0BFC1A6AB2D1F40C /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = AlamoRecord/Classes/Configuration.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 93FCE92BFCFDC57EDF9F4141299733D2 /* Pods-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Tests.release.xcconfig"; sourceTree = ""; }; 95352576C06716B2BA2E9192F101187A /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; 954BDAB2B126BCE1E7B43F4849C6F52D /* ImmutableMappable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmutableMappable.swift; path = Sources/ImmutableMappable.swift; sourceTree = ""; }; @@ -400,21 +400,21 @@ 95D36B28ABBE7BBC12C0EF30488076C9 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; 98FCD404051D6CD9860C37A64A0E2A0B /* ConstraintConfig.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintConfig.swift; path = Source/ConstraintConfig.swift; sourceTree = ""; }; 9BAEDA0DBD222F0B2CDE5C53FE05D069 /* ConstraintItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintItem.swift; path = Source/ConstraintItem.swift; sourceTree = ""; }; - 9C8B0DFBF2BAB8733EF7DB74F0667B10 /* MarqueeLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MarqueeLabel.framework; path = MarqueeLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9D9EBAC1277C5ECA19481F268CE12F05 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SnapKit.framework; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9C8B0DFBF2BAB8733EF7DB74F0667B10 /* MarqueeLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MarqueeLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9D9EBAC1277C5ECA19481F268CE12F05 /* SnapKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SnapKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9EF58AEEDCA8670B05704DD08DA971DC /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; 9F039EAF3AA7F46D8FA1D9B95A1D4356 /* AlamoRecord.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = AlamoRecord.modulemap; sourceTree = ""; }; A03FA37D643EB2AEA220478836D787DB /* ConstraintMakerRelatable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConstraintMakerRelatable.swift; path = Source/ConstraintMakerRelatable.swift; sourceTree = ""; }; A1A3F4708F8D95A0F497607EA34AF201 /* MarqueeLabel.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = MarqueeLabel.modulemap; sourceTree = ""; }; A3C5438652D6680B1DCAD1A28B097E02 /* Pods-Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Tests-acknowledgements.plist"; sourceTree = ""; }; A4E4812453FA990163B2D741FD690320 /* AlamofireObjectMapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireObjectMapper.swift; path = AlamofireObjectMapper/AlamofireObjectMapper.swift; sourceTree = ""; }; - A4E83AE8CA02FE7FF770729171F629FB /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; - A54E321E1F502A3FD05A86E4B50CB61C /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = AlamofireObjectMapper.framework; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A4E83AE8CA02FE7FF770729171F629FB /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + A54E321E1F502A3FD05A86E4B50CB61C /* AlamofireObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A63180EAF0175AE196392494C3185553 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8050A9689C217FEB2D3A22EB12B960E /* ObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ObjectMapper.framework; path = ObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A8050A9689C217FEB2D3A22EB12B960E /* ObjectMapper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjectMapper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A8B7BA7675011200977484FA3E04E502 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A926980C17DD40199B69119A9C509415 /* TransformOperators.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TransformOperators.swift; path = Sources/TransformOperators.swift; sourceTree = ""; }; - AF2B153C0E5746EE0311B4BA867C8982 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Tests.framework; path = "Pods-Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + AF2B153C0E5746EE0311B4BA867C8982 /* Pods_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B71C28959052B200D595739E30D99849 /* Logger.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Logger.swift; path = AlamoRecord/Classes/Logger.swift; sourceTree = ""; }; B71F088969A068BDC8F86F0F266E0748 /* ObjectMapper.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = ObjectMapper.modulemap; sourceTree = ""; }; B72FDFA92C2CC5EB0A9A906117DAE547 /* KeyboardSpy-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "KeyboardSpy-dummy.m"; sourceTree = ""; }; @@ -440,11 +440,11 @@ D081FD4386F763ED5476E3EA1697D5DF /* NotificationBannerSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NotificationBannerSwift-dummy.m"; sourceTree = ""; }; D25CF68D3952990493EA467FFAA2EEAE /* Constraint.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Constraint.swift; path = Source/Constraint.swift; sourceTree = ""; }; D31E090100052D93423EDB037E2747ED /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - D32FED2D18417B668CB128727C6C75D4 /* KeyboardSpy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = KeyboardSpy.framework; path = KeyboardSpy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D32FED2D18417B668CB128727C6C75D4 /* KeyboardSpy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KeyboardSpy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D3EC3E53F75709EF7A46C6A57CCEFD46 /* KeyboardSpyAgent.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = KeyboardSpyAgent.swift; path = KeyboardSpy/Classes/KeyboardSpyAgent.swift; sourceTree = ""; }; D5D16987DB4D19C055D99A15C335A62E /* ConstraintView+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ConstraintView+Extensions.swift"; path = "Source/ConstraintView+Extensions.swift"; sourceTree = ""; }; D6993C2AF6B4895BD166B65F4FC42006 /* KeyboardSpy.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = KeyboardSpy.modulemap; sourceTree = ""; }; - D76A08FF8BB90F6FB9F9DF7C63209DCF /* AlamoRecord.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = AlamoRecord.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + D76A08FF8BB90F6FB9F9DF7C63209DCF /* AlamoRecord.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; path = AlamoRecord.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; D7877D4EAB68C537590EBE4575B44E08 /* Pods-AlamoRecord_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-AlamoRecord_Example-acknowledgements.markdown"; sourceTree = ""; }; DAC45D38FB076F604D9E399A564B21C1 /* UILayoutSupport+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+Extensions.swift"; path = "Source/UILayoutSupport+Extensions.swift"; sourceTree = ""; }; DB43758BD56B1AF5062D21D807B0C4B3 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; @@ -605,7 +605,6 @@ DAC45D38FB076F604D9E399A564B21C1 /* UILayoutSupport+Extensions.swift */, B705C230442332640574C2E51E88839B /* Support Files */, ); - name = SnapKit; path = SnapKit; sourceTree = ""; }; @@ -651,7 +650,6 @@ A4E4812453FA990163B2D741FD690320 /* AlamofireObjectMapper.swift */, B16856BBF39734114CF719EC01F238AD /* Support Files */, ); - name = AlamofireObjectMapper; path = AlamofireObjectMapper; sourceTree = ""; }; @@ -702,7 +700,6 @@ 6230182B8B816E46E6A108E6044D4F9D /* URLTransform.swift */, 23A76400C375B6928B4851015A1B57C2 /* Support Files */, ); - name = ObjectMapper; path = ObjectMapper; sourceTree = ""; }; @@ -740,7 +737,6 @@ 486660D5424EDA7D774EB91323CADD54 /* Support Files */, 16C51AD81F32437BC2553FDDAD56BE8D /* Swift */, ); - name = MarqueeLabel; path = MarqueeLabel; sourceTree = ""; }; @@ -777,7 +773,6 @@ 919933E2738679132500FB9D5D755B72 /* StatusBarNotificationBanner.swift */, A02D442835F68CDF3B8808B55E8888CB /* Support Files */, ); - name = NotificationBannerSwift; path = NotificationBannerSwift; sourceTree = ""; }; @@ -902,7 +897,6 @@ 5525AEA713DDBC655FEAA2359F87EB29 /* Validation.swift */, 4A6E5E62FE076BDF614BB56822B26F67 /* Support Files */, ); - name = Alamofire; path = Alamofire; sourceTree = ""; }; @@ -929,7 +923,6 @@ 04BE3CD20A08B4684E88C17950749B8D /* KeyboardSpyInfo.swift */, D35126F98D4EF4B53C713592D70CDEE0 /* Support Files */, ); - name = KeyboardSpy; path = KeyboardSpy; sourceTree = ""; }; @@ -1269,6 +1262,11 @@ attributes = { LastSwiftUpdateCheck = 0930; LastUpgradeCheck = 0930; + TargetAttributes = { + FFC2303D4708BD90ED4525797666E56F = { + LastSwiftMigration = 1000; + }; + }; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -2043,7 +2041,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2178,7 +2176,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Example/Tests/ApplicationError.swift b/Example/Tests/ApplicationError.swift index ba4dec1..94c75d7 100644 --- a/Example/Tests/ApplicationError.swift +++ b/Example/Tests/ApplicationError.swift @@ -23,6 +23,10 @@ class ApplicationError: AlamoRecordError { super.init(coder: aDecoder) } + public required init() { + fatalError("init() has not been implemented") + } + override func mapping(map: Map) { super.mapping(map: map) } diff --git a/Example/Tests/ApplicationRequestManager.swift b/Example/Tests/ApplicationRequestManager.swift index ff36196..a40c4a2 100644 --- a/Example/Tests/ApplicationRequestManager.swift +++ b/Example/Tests/ApplicationRequestManager.swift @@ -8,7 +8,7 @@ import AlamoRecord -class ApplicationRequestManager: RequestManager { +class ApplicationRequestManager: RequestManager { static var `default`: ApplicationRequestManager = ApplicationRequestManager() diff --git a/Example/Tests/Post.swift b/Example/Tests/Post.swift index 5ee6deb..7d65bba 100644 --- a/Example/Tests/Post.swift +++ b/Example/Tests/Post.swift @@ -9,9 +9,9 @@ import AlamoRecord import ObjectMapper -class Post: AlamoRecordObject { +class Post: AlamoRecordObject { - override class var requestManager: RequestManager { + override class var requestManager: ApplicationRequestManager { return ApplicationRequestManager.default } diff --git a/README.md b/README.md index 264f6a7..d05c4a0 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ AlamoRecord is a powerful yet simple framework that eliminates the often complex ## Requirements - iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 9.0+ -- Swift 4.0+ +- Xcode 10.0+ +- Swift 4.2+ ## Installation @@ -113,8 +113,9 @@ We next need to create an instance of a `RequestManager` and pass in the `Applic #### `ApplicationRequestManager` ```swift -class ApplicationRequestManager: RequestManager { - +// IDType should be of type String or Int +class ApplicationRequestManager: RequestManager { + static var `default`: ApplicationRequestManager = ApplicationRequestManager() init() { @@ -131,9 +132,10 @@ The final step is to create data objects inheriting from `AlamoRecordObject` tha #### `Post` ```swift -class Post: AlamoRecordObject { +// IDType should be of type String or Int +class Post: AlamoRecordObject { - override class var requestManager: RequestManager { + override class var requestManager: RequestManager { return ApplicationRequestManager }