Skip to content

Commit

Permalink
[master] - Release v1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Daltron committed Oct 26, 2018
1 parent 7da54bd commit 29f3e83
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion AlamoRecord.podspec
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = 'AlamoRecord'
s.version = '1.3.0'
s.version = '1.3.1'
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.
Expand Down
2 changes: 1 addition & 1 deletion AlamoRecord/Classes/AlamoRecordObject.swift
Expand Up @@ -20,7 +20,7 @@ import Alamofire
import AlamofireObjectMapper
import ObjectMapper

open class AlamoRecordObject<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject, Mappable {
open class AlamoRecordObject<U: AlamoRecordURL, E: AlamoRecordError, IDType>: NSObject, Mappable {

/// Key to encode/decode the id variable
private let idKey: String = "id"
Expand Down
Expand Up @@ -16,10 +16,11 @@
*/

public protocol URLProtocol {
public protocol AlamoRecordURL {

/// The entire url of a particular instance. Example: https://www.domain.com/objects/id
var absolute: String { get }

init(url: String)
init(url: String, isCompletePath: Bool)
}
26 changes: 13 additions & 13 deletions AlamoRecord/Classes/RequestManager.swift
Expand Up @@ -20,7 +20,7 @@ import Alamofire
import AlamofireObjectMapper
import ObjectMapper

open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject {
open class RequestManager<U: AlamoRecordURL, E: AlamoRecordError, IDType>: NSObject {

public typealias Parameters = [String: Any]

Expand Down Expand Up @@ -48,7 +48,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject
/**
Makes a request to the given URL. Each request goes through this method first.
- parameter method: The HTTP method
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter encoding: The parameter encoding. `URLEncoding.default` by default
- parameter headers: The HTTP headers. `nil` by default
Expand All @@ -72,7 +72,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject
/**
Makes a request to the given URL
- parameter method: The HTTP method
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter encoding: The parameter encoding. `URLEncoding.default` by default
- parameter headers: The HTTP headers. `nil` by default
Expand Down Expand Up @@ -121,7 +121,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject
/**
Makes a request and maps an object that conforms to the Mappable protocol
- parameter method: The HTTP method
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -159,7 +159,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject
/**
Makes a request and maps an array of objects that conform to the Mappable protocol
- parameter method: The HTTP method
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -224,7 +224,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and maps an AlamoRecordObject
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -253,7 +253,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and maps an array of AlamoRecordObjects
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -308,7 +308,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and creates an AlamoRecordObject
- paramter url: The URL that conforms to URLProtocol
- paramter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -390,7 +390,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and updates an AlamoRecordObject
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand Down Expand Up @@ -419,7 +419,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and updates an AlamoRecordObject
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
Expand All @@ -446,7 +446,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a request and destroys an AlamoRecordObject
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter parameters: The parameters. `nil` by default
- parameter encoding: The parameter encoding. `URLEncoding.default` by default.
- parameter headers: The HTTP headers. `nil` by default.
Expand All @@ -473,7 +473,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes an upload request
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter keyPath: The keyPath to use when deserializing the JSON. `nil` by default.
- parameter headers: The HTTP headers. `nil` by default.
- parameter multipartFormData: The data to append
Expand Down Expand Up @@ -511,7 +511,7 @@ open class RequestManager<U: URLProtocol, E: AlamoRecordError, IDType>: NSObject

/**
Makes a download request
- parameter url: The URL that conforms to URLProtocol
- parameter url: The URL that conforms to AlamoRecordURL
- parameter destination: The destination to download the file to. If it is nil, then a default one will be assigned.
- parameter progress: The progress handler of the download request
- parameter success: The block to execute if the request succeeds
Expand Down
12 changes: 6 additions & 6 deletions Example/AlamoRecord.xcodeproj/project.pbxproj
Expand Up @@ -28,13 +28,14 @@
5C94C3061F08707F00762CFC /* RequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2F81F08707F00762CFC /* RequestManager.swift */; };
5C94C3081F08707F00762CFC /* RequestObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2F91F08707F00762CFC /* RequestObserver.swift */; };
5C94C30A1F08707F00762CFC /* StatusCodeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2FA1F08707F00762CFC /* StatusCodeObserver.swift */; };
5C94C30C1F08707F00762CFC /* URLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2FB1F08707F00762CFC /* URLProtocol.swift */; };
5C96D98D1F0ECC39005FF25E /* PostsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D98C1F0ECC39005FF25E /* PostsModel.swift */; };
5C96D98F1F0ECC43005FF25E /* PostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D98E1F0ECC43005FF25E /* PostsView.swift */; };
5C96D9911F0ECC4E005FF25E /* PostsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D9901F0ECC4E005FF25E /* PostsViewController.swift */; };
5C96D9931F0ED260005FF25E /* PostCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D9921F0ED260005FF25E /* PostCell.swift */; };
5C96D9951F0ED316005FF25E /* BaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D9941F0ED316005FF25E /* BaseTableViewCell.swift */; };
5C96D9971F0EDB71005FF25E /* ColorsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C96D9961F0EDB71005FF25E /* ColorsExtension.swift */; };
5CA0A94F21825DA3002BA69A /* AlamoRecordURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA0A94E21825DA3002BA69A /* AlamoRecordURL.swift */; };
5CA0A95021825DA3002BA69A /* AlamoRecordURL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA0A94E21825DA3002BA69A /* AlamoRecordURL.swift */; };
5CCB20951F17064E0027BA56 /* Comment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE6C8151F102C5200965235 /* Comment.swift */; };
5CCB20961F1706880027BA56 /* AlamoRecordError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C86407E1F09D5E6001E8320 /* AlamoRecordError.swift */; };
5CCB20971F1706880027BA56 /* AlamoRecordObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2F31F08707F00762CFC /* AlamoRecordObject.swift */; };
Expand All @@ -44,7 +45,6 @@
5CCB209B1F1706880027BA56 /* RequestManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2F81F08707F00762CFC /* RequestManager.swift */; };
5CCB209C1F1706880027BA56 /* RequestObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2F91F08707F00762CFC /* RequestObserver.swift */; };
5CCB209D1F1706880027BA56 /* StatusCodeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2FA1F08707F00762CFC /* StatusCodeObserver.swift */; };
5CCB209E1F1706880027BA56 /* URLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C94C2FB1F08707F00762CFC /* URLProtocol.swift */; };
5CE6C8101F102B6900965235 /* CommentsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE6C80F1F102B6900965235 /* CommentsModel.swift */; };
5CE6C8121F102B7E00965235 /* CommentsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE6C8111F102B7E00965235 /* CommentsViewController.swift */; };
5CE6C8141F102B8F00965235 /* CommentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CE6C8131F102B8F00965235 /* CommentsView.swift */; };
Expand Down Expand Up @@ -90,13 +90,13 @@
5C94C2F81F08707F00762CFC /* RequestManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RequestManager.swift; path = ../../AlamoRecord/Classes/RequestManager.swift; sourceTree = "<group>"; };
5C94C2F91F08707F00762CFC /* RequestObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RequestObserver.swift; path = ../../AlamoRecord/Classes/RequestObserver.swift; sourceTree = "<group>"; };
5C94C2FA1F08707F00762CFC /* StatusCodeObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = StatusCodeObserver.swift; path = ../../AlamoRecord/Classes/StatusCodeObserver.swift; sourceTree = "<group>"; };
5C94C2FB1F08707F00762CFC /* URLProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = URLProtocol.swift; path = ../../AlamoRecord/Classes/URLProtocol.swift; sourceTree = "<group>"; };
5C96D98C1F0ECC39005FF25E /* PostsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostsModel.swift; sourceTree = "<group>"; };
5C96D98E1F0ECC43005FF25E /* PostsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostsView.swift; sourceTree = "<group>"; };
5C96D9901F0ECC4E005FF25E /* PostsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostsViewController.swift; sourceTree = "<group>"; };
5C96D9921F0ED260005FF25E /* PostCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostCell.swift; sourceTree = "<group>"; };
5C96D9941F0ED316005FF25E /* BaseTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTableViewCell.swift; sourceTree = "<group>"; };
5C96D9961F0EDB71005FF25E /* ColorsExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColorsExtension.swift; sourceTree = "<group>"; };
5CA0A94E21825DA3002BA69A /* AlamoRecordURL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AlamoRecordURL.swift; path = ../../AlamoRecord/Classes/AlamoRecordURL.swift; sourceTree = "<group>"; };
5CE6C80F1F102B6900965235 /* CommentsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommentsModel.swift; sourceTree = "<group>"; };
5CE6C8111F102B7E00965235 /* CommentsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommentsViewController.swift; sourceTree = "<group>"; };
5CE6C8131F102B8F00965235 /* CommentsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommentsView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -207,13 +207,13 @@
children = (
5C86407E1F09D5E6001E8320 /* AlamoRecordError.swift */,
5C94C2F31F08707F00762CFC /* AlamoRecordObject.swift */,
5CA0A94E21825DA3002BA69A /* AlamoRecordURL.swift */,
5C94C2F41F08707F00762CFC /* Configuration.swift */,
5C94C2F51F08707F00762CFC /* ErrorParser.swift */,
5C94C2F71F08707F00762CFC /* Logger.swift */,
5C94C2F81F08707F00762CFC /* RequestManager.swift */,
5C94C2F91F08707F00762CFC /* RequestObserver.swift */,
5C94C2FA1F08707F00762CFC /* StatusCodeObserver.swift */,
5C94C2FB1F08707F00762CFC /* URLProtocol.swift */,
);
name = Source;
sourceTree = "<group>";
Expand Down Expand Up @@ -499,8 +499,8 @@
5C6347081F0B088200158A80 /* AlamoRecordTests.swift in Sources */,
5CCB20991F1706880027BA56 /* ErrorParser.swift in Sources */,
5C63470D1F0B09B900158A80 /* ApplicationRequestManager.swift in Sources */,
5CA0A95021825DA3002BA69A /* AlamoRecordURL.swift in Sources */,
5CCB20961F1706880027BA56 /* AlamoRecordError.swift in Sources */,
5CCB209E1F1706880027BA56 /* URLProtocol.swift in Sources */,
5C6347091F0B088200158A80 /* Post.swift in Sources */,
5C63470A1F0B088200158A80 /* ApplicationURL.swift in Sources */,
);
Expand All @@ -510,7 +510,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5C94C30C1F08707F00762CFC /* URLProtocol.swift in Sources */,
5C94C2FE1F08707F00762CFC /* Configuration.swift in Sources */,
5CE6C8121F102B7E00965235 /* CommentsViewController.swift in Sources */,
5C6347161F0B3D3E00158A80 /* ApplicationRequestManager.swift in Sources */,
Expand All @@ -522,6 +521,7 @@
5C94C3041F08707F00762CFC /* Logger.swift in Sources */,
5C96D98D1F0ECC39005FF25E /* PostsModel.swift in Sources */,
5C6347151F0B3D3E00158A80 /* ApplicationError.swift in Sources */,
5CA0A94F21825DA3002BA69A /* AlamoRecordURL.swift in Sources */,
5C6347141F0B3D3E00158A80 /* Post.swift in Sources */,
5CE6C8141F102B8F00965235 /* CommentsView.swift in Sources */,
5C4141961F12CE7800A18674 /* CreatePostView.swift in Sources */,
Expand Down
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down

0 comments on commit 29f3e83

Please sign in to comment.