Skip to content

Commit c92386d

Browse files
authored
Merge pull request #427 from zapcannon87/master
chore: resolve building warning & upgrade dependencies
2 parents 10be306 + 326f9f4 commit c92386d

File tree

8 files changed

+25
-23
lines changed

8 files changed

+25
-23
lines changed

LeanCloud.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ Pod::Spec.new do |s|
2222
end
2323

2424
s.subspec 'RTM' do |ss|
25-
ss.dependency 'SwiftProtobuf', '~> 1.15'
26-
ss.dependency 'GRDB.swift', '~> 4.14'
25+
ss.dependency 'SwiftProtobuf', '~> 1.17'
26+
ss.dependency 'GRDB.swift', '~> 5.8'
2727

2828
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
2929

3030
ss.source_files = 'Sources/RTM/**/*.{swift}'
3131
end
3232

3333
s.subspec 'RTM-no-local-storage' do |ss|
34-
ss.dependency 'SwiftProtobuf', '~> 1.15'
34+
ss.dependency 'SwiftProtobuf', '~> 1.17'
3535

3636
ss.dependency 'LeanCloud/Foundation', "#{s.version}"
3737

LeanCloud.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,15 +1208,15 @@
12081208
repositoryURL = "https://github.com/apple/swift-protobuf";
12091209
requirement = {
12101210
kind = upToNextMajorVersion;
1211-
minimumVersion = 1.15.0;
1211+
minimumVersion = 1.17.0;
12121212
};
12131213
};
12141214
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */ = {
12151215
isa = XCRemoteSwiftPackageReference;
12161216
repositoryURL = "https://github.com/groue/GRDB.swift";
12171217
requirement = {
12181218
kind = upToNextMajorVersion;
1219-
minimumVersion = 4.14.0;
1219+
minimumVersion = 5.8.0;
12201220
};
12211221
};
12221222
D35EB5BB2328A6E000763E4E /* XCRemoteSwiftPackageReference "Alamofire" */ = {

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ let package = Package(
1616
],
1717
dependencies: [
1818
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.4.0")),
19-
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.15.0")),
20-
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "4.14.0"))
19+
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.17.0")),
20+
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "5.8.0"))
2121
],
2222
targets: [
2323
.target(

Sources/RTM/IMClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ public enum IMMessageEvent {
25942594
}
25952595

25962596
/// IM Client Delegate
2597-
public protocol IMClientDelegate: class {
2597+
public protocol IMClientDelegate: AnyObject {
25982598

25992599
/// Delegate function of the event about the client.
26002600
/// - Parameters:
@@ -2613,7 +2613,7 @@ public protocol IMClientDelegate: class {
26132613
// MARK: - Signature
26142614

26152615
/// IM Signature Delegate
2616-
public protocol IMSignatureDelegate: class {
2616+
public protocol IMSignatureDelegate: AnyObject {
26172617

26182618
/// Delegate function of the signature action
26192619
///

Sources/RTM/IMLocalStorage.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,15 @@ class IMLocalStorage {
204204
init(path: String, clientID: String) throws {
205205
var configuration = Configuration()
206206
configuration.label = "\(IMLocalStorage.self).dbQueue"
207-
configuration.trace = {
208-
Logger.shared.verbose("""
209-
\n------ LeanCloud SQL Executing
210-
\(IMClient.self)<ID: \"\(clientID)\">
211-
\($0)
212-
------ END
213-
""")
207+
configuration.prepareDatabase { db in
208+
db.trace(options: .statement) { event in
209+
Logger.shared.verbose("""
210+
\n------ LeanCloud SQL Executing
211+
\(IMClient.self)<ID: \"\(clientID)\">
212+
\(event)
213+
------ END
214+
""")
215+
}
214216
}
215217
try self.dbPool = DatabasePool(path: path, configuration: configuration)
216218
}

Sources/RTM/IMMessage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ var IMCategorizedMessageTypeMap: [Int: IMCategorizedMessage.Type] = [
286286
]
287287

288288
/// IM Message Categorizing Protocol
289-
public protocol IMMessageCategorizing: class {
289+
public protocol IMMessageCategorizing: AnyObject {
290290

291291
/// Message Type is Int Type
292292
typealias MessageType = Int

Sources/RTM/RTMConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class RTMConnectionManager {
165165
}
166166
}
167167

168-
protocol RTMConnectionDelegate: class {
168+
protocol RTMConnectionDelegate: AnyObject {
169169

170170
func connection(inConnecting connection: RTMConnection)
171171

Sources/RTM/WebSocket.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct WSError: Error {
6161
}
6262

6363
//WebSocketClient is setup to be dependency injection for testing
64-
protocol WebSocketClient: class {
64+
protocol WebSocketClient: AnyObject {
6565
var delegate: WebSocketDelegate? {get set}
6666
var pongDelegate: WebSocketPongDelegate? {get set}
6767
var disableSSLCertValidation: Bool {get set}
@@ -119,7 +119,7 @@ struct SSLSettings {
119119
#endif
120120
}
121121

122-
protocol WSStreamDelegate: class {
122+
protocol WSStreamDelegate: AnyObject {
123123
func newBytesInStream()
124124
func streamDidError(error: Error?)
125125
}
@@ -315,20 +315,20 @@ class FoundationStream : NSObject, WSStream, StreamDelegate {
315315
//WebSocket implementation
316316

317317
//standard delegate you should use
318-
protocol WebSocketDelegate: class {
318+
protocol WebSocketDelegate: AnyObject {
319319
func websocketDidConnect(socket: WebSocketClient)
320320
func websocketDidDisconnect(socket: WebSocketClient, error: Error?)
321321
func websocketDidReceiveMessage(socket: WebSocketClient, text: String)
322322
func websocketDidReceiveData(socket: WebSocketClient, data: Data)
323323
}
324324

325325
//got pongs
326-
protocol WebSocketPongDelegate: class {
326+
protocol WebSocketPongDelegate: AnyObject {
327327
func websocketDidReceivePong(socket: WebSocketClient, data: Data?)
328328
}
329329

330330
// A Delegate with more advanced info on messages and connection etc.
331-
protocol WebSocketAdvancedDelegate: class {
331+
protocol WebSocketAdvancedDelegate: AnyObject {
332332
func websocketDidConnect(socket: WebSocket)
333333
func websocketDidDisconnect(socket: WebSocket, error: Error?)
334334
func websocketDidReceiveMessage(socket: WebSocket, text: String, response: WebSocket.WSResponse)

0 commit comments

Comments
 (0)