diff --git a/WordPress/Classes/System/3DTouch/WP3DTouchShortcutCreator.swift b/WordPress/Classes/System/3DTouch/WP3DTouchShortcutCreator.swift index a101ef5ea2bb..7043a95b0378 100644 --- a/WordPress/Classes/System/3DTouch/WP3DTouchShortcutCreator.swift +++ b/WordPress/Classes/System/3DTouch/WP3DTouchShortcutCreator.swift @@ -17,7 +17,6 @@ open class WP3DTouchShortcutCreator: NSObject { enum LoggedIn3DTouchShortcutIndex: Int { case notifications = 0, stats, - newPhotoPost, newPost } @@ -27,7 +26,6 @@ open class WP3DTouchShortcutCreator: NSObject { fileprivate let logInShortcutIconImageName = "icon-shortcut-signin" fileprivate let notificationsShortcutIconImageName = "icon-shortcut-notifications" fileprivate let statsShortcutIconImageName = "icon-shortcut-stats" - fileprivate let newPhotoPostShortcutIconImageName = "icon-shortcut-new-photo" fileprivate let newPostShortcutIconImageName = "icon-shortcut-new-post" public init(shortcutsProvider: ApplicationShortcutsProvider) { @@ -92,19 +90,13 @@ open class WP3DTouchShortcutCreator: NSObject { icon: UIApplicationShortcutIcon(templateImageName: statsShortcutIconImageName), userInfo: [WP3DTouchShortcutHandler.applicationShortcutUserInfoIconKey: WP3DTouchShortcutHandler.ShortcutIdentifier.Stats.rawValue as NSSecureCoding]) - let newPhotoPostShortcut = UIMutableApplicationShortcutItem(type: WP3DTouchShortcutHandler.ShortcutIdentifier.NewPhotoPost.type, - localizedTitle: NSLocalizedString("New Photo Post", comment: "New Photo Post 3D Touch Shortcut"), - localizedSubtitle: defaultBlogName, - icon: UIApplicationShortcutIcon(templateImageName: newPhotoPostShortcutIconImageName), - userInfo: [WP3DTouchShortcutHandler.applicationShortcutUserInfoIconKey: WP3DTouchShortcutHandler.ShortcutIdentifier.NewPhotoPost.rawValue as NSSecureCoding]) - let newPostShortcut = UIMutableApplicationShortcutItem(type: WP3DTouchShortcutHandler.ShortcutIdentifier.NewPost.type, localizedTitle: NSLocalizedString("New Post", comment: "New Post 3D Touch Shortcut"), localizedSubtitle: defaultBlogName, icon: UIApplicationShortcutIcon(templateImageName: newPostShortcutIconImageName), userInfo: [WP3DTouchShortcutHandler.applicationShortcutUserInfoIconKey: WP3DTouchShortcutHandler.ShortcutIdentifier.NewPost.rawValue as NSSecureCoding]) - return [notificationsShortcut, statsShortcut, newPhotoPostShortcut, newPostShortcut] + return [notificationsShortcut, statsShortcut, newPostShortcut] } @objc fileprivate func createLoggedInShortcuts() { @@ -126,7 +118,6 @@ open class WP3DTouchShortcutCreator: NSObject { } if AppConfiguration.allowsNewPostShortcut { - visibleShortcutArray.append(entireShortcutArray[LoggedIn3DTouchShortcutIndex.newPhotoPost.rawValue]) visibleShortcutArray.append(entireShortcutArray[LoggedIn3DTouchShortcutIndex.newPost.rawValue]) } diff --git a/WordPress/Classes/System/3DTouch/WP3DTouchShortcutHandler.swift b/WordPress/Classes/System/3DTouch/WP3DTouchShortcutHandler.swift index 2127f862ee8c..b7f5b13e85eb 100644 --- a/WordPress/Classes/System/3DTouch/WP3DTouchShortcutHandler.swift +++ b/WordPress/Classes/System/3DTouch/WP3DTouchShortcutHandler.swift @@ -5,7 +5,6 @@ open class WP3DTouchShortcutHandler: NSObject { enum ShortcutIdentifier: String { case LogIn case NewPost - case NewPhotoPost case Stats case Notifications @@ -33,11 +32,7 @@ open class WP3DTouchShortcutHandler: NSObject { return true case ShortcutIdentifier.NewPost.type: WPAnalytics.track(.shortcutNewPost) - rootViewPresenter.showPostTab(animated: false, toMedia: false) - return true - case ShortcutIdentifier.NewPhotoPost.type: - WPAnalytics.track(.shortcutNewPhotoPost) - rootViewPresenter.showPostTab(animated: false, toMedia: true) + rootViewPresenter.showPostTab(animated: false) return true case ShortcutIdentifier.Stats.type: WPAnalytics.track(.shortcutStats) diff --git a/WordPress/Classes/System/RootViewPresenter+EditorNavigation.swift b/WordPress/Classes/System/RootViewPresenter+EditorNavigation.swift index be350db9f413..4d160fb8a8c4 100644 --- a/WordPress/Classes/System/RootViewPresenter+EditorNavigation.swift +++ b/WordPress/Classes/System/RootViewPresenter+EditorNavigation.swift @@ -19,7 +19,7 @@ extension RootViewPresenter { if Blog.count(in: context) == 0 { mySitesCoordinator.showAddNewSite() } else { - showPostTab(animated: true, toMedia: false, completion: afterDismiss) + showPostTab(animated: true, completion: afterDismiss) } } @@ -28,12 +28,11 @@ extension RootViewPresenter { if Blog.count(in: context) == 0 { mySitesCoordinator.showAddNewSite() } else { - showPostTab(animated: true, toMedia: false, blog: blog) + showPostTab(animated: true, blog: blog) } } func showPostTab(animated: Bool, - toMedia openToMedia: Bool, blog: Blog? = nil, completion afterDismiss: (() -> Void)? = nil) { if rootViewController.presentedViewController != nil { @@ -47,7 +46,6 @@ extension RootViewPresenter { let editor = EditPostViewController(blog: blog) editor.modalPresentationStyle = .fullScreen editor.showImmediately = !animated - editor.openWithMediaPicker = openToMedia editor.afterDismiss = afterDismiss let properties = [WPAppAnalyticsKeyTapSource: "create_button", WPAppAnalyticsKeyPostType: "post"] diff --git a/WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift b/WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift index eb16bdbd8857..36a87b9a9637 100644 --- a/WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift +++ b/WordPress/Classes/ViewRelated/Aztec/ViewControllers/AztecPostViewController.swift @@ -56,10 +56,6 @@ class AztecPostViewController: UIViewController, PostEditor { var editorSession: PostEditorAnalyticsSession - /// Indicates if Aztec was launched for Photo Posting - /// - var isOpenedDirectlyForPhotoPost = false - var postIsReblogged: Bool = false let navigationBarManager = PostEditorNavigationBarManager() @@ -549,10 +545,6 @@ class AztecPostViewController: UIViewController, PostEditor { configureConstraints() view.setNeedsUpdateConstraints() - if isOpenedDirectlyForPhotoPost { - presentMediaPickerFullScreen(animated: false) - } - if !editorSession.started { editorSession.start() } diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index ac1ce89c7858..a60d99538319 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -100,8 +100,6 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega var onClose: ((Bool, Bool) -> Void)? - var isOpenedDirectlyForPhotoPost: Bool = false - var postIsReblogged: Bool = false var isEditorClosing: Bool = false @@ -140,29 +138,6 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega mediaToInsertOnPost = [] } - private func showMediaSelectionOnStart() { - isOpenedDirectlyForPhotoPost = false - mediaPickerHelper.presentMediaPickerFullScreen(animated: true, - filter: .image, - dataSourceType: .device, - allowMultipleSelection: false, - callback: {(asset) in - guard let phAsset = asset as? [PHAsset] else { - return - } - self.mediaInserterHelper.insertFromDevice(assets: phAsset, callback: { media in - guard let media = media, - let mediaInfo = media.first, - let mediaID = mediaInfo.id, - let mediaURLString = mediaInfo.url, - let mediaURL = URL(string: mediaURLString) else { - return - } - self.gutenberg.appendMedia(id: mediaID, url: mediaURL, type: .image) - }) - }) - } - private func editMedia(with mediaUrl: URL, callback: @escaping MediaPickerDidPickMediaCallback) { let image = GutenbergMediaEditorImage(url: mediaUrl, post: post) @@ -969,9 +944,6 @@ extension GutenbergViewController: GutenbergBridgeDelegate { } if isFirstGutenbergLayout { insertPrePopulatedMedia() - if isOpenedDirectlyForPhotoPost { - showMediaSelectionOnStart() - } focusTitleIfNeeded() mediaInserterHelper.refreshMediaStatus() } diff --git a/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift b/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift index 6c0d2acfee30..c4dc8df0c3f7 100644 --- a/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift @@ -9,8 +9,6 @@ class EditPostViewController: UIViewController { /// appear instantly, without animations @objc var showImmediately: Bool = false - /// appear with the media picker open - @objc var openWithMediaPicker: Bool = false /// appear with the post epilogue visible @objc var openWithPostPost: Bool = false /// appear with media pre-inserted into the post @@ -157,9 +155,6 @@ class EditPostViewController: UIViewController { } private func showEditor(_ editor: EditorViewController) { - editor.isOpenedDirectlyForPhotoPost = openWithMediaPicker - // only open the media picker once. - openWithMediaPicker = false editor.onClose = { [weak self, weak editor] changesSaved, showPostEpilogue in guard let strongSelf = self else { editor?.dismiss(animated: true) {} diff --git a/WordPress/Classes/ViewRelated/Post/PostEditor.swift b/WordPress/Classes/ViewRelated/Post/PostEditor.swift index 55910df9485a..9659e966968d 100644 --- a/WordPress/Classes/ViewRelated/Post/PostEditor.swift +++ b/WordPress/Classes/ViewRelated/Post/PostEditor.swift @@ -26,10 +26,6 @@ protocol PostEditor: PublishingEditor, UIViewControllerTransitioningDelegate { /// var post: AbstractPost { get set } - /// Whether the editor should open directly to the media picker. - /// - var isOpenedDirectlyForPhotoPost: Bool { get set } - /// Initializer /// /// - Parameters: