Auto-migration to Swift 4.

This commit is contained in:
Matthew Chen 2018-05-25 12:54:25 -04:00
parent 6b39f73e65
commit 28f7142a59
32 changed files with 110 additions and 101 deletions

View file

@ -2593,12 +2593,12 @@
453518911FC63DBF00210559 = { 453518911FC63DBF00210559 = {
CreatedOnToolsVersion = 9.2; CreatedOnToolsVersion = 9.2;
DevelopmentTeam = U68MSDN6DR; DevelopmentTeam = U68MSDN6DR;
LastSwiftMigration = 0910; LastSwiftMigration = 0930;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
}; };
D221A088169C9E5E00537ABF = { D221A088169C9E5E00537ABF = {
DevelopmentTeam = U68MSDN6DR; DevelopmentTeam = U68MSDN6DR;
LastSwiftMigration = 0800; LastSwiftMigration = 0930;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
SystemCapabilities = { SystemCapabilities = {
com.apple.ApplicationGroups.iOS = { com.apple.ApplicationGroups.iOS = {
@ -2629,7 +2629,7 @@
}; };
D221A0A9169C9E5F00537ABF = { D221A0A9169C9E5F00537ABF = {
DevelopmentTeam = U68MSDN6DR; DevelopmentTeam = U68MSDN6DR;
LastSwiftMigration = 0800; LastSwiftMigration = 0930;
ProvisioningStyle = Automatic; ProvisioningStyle = Automatic;
TestTargetID = D221A088169C9E5E00537ABF; TestTargetID = D221A088169C9E5E00537ABF;
}; };
@ -3597,7 +3597,8 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_AFTER_BUILD = YES; TEST_AFTER_BUILD = YES;
VALID_ARCHS = "arm64 armv7 armv7s"; VALID_ARCHS = "arm64 armv7 armv7s";
WRAPPER_EXTENSION = app; WRAPPER_EXTENSION = app;
@ -3657,7 +3658,8 @@
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Signal.app/Signal";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64"; VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
}; };
@ -3901,7 +3903,8 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
@ -3978,7 +3981,8 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -4055,7 +4059,8 @@
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -4254,7 +4259,8 @@
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_AFTER_BUILD = YES; TEST_AFTER_BUILD = YES;
VALID_ARCHS = "arm64 armv7 armv7s"; VALID_ARCHS = "arm64 armv7 armv7s";
WRAPPER_EXTENSION = app; WRAPPER_EXTENSION = app;
@ -4313,7 +4319,8 @@
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/src/Signal-Bridging-Header.h";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_AFTER_BUILD = YES; TEST_AFTER_BUILD = YES;
VALID_ARCHS = "arm64 armv7 armv7s"; VALID_ARCHS = "arm64 armv7 armv7s";
WRAPPER_EXTENSION = app; WRAPPER_EXTENSION = app;
@ -4373,7 +4380,8 @@
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUNDLE_LOADER)"; TEST_HOST = "$(BUNDLE_LOADER)";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64"; VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
}; };
@ -4431,7 +4439,8 @@
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Signal/test/SignalTests-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0; SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUNDLE_LOADER)"; TEST_HOST = "$(BUNDLE_LOADER)";
VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64"; VALID_ARCHS = "arm64 armv7s armv7 i386 x86_64";
}; };

View file

@ -150,7 +150,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
func didBecomeActive() { @objc func didBecomeActive() {
if (self.isViewLoaded) { if (self.isViewLoaded) {
shouldRemoteVideoControlsBeHidden = false shouldRemoteVideoControlsBeHidden = false
} }
@ -235,7 +235,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
createSettingsNagViews() createSettingsNagViews()
} }
func didTouchRootView(sender: UIGestureRecognizer) { @objc func didTouchRootView(sender: UIGestureRecognizer) {
if !remoteVideoView.isHidden { if !remoteVideoView.isHidden {
shouldRemoteVideoControlsBeHidden = !shouldRemoteVideoControlsBeHidden shouldRemoteVideoControlsBeHidden = !shouldRemoteVideoControlsBeHidden
} }
@ -541,7 +541,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
contactAvatarView.autoPinEdge(toSuperviewEdge: .right, withInset: 0, relation: .greaterThanOrEqual) contactAvatarView.autoPinEdge(toSuperviewEdge: .right, withInset: 0, relation: .greaterThanOrEqual)
contactAvatarView.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0, relation: .greaterThanOrEqual) contactAvatarView.autoPinEdge(toSuperviewEdge: .bottom, withInset: 0, relation: .greaterThanOrEqual)
contactAvatarView.autoPinEdge(toSuperviewEdge: .left, withInset: 0, relation: .greaterThanOrEqual) contactAvatarView.autoPinEdge(toSuperviewEdge: .left, withInset: 0, relation: .greaterThanOrEqual)
NSLayoutConstraint.autoSetPriority(UILayoutPriorityDefaultLow) { NSLayoutConstraint.autoSetPriority(UILayoutPriority.defaultLow) {
contactAvatarView.autoPinEdgesToSuperviewMargins() contactAvatarView.autoPinEdgesToSuperviewMargins()
} }
@ -825,7 +825,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
/** /**
* Ends a connected call. Do not confuse with `didPressDeclineCall`. * Ends a connected call. Do not confuse with `didPressDeclineCall`.
*/ */
func didPressHangup(sender: UIButton) { @objc func didPressHangup(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
callUIAdapter.localHangupCall(call) callUIAdapter.localHangupCall(call)
@ -833,14 +833,14 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
dismissIfPossible(shouldDelay: false) dismissIfPossible(shouldDelay: false)
} }
func didPressMute(sender muteButton: UIButton) { @objc func didPressMute(sender muteButton: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
muteButton.isSelected = !muteButton.isSelected muteButton.isSelected = !muteButton.isSelected
callUIAdapter.setIsMuted(call: call, isMuted: muteButton.isSelected) callUIAdapter.setIsMuted(call: call, isMuted: muteButton.isSelected)
} }
func didPressAudioSource(sender button: UIButton) { @objc func didPressAudioSource(sender button: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
if self.hasAlternateAudioSources { if self.hasAlternateAudioSources {
@ -863,20 +863,20 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
dismissIfPossible(shouldDelay: false) dismissIfPossible(shouldDelay: false)
} }
func didPressAnswerCall(sender: UIButton) { @objc func didPressAnswerCall(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
callUIAdapter.answerCall(call) callUIAdapter.answerCall(call)
} }
func didPressVideo(sender: UIButton) { @objc func didPressVideo(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
let hasLocalVideo = !sender.isSelected let hasLocalVideo = !sender.isSelected
callUIAdapter.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo) callUIAdapter.setHasLocalVideo(call: call, hasLocalVideo: hasLocalVideo)
} }
func didPressFlipCamera(sender: UIButton) { @objc func didPressFlipCamera(sender: UIButton) {
// toggle value // toggle value
sender.isSelected = !sender.isSelected sender.isSelected = !sender.isSelected
@ -889,7 +889,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
/** /**
* Denies an incoming not-yet-connected call, Do not confuse with `didPressHangup`. * Denies an incoming not-yet-connected call, Do not confuse with `didPressHangup`.
*/ */
func didPressDeclineCall(sender: UIButton) { @objc func didPressDeclineCall(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
callUIAdapter.declineCall(call) callUIAdapter.declineCall(call)
@ -897,7 +897,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
dismissIfPossible(shouldDelay: false) dismissIfPossible(shouldDelay: false)
} }
func didPressShowCallSettings(sender: UIButton) { @objc func didPressShowCallSettings(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
markSettingsNagAsComplete() markSettingsNagAsComplete()
@ -916,7 +916,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
}) })
} }
func didPressDismissNag(sender: UIButton) { @objc func didPressDismissNag(sender: UIButton) {
Logger.info("\(TAG) called \(#function)") Logger.info("\(TAG) called \(#function)")
markSettingsNagAsComplete() markSettingsNagAsComplete()
@ -939,7 +939,7 @@ class CallViewController: OWSViewController, CallObserver, CallServiceObserver,
preferences.setIsCallKitPrivacyEnabled(preferences.isCallKitPrivacyEnabled()) preferences.setIsCallKitPrivacyEnabled(preferences.isCallKitPrivacyEnabled())
} }
func didTapLeaveCall(sender: UIButton) { @objc func didTapLeaveCall(sender: UIButton) {
OWSWindowManager.shared().leaveCallView() OWSWindowManager.shared().leaveCallView()
} }

View file

@ -214,7 +214,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
// Back Button // Back Button
let backButtonSize = CGFloat(50) let backButtonSize = CGFloat(50)
let backButton = TappableView(actionBlock: { [weak self] _ in let backButton = TappableView(actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressDismiss() strongSelf.didPressDismiss()
}) })
@ -280,21 +280,21 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_SEND_MESSAGE", stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_SEND_MESSAGE",
comment: "Label for 'sent message' button in contact view."), comment: "Label for 'sent message' button in contact view."),
imageName: "contact_view_message", imageName: "contact_view_message",
actionBlock: { [weak self] _ in actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressSendMessage() strongSelf.didPressSendMessage()
})) }))
stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_AUDIO_CALL", stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_AUDIO_CALL",
comment: "Label for 'audio call' button in contact view."), comment: "Label for 'audio call' button in contact view."),
imageName: "contact_view_audio_call", imageName: "contact_view_audio_call",
actionBlock: { [weak self] _ in actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressAudioCall() strongSelf.didPressAudioCall()
})) }))
stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_VIDEO_CALL", stackView.addArrangedSubview(createCircleActionButton(text: NSLocalizedString("ACTION_VIDEO_CALL",
comment: "Label for 'video call' button in contact view."), comment: "Label for 'video call' button in contact view."),
imageName: "contact_view_video_call", imageName: "contact_view_video_call",
actionBlock: { [weak self] _ in actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressVideoCall() strongSelf.didPressVideoCall()
})) }))
@ -307,7 +307,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
// Show invite button for system contacts without a Signal account. // Show invite button for system contacts without a Signal account.
let inviteButton = createLargePillButton(text: NSLocalizedString("ACTION_INVITE", let inviteButton = createLargePillButton(text: NSLocalizedString("ACTION_INVITE",
comment: "Label for 'invite' button in contact view."), comment: "Label for 'invite' button in contact view."),
actionBlock: { [weak self] _ in actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressInvite() strongSelf.didPressInvite()
}) })
@ -334,7 +334,7 @@ class ContactViewController: OWSViewController, ContactShareViewHelperDelegate {
// Always show "add to contacts" button. // Always show "add to contacts" button.
let addToContactsButton = createLargePillButton(text: NSLocalizedString("CONVERSATION_VIEW_ADD_TO_CONTACTS_OFFER", let addToContactsButton = createLargePillButton(text: NSLocalizedString("CONVERSATION_VIEW_ADD_TO_CONTACTS_OFFER",
comment: "Message shown in conversation view that offers to add an unknown user to your phone's contacts."), comment: "Message shown in conversation view that offers to add an unknown user to your phone's contacts."),
actionBlock: { [weak self] _ in actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressAddToContacts() strongSelf.didPressAddToContacts()
}) })

View file

@ -305,11 +305,11 @@ public class ContactsPicker: OWSViewController, UITableViewDelegate, UITableView
// MARK: - Button Actions // MARK: - Button Actions
func onTouchCancelButton() { @objc func onTouchCancelButton() {
contactsPickerDelegate?.contactsPickerDidCancel(self) contactsPickerDelegate?.contactsPickerDidCancel(self)
} }
func onTouchDoneButton() { @objc func onTouchDoneButton() {
contactsPickerDelegate?.contactsPicker(self, didSelectMultipleContacts: selectedContacts) contactsPickerDelegate?.contactsPicker(self, didSelectMultipleContacts: selectedContacts)
} }

View file

@ -110,7 +110,7 @@ public class ConversationHeaderView: UIStackView {
// MARK: Delegate Methods // MARK: Delegate Methods
func didTapView(tapGesture: UITapGestureRecognizer) { @objc func didTapView(tapGesture: UITapGestureRecognizer) {
guard tapGesture.state == .recognized else { guard tapGesture.state == .recognized else {
return return
} }

View file

@ -182,7 +182,7 @@ class CropScaleImageViewController: OWSViewController {
self.view.addSubview(contentView) self.view.addSubview(contentView)
contentView.autoPinEdgesToSuperviewEdges() contentView.autoPinEdgesToSuperviewEdges()
let imageView = OWSLayerView(frame:CGRect.zero, layoutCallback: {[weak self] _ in let imageView = OWSLayerView(frame:CGRect.zero, layoutCallback: {[weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.updateImageLayout() strongSelf.updateImageLayout()
}) })
@ -369,7 +369,7 @@ class CropScaleImageViewController: OWSViewController {
var lastPinchLocation: CGPoint = CGPoint.zero var lastPinchLocation: CGPoint = CGPoint.zero
var lastPinchScale: CGFloat = 1.0 var lastPinchScale: CGFloat = 1.0
func handlePinch(sender: UIPinchGestureRecognizer) { @objc func handlePinch(sender: UIPinchGestureRecognizer) {
switch (sender.state) { switch (sender.state) {
case .possible: case .possible:
break break
@ -426,7 +426,7 @@ class CropScaleImageViewController: OWSViewController {
var srcTranslationAtPanStart: CGPoint = CGPoint.zero var srcTranslationAtPanStart: CGPoint = CGPoint.zero
func handlePan(sender: UIPanGestureRecognizer) { @objc func handlePan(sender: UIPanGestureRecognizer) {
switch (sender.state) { switch (sender.state) {
case .possible: case .possible:
break break
@ -499,11 +499,11 @@ class CropScaleImageViewController: OWSViewController {
// MARK: - Event Handlers // MARK: - Event Handlers
func cancelPressed(sender: UIButton) { @objc func cancelPressed(sender: UIButton) {
dismiss(animated: true, completion:nil) dismiss(animated: true, completion:nil)
} }
func donePressed(sender: UIButton) { @objc func donePressed(sender: UIButton) {
let successCompletion = self.successCompletion let successCompletion = self.successCompletion
dismiss(animated: true, completion: { dismiss(animated: true, completion: {
guard let dstImage = self.generateDstImage() else { guard let dstImage = self.generateDstImage() else {

View file

@ -103,7 +103,7 @@ private class IntroducingCustomNotificationAudioExperienceUpgradeViewController:
return button return button
} }
func didTapButton(sender: UIButton) { @objc func didTapButton(sender: UIButton) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
guard let buttonAction = self.buttonAction else { guard let buttonAction = self.buttonAction else {
@ -213,7 +213,7 @@ private class IntroductingReadReceiptsExperienceUpgradeViewController: Experienc
return button return button
} }
func didTapButton(sender: UIButton) { @objc func didTapButton(sender: UIButton) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
guard let buttonAction = self.buttonAction else { guard let buttonAction = self.buttonAction else {
@ -343,7 +343,7 @@ private class IntroductingProfilesExperienceUpgradeViewController: ExperienceUpg
// MARK: - Actions // MARK: - Actions
func didTapButton(sender: UIButton) { @objc func didTapButton(sender: UIButton) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
// dismiss the modally presented view controller, then proceed. // dismiss the modally presented view controller, then proceed.
@ -382,7 +382,7 @@ private class CallKitExperienceUpgradeViewController: ExperienceUpgradeViewContr
// MARK: - Actions // MARK: - Actions
func didTapPrivacySettingsButton(sender: UIButton) { @objc func didTapPrivacySettingsButton(sender: UIButton) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
// dismiss the modally presented view controller, then proceed. // dismiss the modally presented view controller, then proceed.
@ -687,12 +687,12 @@ class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControl
super.dismiss(animated: flag, completion: completion) super.dismiss(animated: flag, completion: completion)
} }
func didTapDismissButton(sender: UIButton) { @objc func didTapDismissButton(sender: UIButton) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
self.dismiss(animated: true) self.dismiss(animated: true)
} }
func handleDismissGesture(sender: AnyObject) { @objc func handleDismissGesture(sender: AnyObject) {
Logger.debug("\(TAG) in \(#function)") Logger.debug("\(TAG) in \(#function)")
self.dismiss(animated: true) self.dismiss(animated: true)
} }

View file

@ -79,7 +79,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
progressiveSearchTimer?.invalidate() progressiveSearchTimer?.invalidate()
} }
func didBecomeActive() { @objc func didBecomeActive() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
Logger.info("\(self.TAG) \(#function)") Logger.info("\(self.TAG) \(#function)")
@ -88,7 +88,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
ensureCellState() ensureCellState()
} }
func reachabilityChanged() { @objc func reachabilityChanged() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
Logger.info("\(self.TAG) \(#function)") Logger.info("\(self.TAG) \(#function)")
@ -418,7 +418,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
// MARK: - Event Handlers // MARK: - Event Handlers
func donePressed(sender: UIButton) { @objc func donePressed(sender: UIButton) {
dismiss(animated: true, completion: nil) dismiss(animated: true, completion: nil)
} }
@ -505,7 +505,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
// MARK: - Event Handlers // MARK: - Event Handlers
func retryTapped(sender: UIGestureRecognizer) { @objc func retryTapped(sender: UIGestureRecognizer) {
guard sender.state == .recognized else { guard sender.state == .recognized else {
return return
} }

View file

@ -95,7 +95,7 @@ public class LongTextViewController: OWSViewController {
// MARK: - Actions // MARK: - Actions
func shareButtonPressed() { @objc func shareButtonPressed() {
AttachmentSharing.showShareUI(forText: messageBody) AttachmentSharing.showShareUI(forText: messageBody)
} }
} }

View file

@ -496,7 +496,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
// MARK: - Actions // MARK: - Actions
func shareButtonPressed() { @objc func shareButtonPressed() {
guard let attachmentStream = attachmentStream else { guard let attachmentStream = attachmentStream else {
Logger.error("\(logTag) Share button should only be shown with attachment, but no attachment found.") Logger.error("\(logTag) Share button should only be shown with attachment, but no attachment found.")
return return
@ -525,7 +525,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele
} }
} }
internal func yapDatabaseModified(notification: NSNotification) { @objc internal func yapDatabaseModified(notification: NSNotification) {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
guard !wasDeleted else { guard !wasDeleted else {

View file

@ -44,7 +44,7 @@ public class OWS2FAReminderViewController: UIViewController, PinEntryViewDelegat
let instructionsTextHeader = NSLocalizedString("REMINDER_2FA_BODY_HEADER", comment: "Body header for when user is periodically prompted to enter their registration lock PIN") let instructionsTextHeader = NSLocalizedString("REMINDER_2FA_BODY_HEADER", comment: "Body header for when user is periodically prompted to enter their registration lock PIN")
let instructionsTextBody = NSLocalizedString("REMINDER_2FA_BODY", comment: "Body text for when user is periodically prompted to enter their registration lock PIN") let instructionsTextBody = NSLocalizedString("REMINDER_2FA_BODY", comment: "Body text for when user is periodically prompted to enter their registration lock PIN")
let attributes = [NSFontAttributeName: pinEntryView.boldLabelFont] let attributes = [NSAttributedStringKey.font: pinEntryView.boldLabelFont]
let attributedInstructionsText = NSAttributedString(string: instructionsTextHeader, attributes: attributes).rtlSafeAppend(" ", referenceView: pinEntryView).rtlSafeAppend(instructionsTextBody, referenceView: pinEntryView) let attributedInstructionsText = NSAttributedString(string: instructionsTextHeader, attributes: attributes).rtlSafeAppend(" ", referenceView: pinEntryView).rtlSafeAppend(instructionsTextBody, referenceView: pinEntryView)

View file

@ -319,12 +319,12 @@ private class SignalCallData: NSObject {
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
func didEnterBackground() { @objc func didEnterBackground() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
self.updateIsVideoEnabled() self.updateIsVideoEnabled()
} }
func didBecomeActive() { @objc func didBecomeActive() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
self.updateIsVideoEnabled() self.updateIsVideoEnabled()
} }

View file

@ -545,7 +545,7 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
if let error = error { if let error = error {
reject(error) reject(error)
} else { } else {
fulfill() fulfill(())
} }
}) })
} }
@ -575,7 +575,7 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
reject(error) reject(error)
return return
} }
fulfill() fulfill(())
}) })
} }
@ -616,7 +616,7 @@ class PeerConnectionClient: NSObject, RTCPeerConnectionDelegate, RTCDataChannelD
reject(error) reject(error)
return return
} }
fulfill() fulfill(())
}) })
} }
return promise return promise

View file

@ -105,13 +105,13 @@ public enum PushRegistrationError: Error {
// MARK: PKPushRegistryDelegate - voIP Push Token // MARK: PKPushRegistryDelegate - voIP Push Token
public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) { public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) {
Logger.info("\(self.logTag) in \(#function)") Logger.info("\(self.logTag) in \(#function)")
assert(type == .voIP) assert(type == .voIP)
self.pushManager.application(UIApplication.shared, didReceiveRemoteNotification: payload.dictionaryPayload) self.pushManager.application(UIApplication.shared, didReceiveRemoteNotification: payload.dictionaryPayload)
} }
public func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, forType type: PKPushType) { public func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, for type: PKPushType) {
Logger.info("\(self.logTag) in \(#function)") Logger.info("\(self.logTag) in \(#function)")
assert(type == .voIP) assert(type == .voIP)
assert(credentials.type == .voIP) assert(credentials.type == .voIP)
@ -123,7 +123,7 @@ public enum PushRegistrationError: Error {
fulfillVoipTokenPromise(credentials.token) fulfillVoipTokenPromise(credentials.token)
} }
public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenForType type: PKPushType) { public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType) {
// It's not clear when this would happen. We've never previously handled it, but we should at // It's not clear when this would happen. We've never previously handled it, but we should at
// least start learning if it happens. // least start learning if it happens.
owsFail("\(self.logTag) in \(#function)") owsFail("\(self.logTag) in \(#function)")
@ -266,7 +266,7 @@ public enum PushRegistrationError: Error {
// If we've already completed registering for a voip token, resolve it immediately, // If we've already completed registering for a voip token, resolve it immediately,
// rather than waiting for the delegate method to be called. // rather than waiting for the delegate method to be called.
if let voipTokenData = voipRegistry.pushToken(forType: .voIP) { if let voipTokenData = voipRegistry.pushToken(for: .voIP) {
Logger.info("\(self.logTag) using pre-registered voIP token") Logger.info("\(self.logTag) using pre-registered voIP token")
fulfill(voipTokenData) fulfill(voipTokenData)
} }

View file

@ -220,7 +220,7 @@ import CloudKit
success(recordName) success(recordName)
} else { } else {
// No record found, saving new record. // No record found, saving new record.
guard let fileUrl = fileUrlBlock() else { guard let fileUrl = fileUrlBlock(()) else {
Logger.error("\(self.logTag) error preparing file for upload.") Logger.error("\(self.logTag) error preparing file for upload.")
failure(OWSErrorWithCodeDescription(.exportBackupError, failure(OWSErrorWithCodeDescription(.exportBackupError,
NSLocalizedString("BACKUP_EXPORT_ERROR_SAVE_FILE_TO_CLOUD_FAILED", NSLocalizedString("BACKUP_EXPORT_ERROR_SAVE_FILE_TO_CLOUD_FAILED",
@ -264,7 +264,7 @@ import CloudKit
label: "Delete Records") label: "Delete Records")
switch outcome { switch outcome {
case .success: case .success:
success() success(())
case .failureDoNotRetry(let outcomeError): case .failureDoNotRetry(let outcomeError):
failure(outcomeError) failure(outcomeError)
case .failureRetryAfterDelay(let retryDelay): case .failureRetryAfterDelay(let retryDelay):
@ -475,7 +475,7 @@ import CloudKit
DispatchQueue.global().async { DispatchQueue.global().async {
do { do {
try FileManager.default.copyItem(at: asset.fileURL, to: toFileUrl) try FileManager.default.copyItem(at: asset.fileURL, to: toFileUrl)
success() success(())
} catch { } catch {
Logger.error("\(self.logTag) couldn't copy asset file: \(error).") Logger.error("\(self.logTag) couldn't copy asset file: \(error).")
failure(invalidServiceResponseError()) failure(invalidServiceResponseError())

View file

@ -52,7 +52,7 @@ class AttachmentPointerView: UIView {
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
internal func attachmentDownloadProgress(_ notification: Notification) { @objc internal func attachmentDownloadProgress(_ notification: Notification) {
guard let attachmentId = attachmentPointer.uniqueId else { guard let attachmentId = attachmentPointer.uniqueId else {
owsFail("Missing attachment id.") owsFail("Missing attachment id.")
return return

View file

@ -65,7 +65,7 @@ class ContactCell: UITableViewCell {
} }
} }
func didChangePreferredContentSize() { @objc func didChangePreferredContentSize() {
self.titleLabel.font = UIFont.ows_dynamicTypeBody self.titleLabel.font = UIFont.ows_dynamicTypeBody
self.subtitleLabel.font = UIFont.ows_dynamicTypeSubheadline self.subtitleLabel.font = UIFont.ows_dynamicTypeSubheadline
} }
@ -130,7 +130,7 @@ fileprivate extension CNContact {
let boldDescriptor = font.fontDescriptor.withSymbolicTraits(.traitBold) let boldDescriptor = font.fontDescriptor.withSymbolicTraits(.traitBold)
let boldAttributes = [ let boldAttributes = [
NSFontAttributeName: UIFont(descriptor: boldDescriptor!, size: 0) NSAttributedStringKey.font: UIFont(descriptor: boldDescriptor!, size: 0)
] ]
if let attributedName = CNContactFormatter.attributedString(from: self, style: .fullName, defaultAttributes: nil) { if let attributedName = CNContactFormatter.attributedString(from: self, style: .fullName, defaultAttributes: nil) {

View file

@ -83,7 +83,7 @@ class QuotedReplyPreview: UIView {
self.heightConstraint.constant = size.height self.heightConstraint.constant = size.height
} }
func contentSizeCategoryDidChange(_ notification: Notification) { @objc func contentSizeCategoryDidChange(_ notification: Notification) {
Logger.debug("\(self.logTag) in \(#function)") Logger.debug("\(self.logTag) in \(#function)")
updateContents() updateContents()

View file

@ -125,7 +125,7 @@ class ReminderView: UIView {
iconView.autoSetDimension(.width, toSize: 13) iconView.autoSetDimension(.width, toSize: 13)
} }
func handleTap(gestureRecognizer: UIGestureRecognizer) { @objc func handleTap(gestureRecognizer: UIGestureRecognizer) {
tapAction() tapAction()
} }
} }

View file

@ -95,7 +95,7 @@ public class ConversationAvatarImageView: AvatarImageView {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")
} }
func handleSignalAccountsChanged(notification: Notification) { @objc func handleSignalAccountsChanged(notification: Notification) {
Logger.debug("\(self.logTag) in \(#function)") Logger.debug("\(self.logTag) in \(#function)")
// PERF: It would be nice if we could do this only if *this* user's SignalAccount changed, // PERF: It would be nice if we could do this only if *this* user's SignalAccount changed,
@ -104,7 +104,7 @@ public class ConversationAvatarImageView: AvatarImageView {
self.updateImage() self.updateImage()
} }
func handleOtherUsersProfileChanged(notification: Notification) { @objc func handleOtherUsersProfileChanged(notification: Notification) {
Logger.debug("\(self.logTag) in \(#function)") Logger.debug("\(self.logTag) in \(#function)")
guard let changedRecipientId = notification.userInfo?[kNSNotificationKey_ProfileRecipientId] as? String else { guard let changedRecipientId = notification.userInfo?[kNSNotificationKey_ProfileRecipientId] as? String else {
@ -126,7 +126,7 @@ public class ConversationAvatarImageView: AvatarImageView {
self.updateImage() self.updateImage()
} }
func handleGroupAvatarChanged(notification: Notification) { @objc func handleGroupAvatarChanged(notification: Notification) {
Logger.debug("\(self.logTag) in \(#function)") Logger.debug("\(self.logTag) in \(#function)")
guard let changedGroupThreadId = notification.userInfo?[TSGroupThread_NotificationKey_UniqueId] as? String else { guard let changedGroupThreadId = notification.userInfo?[TSGroupThread_NotificationKey_UniqueId] as? String else {

View file

@ -23,7 +23,7 @@ public class TappableStackView: UIStackView {
self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(wasTapped))) self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(wasTapped)))
} }
func wasTapped(sender: UIGestureRecognizer) { @objc func wasTapped(sender: UIGestureRecognizer) {
Logger.info("\(logTag) \(#function)") Logger.info("\(logTag) \(#function)")
guard sender.state == .recognized else { guard sender.state == .recognized else {

View file

@ -22,7 +22,7 @@ public class TappableView: UIView {
self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(wasTapped))) self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(wasTapped)))
} }
func wasTapped(sender: UIGestureRecognizer) { @objc func wasTapped(sender: UIGestureRecognizer) {
Logger.info("\(logTag) \(#function)") Logger.info("\(logTag) \(#function)")
guard sender.state == .recognized else { guard sender.state == .recognized else {

View file

@ -216,7 +216,7 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
} }
} }
public func didTapPlayerView(_ gestureRecognizer: UIGestureRecognizer) { @objc public func didTapPlayerView(_ gestureRecognizer: UIGestureRecognizer) {
assert(self.videoPlayer != nil) assert(self.videoPlayer != nil)
self.pauseVideo() self.pauseVideo()
} }
@ -251,7 +251,7 @@ public class AttachmentApprovalViewController: OWSViewController, CaptioningTool
self.playVideo() self.playVideo()
} }
func cancelPressed(sender: UIButton) { @objc func cancelPressed(sender: UIButton) {
self.delegate?.attachmentApproval(self, didCancelAttachment: attachment) self.delegate?.attachmentApproval(self, didCancelAttachment: attachment)
} }
@ -619,7 +619,7 @@ class CaptioningToolbar: UIView, UITextViewDelegate {
bottomGradient.autoPinEdgesToSuperviewEdges(with: .zero, excludingEdge: .top) bottomGradient.autoPinEdgesToSuperviewEdges(with: .zero, excludingEdge: .top)
} }
func didTapSend() { @objc func didTapSend() {
self.captioningToolbarDelegate?.captioningToolbarDidTapSend(self, captionText: self.textView.text) self.captioningToolbarDelegate?.captioningToolbarDidTapSend(self, captionText: self.textView.text)
} }

View file

@ -203,7 +203,7 @@ class ContactShareFieldView: UIStackView {
self.addArrangedSubview(previewView) self.addArrangedSubview(previewView)
} }
func wasTapped(sender: UIGestureRecognizer) { @objc func wasTapped(sender: UIGestureRecognizer) {
Logger.info("\(self.logTag) \(#function)") Logger.info("\(self.logTag) \(#function)")
guard sender.state == .recognized else { guard sender.state == .recognized else {
@ -401,7 +401,7 @@ public class ContactShareApprovalViewController: OWSViewController, EditContactS
func createNameRow() -> UIView { func createNameRow() -> UIView {
let nameVMargin = CGFloat(16) let nameVMargin = CGFloat(16)
let stackView = TappableStackView(actionBlock: { [weak self] _ in let stackView = TappableStackView(actionBlock: { [weak self]
guard let strongSelf = self else { return } guard let strongSelf = self else { return }
strongSelf.didPressEditName() strongSelf.didPressEditName()
}) })
@ -447,7 +447,7 @@ public class ContactShareApprovalViewController: OWSViewController, EditContactS
// MARK: - // MARK: -
func didPressSendButton() { @objc func didPressSendButton() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
guard isAtLeastOneFieldSelected() else { guard isAtLeastOneFieldSelected() else {
@ -475,7 +475,7 @@ public class ContactShareApprovalViewController: OWSViewController, EditContactS
delegate.approveContactShare(self, didApproveContactShare: filteredContactShare) delegate.approveContactShare(self, didApproveContactShare: filteredContactShare)
} }
func didPressCancel() { @objc func didPressCancel() {
Logger.info("\(logTag) \(#function)") Logger.info("\(logTag) \(#function)")
guard let delegate = self.delegate else { guard let delegate = self.delegate else {

View file

@ -76,7 +76,7 @@ class ContactNameFieldView: UIView {
valueView.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged) valueView.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged)
} }
func wasTapped(sender: UIGestureRecognizer) { @objc func wasTapped(sender: UIGestureRecognizer) {
Logger.info("\(self.logTag) \(#function)") Logger.info("\(self.logTag) \(#function)")
guard sender.state == .recognized else { guard sender.state == .recognized else {
@ -86,7 +86,7 @@ class ContactNameFieldView: UIView {
valueView.becomeFirstResponder() valueView.becomeFirstResponder()
} }
func textFieldDidChange(sender: UITextField) { @objc func textFieldDidChange(sender: UITextField) {
Logger.info("\(self.logTag) \(#function)") Logger.info("\(self.logTag) \(#function)")
hasUnsavedChanges = true hasUnsavedChanges = true
@ -285,7 +285,7 @@ public class EditContactShareNameViewController: OWSViewController, ContactNameF
// MARK: - // MARK: -
func didPressSave() { @objc func didPressSave() {
Logger.info("\(logTag) \(#function)") Logger.info("\(logTag) \(#function)")
guard let newName = OWSContactName() else { guard let newName = OWSContactName() else {
@ -315,7 +315,7 @@ public class EditContactShareNameViewController: OWSViewController, ContactNameF
navigationController.popViewController(animated: true) navigationController.popViewController(animated: true)
} }
func didPressCancel() { @objc func didPressCancel() {
Logger.info("\(logTag) \(#function)") Logger.info("\(logTag) \(#function)")
guard let navigationController = self.navigationController else { guard let navigationController = self.navigationController else {

View file

@ -164,7 +164,7 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
// it's superview is big enough to contain it. // it's superview is big enough to contain it.
stackView.autoPinWidthToSuperview() stackView.autoPinWidthToSuperview()
stackView.autoVCenterInSuperview() stackView.autoVCenterInSuperview()
NSLayoutConstraint.autoSetPriority(UILayoutPriorityDefaultLow) { NSLayoutConstraint.autoSetPriority(UILayoutPriority.defaultLow) {
stackView.autoPinHeightToSuperview() stackView.autoPinHeightToSuperview()
} }
stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual) stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual)
@ -277,7 +277,7 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate {
// it's superview is big enough to contain it. // it's superview is big enough to contain it.
stackView.autoPinWidthToSuperview() stackView.autoPinWidthToSuperview()
stackView.autoVCenterInSuperview() stackView.autoVCenterInSuperview()
NSLayoutConstraint.autoSetPriority(UILayoutPriorityDefaultLow) { NSLayoutConstraint.autoSetPriority(UILayoutPriority.defaultLow) {
stackView.autoPinHeightToSuperview() stackView.autoPinHeightToSuperview()
} }
stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual) stackView.autoPinEdge(toSuperviewEdge: .top, withInset: 0, relation: .greaterThanOrEqual)

View file

@ -200,11 +200,11 @@ public class MessageApprovalViewController: OWSViewController, UITextViewDelegat
// MARK: - Event Handlers // MARK: - Event Handlers
func cancelPressed(sender: UIButton) { @objc func cancelPressed(sender: UIButton) {
delegate?.messageApprovalDidCancel(self) delegate?.messageApprovalDidCancel(self)
} }
func sendPressed(sender: UIButton) { @objc func sendPressed(sender: UIButton) {
delegate?.messageApproval(self, didApproveMessage: self.textView.text) delegate?.messageApproval(self, didApproveMessage: self.textView.text)
} }

View file

@ -958,7 +958,7 @@ public class SignalAttachment: NSObject {
} }
exportSession.shouldOptimizeForNetworkUse = true exportSession.shouldOptimizeForNetworkUse = true
exportSession.outputFileType = AVFileTypeMPEG4 exportSession.outputFileType = AVFileType.mp4
exportSession.metadataItemFilter = AVMetadataItemFilter.forSharing() exportSession.metadataItemFilter = AVMetadataItemFilter.forSharing()
let exportURL = videoTempPath.appendingPathComponent(UUID().uuidString).appendingPathExtension("mp4") let exportURL = videoTempPath.appendingPathComponent(UUID().uuidString).appendingPathExtension("mp4")

View file

@ -112,7 +112,7 @@ public class PlayerProgressBar: UIView {
// Configure controls // Configure controls
let kLabelFont = UIFont.monospacedDigitSystemFont(ofSize: 12, weight: UIFontWeightRegular) let kLabelFont = UIFont.monospacedDigitSystemFont(ofSize: 12, weight: UIFont.Weight.regular)
positionLabel.font = kLabelFont positionLabel.font = kLabelFont
remainingLabel.font = kLabelFont remainingLabel.font = kLabelFont

View file

@ -132,7 +132,7 @@ public class ModalActivityIndicatorViewController: OWSViewController {
self.presentTimer = nil self.presentTimer = nil
} }
func presentTimerFired() { @objc func presentTimerFired() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
clearTimer() clearTimer()
@ -143,7 +143,7 @@ public class ModalActivityIndicatorViewController: OWSViewController {
} }
} }
func cancelPressed() { @objc func cancelPressed() {
SwiftAssertIsOnMainThread(#function) SwiftAssertIsOnMainThread(#function)
wasCancelled = true wasCancelled = true

View file

@ -30,7 +30,7 @@ public class OWS106EnsureProfileComplete: OWSDatabaseMigration {
Logger.error("\(self.TAG) Failed.") Logger.error("\(self.TAG) Failed.")
} }
completion() completion(())
}) })
type(of: self).sharedCompleteRegistrationFixerJob = job type(of: self).sharedCompleteRegistrationFixerJob = job
@ -98,7 +98,7 @@ public class OWS106EnsureProfileComplete: OWSDatabaseMigration {
ProfileFetcherJob(networkManager: networkManager).getProfile(recipientId: localRecipientId).then { _ -> Void in ProfileFetcherJob(networkManager: networkManager).getProfile(recipientId: localRecipientId).then { _ -> Void in
Logger.info("\(self.TAG) verified recipient profile is in good shape: \(localRecipientId)") Logger.info("\(self.TAG) verified recipient profile is in good shape: \(localRecipientId)")
fulfill() fulfill(())
}.catch { error in }.catch { error in
switch error { switch error {
case SignalServiceProfile.ValidationError.invalidIdentityKey(let description): case SignalServiceProfile.ValidationError.invalidIdentityKey(let description):
@ -107,7 +107,7 @@ public class OWS106EnsureProfileComplete: OWSDatabaseMigration {
TSPreKeyManager.registerPreKeys(with: .signedAndOneTime, TSPreKeyManager.registerPreKeys(with: .signedAndOneTime,
success: { success: {
Logger.info("\(self.TAG) successfully uploaded pre-keys. Profile should be fixed.") Logger.info("\(self.TAG) successfully uploaded pre-keys. Profile should be fixed.")
fulfill() fulfill(())
}, },
failure: { _ in failure: { _ in
reject(OWSErrorWithCodeDescription(.signalServiceFailure, "\(self.TAG) Unknown error in \(#function)")) reject(OWSErrorWithCodeDescription(.signalServiceFailure, "\(self.TAG) Unknown error in \(#function)"))

View file

@ -21,22 +21,22 @@ public class OWSMessagesBubbleImageFactory: NSObject {
}() }()
public lazy var incoming: JSQMessagesBubbleImage = { public lazy var incoming: JSQMessagesBubbleImage = {
let color = bubbleColorIncoming let color = OWSMessagesBubbleImageFactory.bubbleColorIncoming
return self.incoming(color: color) return self.incoming(color: color)
}() }()
public lazy var outgoing: JSQMessagesBubbleImage = { public lazy var outgoing: JSQMessagesBubbleImage = {
let color = bubbleColorOutgoingSent let color = OWSMessagesBubbleImageFactory.bubbleColorOutgoingSent
return self.outgoing(color: color) return self.outgoing(color: color)
}() }()
public lazy var currentlyOutgoing: JSQMessagesBubbleImage = { public lazy var currentlyOutgoing: JSQMessagesBubbleImage = {
let color = bubbleColorOutgoingSending let color = OWSMessagesBubbleImageFactory.bubbleColorOutgoingSending
return self.outgoing(color: color) return self.outgoing(color: color)
}() }()
public lazy var outgoingFailed: JSQMessagesBubbleImage = { public lazy var outgoingFailed: JSQMessagesBubbleImage = {
let color = bubbleColorOutgoingUnsent let color = OWSMessagesBubbleImageFactory.bubbleColorOutgoingUnsent
return self.outgoing(color: color) return self.outgoing(color: color)
}() }()