Migrate to Swift 4.

pull/1/head
Matthew Chen 7 years ago
parent 77b72b6b06
commit b2b62880c0

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
import Foundation
@ -12,7 +12,7 @@ import SignalMessaging
* Syncing is accomplished via the existing contact syncing mechanism, except the only contact synced is ourself. It's incumbent on the linked device
* to treat this "self contact" record specially.
*/
@objc class MultiDeviceProfileKeyUpdateJob: NSObject {
@objc public class MultiDeviceProfileKeyUpdateJob: NSObject {
let TAG = "[MultiDeviceProfileKeyUpdateJob]"
@ -21,7 +21,7 @@ import SignalMessaging
let messageSender: MessageSender
let profileManager: OWSProfileManager
required init(profileKey: OWSAES256Key, identityManager: OWSIdentityManager, messageSender: MessageSender, profileManager: OWSProfileManager) {
@objc public required init(profileKey: OWSAES256Key, identityManager: OWSIdentityManager, messageSender: MessageSender, profileManager: OWSProfileManager) {
self.profileKey = profileKey
self.identityManager = identityManager

@ -7,7 +7,7 @@ import PromiseKit
import SignalServiceKit
@objc(OWSSessionResetJob)
class SessionResetJob: NSObject {
public class SessionResetJob: NSObject {
let TAG = "SessionResetJob"
@ -16,7 +16,7 @@ class SessionResetJob: NSObject {
let primaryStorage: OWSPrimaryStorage
let messageSender: MessageSender
required init(recipientId: String, thread: TSThread, messageSender: MessageSender, primaryStorage: OWSPrimaryStorage) {
@objc public required init(recipientId: String, thread: TSThread, messageSender: MessageSender, primaryStorage: OWSPrimaryStorage) {
self.thread = thread
self.recipientId = recipientId
self.messageSender = messageSender

@ -338,7 +338,7 @@ private class SignalCallData: NSObject {
/**
* Choose whether to use CallKit or a Notification backed interface for calling.
*/
public func createCallUIAdapter() {
@objc public func createCallUIAdapter() {
SwiftAssertIsOnMainThread(#function)
if self.call != nil {

@ -167,7 +167,7 @@ extension CallUIAdaptee {
adaptee.answerCall(call)
}
internal func declineCall(localId: UUID) {
@objc public func declineCall(localId: UUID) {
SwiftAssertIsOnMainThread(#function)
adaptee.declineCall(localId: localId)
@ -187,7 +187,7 @@ extension CallUIAdaptee {
}
}
internal func startAndShowOutgoingCall(recipientId: String, hasLocalVideo: Bool) {
@objc public func startAndShowOutgoingCall(recipientId: String, hasLocalVideo: Bool) {
SwiftAssertIsOnMainThread(#function)
adaptee.startAndShowOutgoingCall(recipientId: recipientId, hasLocalVideo: hasLocalVideo)

@ -5,11 +5,11 @@
import Foundation
import UIKit
@objc class TextFieldHelper: NSObject {
@objc public class TextFieldHelper: NSObject {
// Used to implement the UITextFieldDelegate method: `textField:shouldChangeCharactersInRange:replacementString`
// Takes advantage of Swift's superior unicode handling to append partial pasted text without splitting multi-byte characters.
class func textField(_ textField: UITextField, shouldChangeCharactersInRange editingRange: NSRange, replacementString: String, byteLimit: UInt) -> Bool {
@objc public class func textField(_ textField: UITextField, shouldChangeCharactersInRange editingRange: NSRange, replacementString: String, byteLimit: UInt) -> Bool {
let byteLength = { (string: String) -> UInt in
return UInt(string.utf8.count)

Loading…
Cancel
Save