Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import WordPressFlux
while leafViewController.presentedViewController != nil && !leafViewController.presentedViewController!.isBeingDismissed {
leafViewController = leafViewController.presentedViewController!
}
leafViewController.present(self, animated: true, completion: nil)
leafViewController.present(self, animated: true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ open class WP3DTouchShortcutHandler: NSObject {
}

fileprivate func clearCurrentViewController() {
WordPressAppDelegate.sharedInstance().window!.rootViewController?.dismiss(animated: false, completion: nil)
WordPressAppDelegate.sharedInstance().window!.rootViewController?.dismiss(animated: false)
}
}
4 changes: 2 additions & 2 deletions WordPress/Classes/Utility/ContentCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ struct DefaultContentCoordinator: ContentCoordinator {

let webViewController = WebViewControllerFactory.controllerAuthenticatedWithDefaultAccount(url: url)
let navController = UINavigationController(rootViewController: webViewController)
controller?.present(navController, animated: true, completion: nil)
controller?.present(navController, animated: true)
}

func displayFullscreenImage(_ image: UIImage) {
let imageViewController = WPImageViewController(image: image)
imageViewController.modalTransitionStyle = .crossDissolve
imageViewController.modalPresentationStyle = .fullScreen
controller?.present(imageViewController, animated: true, completion: nil)
controller?.present(imageViewController, animated: true)
}

func displayPlugin(withSlug pluginSlug: String, on siteSlug: String) throws {
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Utility/ImmuTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension ImmuTablePresenter where Self: UIViewController {
return {
[unowned self] in
let controller = controllerGenerator($0)
self.present(controller, animated: true, completion: nil)
self.present(controller, animated: true)
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions WordPress/Classes/Utility/Spotlight/SearchManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ fileprivate extension SearchManager {
openListView(for: post)
let editor = EditPostViewController.init(post: post)
editor.modalPresentationStyle = .fullScreen
WPTabBarController.sharedInstance().present(editor, animated: true, completion: nil)
WPTabBarController.sharedInstance().present(editor, animated: true)
}

func openEditor(for page: Page) {
Expand All @@ -442,14 +442,14 @@ fileprivate extension SearchManager {
let editorSettings = EditorSettings()
let postViewController = editorSettings.instantiatePageEditor(page: page) { (editor, vc) in
editor.onClose = { changesSaved, _ in
vc.dismiss(animated: true, completion: nil)
vc.dismiss(animated: true)
}
}

let navController = UINavigationController(rootViewController: postViewController)
navController.restorationIdentifier = Restorer.Identifier.navigationController.rawValue
navController.modalPresentationStyle = .fullScreen
WPTabBarController.sharedInstance().present(navController, animated: true, completion: nil)
WPTabBarController.sharedInstance().present(navController, animated: true)
}

func openPreview(for apost: AbstractPost) {
Expand All @@ -461,7 +461,7 @@ fileprivate extension SearchManager {
controller.onClose = {
navWrapper.dismiss(animated: true) {}
}
WPTabBarController.sharedInstance().present(navWrapper, animated: true, completion: nil)
WPTabBarController.sharedInstance().present(navWrapper, animated: true)
openListView(for: apost)
}

Expand All @@ -475,7 +475,7 @@ fileprivate extension SearchManager {
// Do nothing — post is already loaded or PostPreviewViewController isn't visible
return
}
navController.dismiss(animated: true, completion: nil)
navController.dismiss(animated: true)
}

/// If there is any PostPreviewViewController window open, close it.
Expand All @@ -485,6 +485,6 @@ fileprivate extension SearchManager {
let _ = navController.topViewController as? PostPreviewViewController else {
return
}
navController.dismiss(animated: true, completion: nil)
navController.dismiss(animated: true)
}
}
10 changes: 5 additions & 5 deletions WordPress/Classes/Utility/WebKitViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class WebKitViewController: UIViewController {

@objc func loadWebViewRequest() {
if ReachabilityUtils.alertIsShowing() {
self.dismiss(animated: false, completion: nil)
self.dismiss(animated: false)
}

guard let authenticator = authenticator,
Expand Down Expand Up @@ -294,7 +294,7 @@ class WebKitViewController: UIViewController {
// MARK: User Actions

@objc func close() {
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}

@objc func share() {
Expand All @@ -311,7 +311,7 @@ class WebKitViewController: UIViewController {
WPActivityDefaults.trackActivityType(type)
}
}
present(activityViewController, animated: true, completion: nil)
present(activityViewController, animated: true)

}

Expand Down Expand Up @@ -393,13 +393,13 @@ extension WebKitViewController: WKUIDelegate {
let url = navigationAction.request.url {
let controller = WebKitViewController(url: url, parent: self)
let navController = UINavigationController(rootViewController: controller)
present(navController, animated: true, completion: nil)
present(navController, animated: true)
}
return nil
}

func webViewDidClose(_ webView: WKWebView) {
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}

func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Utility/ZendeskUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ private extension ZendeskUtils {
}

// Show alert
presentInController?.present(alertController, animated: true, completion: nil)
presentInController?.present(alertController, animated: true)
}

@objc static func emailTextFieldDidChange(_ textField: UITextField) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ extension ActivityListViewController: ActivityRewindPresenter {
handler: { action in
self.restoreSiteToRewindID(rewindID)
})
self.present(alertController, animated: true, completion: nil)
self.present(alertController, animated: true)
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AztecVerificationPromptHelper: NSObject {
return
}

displayedAlert.dismiss(animated: true, completion: nil)
displayedAlert.dismiss(animated: true)
self?.completionBlock?(!updatedAccount.needsEmailVerification)
}, failure: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ class AztecAttachmentViewController: UITableViewController {

@objc func handleCancelButtonTapped(sender: UIBarButtonItem) {
onCancel?()
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}

@objc func handleDoneButtonTapped(sender: UIBarButtonItem) {
let checkedAlt = alt == "" ? nil : alt
onUpdate?(alignment, size, linkURL, checkedAlt, caption)
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}

private func pushSettingsController(for row: EditableTextRow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ extension AztecPostViewController {
}

alertController.popoverPresentationController?.barButtonItem = closeBarButtonItem
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
}

private func publishPost(
Expand Down Expand Up @@ -1280,7 +1280,7 @@ extension AztecPostViewController {
let controller = FancyAlertViewController.makeAsyncPostingAlertController(action: action, isPage: isPage, onConfirm: publishBlock)
controller.modalPresentationStyle = .custom
controller.transitioningDelegate = self
self.present(controller, animated: true, completion: nil)
self.present(controller, animated: true)
}

if action.isAsync {
Expand All @@ -1297,7 +1297,7 @@ extension AztecPostViewController {
func displayMediaIsUploadingAlert() {
let alertController = UIAlertController(title: MediaUploadingAlert.title, message: MediaUploadingAlert.message, preferredStyle: .alert)
alertController.addDefaultActionWithTitle(MediaUploadingAlert.acceptTitle)
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
}

@IBAction func closeWasPressed() {
Expand Down Expand Up @@ -1354,7 +1354,7 @@ private extension AztecPostViewController {

// Setup Handlers
let successHandler: BlogSelectorSuccessHandler = { selectedObjectID in
self.dismiss(animated: true, completion: nil)
self.dismiss(animated: true)

guard let blog = self.mainContext.object(with: selectedObjectID) as? Blog else {
return
Expand All @@ -1364,7 +1364,7 @@ private extension AztecPostViewController {
}

let dismissHandler: BlogSelectorDismissHandler = {
self.dismiss(animated: true, completion: nil)
self.dismiss(animated: true)
}

// Setup Picker
Expand All @@ -1384,7 +1384,7 @@ private extension AztecPostViewController {
navigationController.configurePopoverPresentationStyle(from: sourceView)

// Done!
present(navigationController, animated: true, completion: nil)
present(navigationController, animated: true)
}

/// Presents an alert controller, allowing the user to insert a link to either:
Expand Down Expand Up @@ -1522,7 +1522,7 @@ private extension AztecPostViewController {

alert.addCancelActionWithTitle(SwitchSiteAlert.cancelTitle)

present(alert, animated: true, completion: nil)
present(alert, animated: true)
}

func displayPostSettings() {
Expand Down Expand Up @@ -1555,7 +1555,7 @@ private extension AztecPostViewController {
}

alertController.addCancelActionWithTitle(FailedMediaRemovalAlert.cancelTitle)
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
}

@IBAction func displayCancelMediaUploads() {
Expand All @@ -1564,7 +1564,7 @@ private extension AztecPostViewController {
self.mediaCoordinator.cancelUploadOfAllMedia(for: self.post)
}
alertController.addCancelActionWithTitle(MediaUploadingCancelAlert.cancelTitle)
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
return
}

Expand All @@ -1585,7 +1585,7 @@ private extension AztecPostViewController {
alertController.addDefaultActionWithTitle(publishTitle) { _ in
publishAction()
}
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
}
}

Expand Down Expand Up @@ -2398,7 +2398,7 @@ extension AztecPostViewController {
private func dismissOptionsViewController() {
switch UIDevice.current.userInterfaceIdiom {
case .pad:
dismiss(animated: true, completion: nil)
dismiss(animated: true)
default:
optionsViewController?.removeFromParent()
changeRichTextInputView(to: nil)
Expand Down Expand Up @@ -2624,11 +2624,11 @@ private extension AztecPostViewController {
self?.richTextView.edit(attachment) { htmlAttachment in
htmlAttachment.rawHTML = html
}
self?.dismiss(animated: true, completion: nil)
self?.dismiss(animated: true)
}

targetVC.onDidCancel = { [weak self] in
self?.dismiss(animated: true, completion: nil)
self?.dismiss(animated: true)
}

let navigationController = UINavigationController(rootViewController: targetVC)
Expand All @@ -2643,7 +2643,7 @@ private extension AztecPostViewController {
presentationController?.sourceView = view
presentationController?.delegate = self

present(viewController, animated: true, completion: nil)
present(viewController, animated: true)
}
}

Expand Down Expand Up @@ -2742,7 +2742,7 @@ private extension AztecPostViewController {
if let onClose = onClose {
onClose(didSave, shouldShowPostEpilogue)
} else if isModal() {
presentingViewController?.dismiss(animated: true, completion: nil)
presentingViewController?.dismiss(animated: true)
} else {
_ = navigationController?.popViewController(animated: true)
}
Expand Down Expand Up @@ -3486,7 +3486,7 @@ extension AztecPostViewController {

let navController = UINavigationController(rootViewController: controller)
navController.modalPresentationStyle = .formSheet
present(navController, animated: true, completion: nil)
present(navController, animated: true)

WPAppAnalytics.track(.editorEditedImage, withProperties: [WPAppAnalyticsKeyEditorSource: Analytics.editorSource], with: post)
}
Expand Down Expand Up @@ -3529,13 +3529,13 @@ extension AztecPostViewController {
controller.showsPlaybackControls = true
controller.player = player
player.play()
present(controller, animated: true, completion: nil)
present(controller, animated: true)
}

func displayUnableToPlayVideoAlert() {
let alertController = UIAlertController(title: MediaUnableToPlayVideoAlert.title, message: MediaUnableToPlayVideoAlert.message, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "Default action"), style: .`default`, handler: nil))
present(alertController, animated: true, completion: nil)
present(alertController, animated: true)
return
}

Expand Down Expand Up @@ -3791,15 +3791,15 @@ extension AztecPostViewController: WPMediaPickerViewControllerDelegate {
if picker != mediaPickerInputViewController?.mediaPicker {
unregisterChangeObserver()
mediaLibraryDataSource.searchCancelled()
dismiss(animated: true, completion: nil)
dismiss(animated: true)
}
}

func mediaPickerController(_ picker: WPMediaPickerViewController, didFinishPicking assets: [WPMediaAsset]) {
if picker != mediaPickerInputViewController?.mediaPicker {
unregisterChangeObserver()
mediaLibraryDataSource.searchCancelled()
dismiss(animated: true, completion: nil)
dismiss(animated: true)
mediaSelectionMethod = .fullScreenPicker
} else {
mediaSelectionMethod = .inlinePicker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ extension BlogDetailsViewController {

let alert = FancyAlertViewController.makeNotificationPrimerAlertController { (controller) in
InteractiveNotificationsManager.shared.requestAuthorization {
controller.dismiss(animated: true, completion: nil)
controller.dismiss(animated: true)
}
}
alert.modalPresentationStyle = .custom
alert.transitioningDelegate = self
self?.tabBarController?.present(alert, animated: true, completion: nil)
self?.tabBarController?.present(alert, animated: true)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ extension BlogListViewController {
func enhancedSiteCreation() {
let wizardLauncher = SiteCreationWizardLauncher()
let wizard = wizardLauncher.ui
present(wizard, animated: true, completion: nil)
present(wizard, animated: true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ open class DateAndTimeFormatSettingsViewController: UITableViewController {
navigationController?.pushViewController(webViewController, animated: true)
} else {
let navController = UINavigationController(rootViewController: webViewController)
present(navController, animated: true, completion: nil)
present(navController, animated: true)
}
}

Expand Down
Loading