Skip to content

Commit c32ba45

Browse files
authored
Merge pull request #432 from zapcannon87/master
fix: support xcode 13
2 parents 5789d46 + dff8566 commit c32ba45

File tree

5 files changed

+54
-51
lines changed

5 files changed

+54
-51
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
17.9.1
1+
17.9.2

LeanCloud.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'LeanCloud'
3-
s.version = '17.9.1'
3+
s.version = '17.9.2'
44
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
55
s.summary = 'LeanCloud Swift SDK'
66
s.homepage = 'https://leancloud.cn/'

Sources/Foundation/Query.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,12 @@ public class LCQuery: NSObject, NSCopying, NSCoding {
551551
completionQueue: DispatchQueue = .main,
552552
completion: @escaping (LCQueryResult<T>) -> Void) -> LCRequest
553553
{
554-
return self._find(cachePolicy: cachePolicy) { result in
554+
let _completion: (LCQueryResult<T>) -> Void = { result in
555555
completionQueue.async {
556556
completion(result)
557557
}
558558
}
559+
return self._find(cachePolicy: cachePolicy, completion: _completion)
559560
}
560561

561562
@discardableResult
@@ -624,11 +625,12 @@ public class LCQuery: NSObject, NSCopying, NSCoding {
624625
completionQueue: DispatchQueue = .main,
625626
completion: @escaping (LCValueResult<T>) -> Void) -> LCRequest
626627
{
627-
return self._getFirst(cachePolicy: cachePolicy) { result in
628+
let _completion: (LCValueResult<T>) -> Void = { result in
628629
completionQueue.async {
629630
completion(result)
630631
}
631632
}
633+
return self._getFirst(cachePolicy: cachePolicy, completion: _completion)
632634
}
633635

634636
@discardableResult
@@ -701,14 +703,15 @@ public class LCQuery: NSObject, NSCopying, NSCoding {
701703
completionQueue: DispatchQueue = .main,
702704
completion: @escaping (LCValueResult<T>) -> Void) -> LCRequest
703705
{
704-
return self._get(
705-
objectId: objectId,
706-
cachePolicy: cachePolicy)
707-
{ result in
706+
let _completion: (LCValueResult<T>) -> Void = { result in
708707
completionQueue.async {
709708
completion(result)
710709
}
711710
}
711+
return self._get(
712+
objectId: objectId,
713+
cachePolicy: cachePolicy,
714+
completion: _completion)
712715
}
713716

714717
@discardableResult

Sources/Foundation/User.swift

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,18 @@ open class LCUser: LCObject {
183183
username: String,
184184
password: String,
185185
completionQueue: DispatchQueue = .main,
186-
completion: @escaping (LCValueResult<User>) -> Void)
187-
-> LCRequest
186+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
188187
{
188+
let completionInBackground: (LCValueResult<User>) -> Void = { result in
189+
completionQueue.async {
190+
completion(result)
191+
}
192+
}
189193
return self.logIn(
190194
application: application,
191195
username: username,
192196
password: password,
193-
completionInBackground: { result in
194-
completionQueue.async {
195-
completion(result)
196-
}
197-
})
197+
completionInBackground: completionInBackground)
198198
}
199199

200200
@discardableResult
@@ -245,18 +245,18 @@ open class LCUser: LCObject {
245245
email: String,
246246
password: String,
247247
completionQueue: DispatchQueue = .main,
248-
completion: @escaping (LCValueResult<User>) -> Void)
249-
-> LCRequest
248+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
250249
{
250+
let completionInBackground: (LCValueResult<User>) -> Void = { (result) in
251+
completionQueue.async {
252+
completion(result)
253+
}
254+
}
251255
return self.logIn(
252256
application: application,
253257
email: email,
254258
password: password,
255-
completionInBackground: { (result) in
256-
completionQueue.async {
257-
completion(result)
258-
}
259-
})
259+
completionInBackground: completionInBackground)
260260
}
261261

262262
@discardableResult
@@ -307,18 +307,18 @@ open class LCUser: LCObject {
307307
mobilePhoneNumber: String,
308308
password: String,
309309
completionQueue: DispatchQueue = .main,
310-
completion: @escaping (LCValueResult<User>) -> Void)
311-
-> LCRequest
310+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
312311
{
312+
let completionInBackground: (LCValueResult<User>) -> Void = { result in
313+
completionQueue.async {
314+
completion(result)
315+
}
316+
}
313317
return self.logIn(
314318
application: application,
315319
mobilePhoneNumber: mobilePhoneNumber,
316320
password: password,
317-
completionInBackground: { result in
318-
completionQueue.async {
319-
completion(result)
320-
}
321-
})
321+
completionInBackground: completionInBackground)
322322
}
323323

324324
@discardableResult
@@ -369,18 +369,18 @@ open class LCUser: LCObject {
369369
mobilePhoneNumber: String,
370370
verificationCode: String,
371371
completionQueue: DispatchQueue = .main,
372-
completion: @escaping (LCValueResult<User>) -> Void)
373-
-> LCRequest
372+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
374373
{
374+
let completionInBackground: (LCValueResult<User>) -> Void = { result in
375+
completionQueue.async {
376+
completion(result)
377+
}
378+
}
375379
return self.logIn(
376380
application: application,
377381
mobilePhoneNumber: mobilePhoneNumber,
378382
verificationCode: verificationCode,
379-
completionInBackground: { result in
380-
completionQueue.async {
381-
completion(result)
382-
}
383-
})
383+
completionInBackground: completionInBackground)
384384
}
385385

386386
@discardableResult
@@ -451,17 +451,17 @@ open class LCUser: LCObject {
451451
application: LCApplication = .default,
452452
sessionToken: String,
453453
completionQueue: DispatchQueue = .main,
454-
completion: @escaping (LCValueResult<User>) -> Void)
455-
-> LCRequest
454+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
456455
{
456+
let completionInBackground: (LCValueResult<User>) -> Void = { result in
457+
completionQueue.async {
458+
completion(result)
459+
}
460+
}
457461
return self.logIn(
458462
application: application,
459463
sessionToken: sessionToken,
460-
completionInBackground: { result in
461-
completionQueue.async {
462-
completion(result)
463-
}
464-
})
464+
completionInBackground: completionInBackground)
465465
}
466466

467467
@discardableResult
@@ -518,18 +518,18 @@ open class LCUser: LCObject {
518518
mobilePhoneNumber: String,
519519
verificationCode: String,
520520
completionQueue: DispatchQueue = .main,
521-
completion: @escaping (LCValueResult<User>) -> Void)
522-
-> LCRequest
521+
completion: @escaping (LCValueResult<User>) -> Void) -> LCRequest
523522
{
523+
let completionInBackground: (LCValueResult<User>) -> Void = { result in
524+
completionQueue.async {
525+
completion(result)
526+
}
527+
}
524528
return self.signUpOrLogIn(
525529
application: application,
526530
mobilePhoneNumber: mobilePhoneNumber,
527531
verificationCode: verificationCode,
528-
completionInBackground: { result in
529-
completionQueue.async {
530-
completion(result)
531-
}
532-
})
532+
completionInBackground: completionInBackground)
533533
}
534534

535535
@discardableResult

Sources/Foundation/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
import Foundation
1010

1111
public struct Version {
12-
public static let versionString = "17.9.1"
12+
public static let versionString = "17.9.2"
1313
}

0 commit comments

Comments
 (0)