Skip to content

Commit

Permalink
Merge pull request #427 from zapcannon87/master
Browse files Browse the repository at this point in the history
chore: resolve building warning & upgrade dependencies
  • Loading branch information
zapcannon87 authored Jun 21, 2021
2 parents 10be306 + 326f9f4 commit c92386d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 23 deletions.
6 changes: 3 additions & 3 deletions LeanCloud.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ Pod::Spec.new do |s|
end

s.subspec 'RTM' do |ss|
ss.dependency 'SwiftProtobuf', '~> 1.15'
ss.dependency 'GRDB.swift', '~> 4.14'
ss.dependency 'SwiftProtobuf', '~> 1.17'
ss.dependency 'GRDB.swift', '~> 5.8'

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions LeanCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1208,15 +1208,15 @@
repositoryURL = "https://github.com/apple/swift-protobuf";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.15.0;
minimumVersion = 1.17.0;
};
};
D303BD792328D062004AE13D /* XCRemoteSwiftPackageReference "GRDB" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/groue/GRDB.swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.14.0;
minimumVersion = 5.8.0;
};
};
D35EB5BB2328A6E000763E4E /* XCRemoteSwiftPackageReference "Alamofire" */ = {
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.4.0")),
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.15.0")),
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "4.14.0"))
.package(url: "https://github.com/apple/swift-protobuf.git", .upToNextMajor(from: "1.17.0")),
.package(url: "https://github.com/groue/GRDB.swift.git", .upToNextMajor(from: "5.8.0"))
],
targets: [
.target(
Expand Down
4 changes: 2 additions & 2 deletions Sources/RTM/IMClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,7 @@ public enum IMMessageEvent {
}

/// IM Client Delegate
public protocol IMClientDelegate: class {
public protocol IMClientDelegate: AnyObject {

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

/// IM Signature Delegate
public protocol IMSignatureDelegate: class {
public protocol IMSignatureDelegate: AnyObject {

/// Delegate function of the signature action
///
Expand Down
16 changes: 9 additions & 7 deletions Sources/RTM/IMLocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,15 @@ class IMLocalStorage {
init(path: String, clientID: String) throws {
var configuration = Configuration()
configuration.label = "\(IMLocalStorage.self).dbQueue"
configuration.trace = {
Logger.shared.verbose("""
\n------ LeanCloud SQL Executing
\(IMClient.self)<ID: \"\(clientID)\">
\($0)
------ END
""")
configuration.prepareDatabase { db in
db.trace(options: .statement) { event in
Logger.shared.verbose("""
\n------ LeanCloud SQL Executing
\(IMClient.self)<ID: \"\(clientID)\">
\(event)
------ END
""")
}
}
try self.dbPool = DatabasePool(path: path, configuration: configuration)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/RTM/IMMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ var IMCategorizedMessageTypeMap: [Int: IMCategorizedMessage.Type] = [
]

/// IM Message Categorizing Protocol
public protocol IMMessageCategorizing: class {
public protocol IMMessageCategorizing: AnyObject {

/// Message Type is Int Type
typealias MessageType = Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/RTM/RTMConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class RTMConnectionManager {
}
}

protocol RTMConnectionDelegate: class {
protocol RTMConnectionDelegate: AnyObject {

func connection(inConnecting connection: RTMConnection)

Expand Down
10 changes: 5 additions & 5 deletions Sources/RTM/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct WSError: Error {
}

//WebSocketClient is setup to be dependency injection for testing
protocol WebSocketClient: class {
protocol WebSocketClient: AnyObject {
var delegate: WebSocketDelegate? {get set}
var pongDelegate: WebSocketPongDelegate? {get set}
var disableSSLCertValidation: Bool {get set}
Expand Down Expand Up @@ -119,7 +119,7 @@ struct SSLSettings {
#endif
}

protocol WSStreamDelegate: class {
protocol WSStreamDelegate: AnyObject {
func newBytesInStream()
func streamDidError(error: Error?)
}
Expand Down Expand Up @@ -315,20 +315,20 @@ class FoundationStream : NSObject, WSStream, StreamDelegate {
//WebSocket implementation

//standard delegate you should use
protocol WebSocketDelegate: class {
protocol WebSocketDelegate: AnyObject {
func websocketDidConnect(socket: WebSocketClient)
func websocketDidDisconnect(socket: WebSocketClient, error: Error?)
func websocketDidReceiveMessage(socket: WebSocketClient, text: String)
func websocketDidReceiveData(socket: WebSocketClient, data: Data)
}

//got pongs
protocol WebSocketPongDelegate: class {
protocol WebSocketPongDelegate: AnyObject {
func websocketDidReceivePong(socket: WebSocketClient, data: Data?)
}

// A Delegate with more advanced info on messages and connection etc.
protocol WebSocketAdvancedDelegate: class {
protocol WebSocketAdvancedDelegate: AnyObject {
func websocketDidConnect(socket: WebSocket)
func websocketDidDisconnect(socket: WebSocket, error: Error?)
func websocketDidReceiveMessage(socket: WebSocket, text: String, response: WebSocket.WSResponse)
Expand Down

0 comments on commit c92386d

Please sign in to comment.