Skip to content

Commit fc97aa4

Browse files
committed
Deprecates typealias`.
1 parent 49d4c1d commit fc97aa4

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

BuckoNetworking.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
buildSettings = {
392392
CLANG_ENABLE_MODULES = YES;
393393
CODE_SIGN_IDENTITY = "";
394+
CURRENT_PROJECT_VERSION = 1.1.0;
394395
DEFINES_MODULE = YES;
395396
DEVELOPMENT_TEAM = "";
396397
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -417,6 +418,7 @@
417418
buildSettings = {
418419
CLANG_ENABLE_MODULES = YES;
419420
CODE_SIGN_IDENTITY = "";
421+
CURRENT_PROJECT_VERSION = 1.1.0;
420422
DEFINES_MODULE = YES;
421423
DEVELOPMENT_TEAM = "";
422424
DYLIB_COMPATIBILITY_VERSION = 1;

BuckoNetworking/Bucko.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ public protocol BuckoErrorHandler: class {
1515
}
1616

1717
public typealias BuckoResponseClosure = ((DataResponse<Any>) -> Void)
18+
@available(*, deprecated, message: "Use HTTPMethod instead")
1819
public typealias HttpMethod = HTTPMethod
20+
@available(*, deprecated, message: "Use HTTPHeaders instead")
1921
public typealias HttpHeaders = HTTPHeaders
22+
@available(*, deprecated, message: "Use ParameterEncoding instead")
2023
public typealias Encoding = ParameterEncoding
24+
@available(*, deprecated, message: "Use URLEncoding instead")
2125
public typealias UrlEncoding = URLEncoding
26+
@available(*, deprecated, message: "Use JSONEncoding instead")
2227
public typealias JsonEncoding = JSONEncoding
28+
@available(*, deprecated, message: "Use Parameters instead")
2329
public typealias Body = Parameters
30+
@available(*, deprecated, message: "Use JSON instead")
2431
public typealias Json = JSON
2532

2633
public struct Bucko {

BuckoNetworking/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>1.1.0</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

BuckoNetworking/Protocols/Endpoint.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public protocol Endpoint {
1919
This will automatically be set by the baseURL and the path.
2020
*/
2121
var fullURL: String { get }
22-
var method: HttpMethod { get }
22+
var method: HTTPMethod { get }
2323

2424
/**
2525
By default, encoding will be set to URLEncoding for GET requests
@@ -31,31 +31,31 @@ public protocol Endpoint {
3131
PropertyListEncoding.default
3232
You can also create your own.
3333
*/
34-
var encoding: Encoding { get }
34+
var encoding: ParameterEncoding { get }
3535

3636
/**
3737
By default this will be set to empty - Parameters()
3838
*/
39-
var body: Body { get }
39+
var body: Parameters { get }
4040

4141
/**
4242
Authorization is usually set in the headers. You can set this to `[:]` if you don't have any
4343
headers to set. You can also create an extention on Endpoint to also have
4444
this default to a value.
4545
*/
46-
var headers: HttpHeaders { get }
46+
var headers: HTTPHeaders { get }
4747
}
4848

4949
public extension Endpoint {
50-
var encoding: Encoding {
51-
return method == .get ? UrlEncoding.default : JsonEncoding.default
50+
var encoding: ParameterEncoding {
51+
return method == .get ? URLEncoding.default : JSONEncoding.default
5252
}
5353

5454
var fullURL: String {
5555
return baseURL + path
5656
}
5757

58-
var body: Body {
59-
return Body()
58+
var body: Parameters {
59+
return Parameters()
6060
}
6161
}

BuckoNetworking/Protocols/JSONDecodable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
public protocol JSONDecodable {
1010
associatedtype Model
11-
static func map(from json: Json) throws -> Model
11+
static func map(from json: JSON) throws -> Model
1212
}

0 commit comments

Comments
 (0)