-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to UIMenu in site icon picker flow
- Loading branch information
Showing
7 changed files
with
176 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import UIKit | ||
import Gridicons | ||
|
||
struct MediaPickerMenu { | ||
static func makePickFromPhotosAction(_ handler: @escaping () -> Void) -> UIAction { | ||
UIAction( | ||
title: Strings.pickFromPhotosLibrary, | ||
image: UIImage(systemName: "photo.on.rectangle.angled"), | ||
attributes: [], | ||
handler: { _ in handler() } | ||
) | ||
} | ||
|
||
static func makeTakePhotoAction(_ handler: @escaping () -> Void) -> UIAction { | ||
UIAction( | ||
title: Strings.takePhoto, | ||
image: UIImage(systemName: "camera"), | ||
attributes: [], | ||
handler: { _ in handler() } | ||
) | ||
} | ||
|
||
static func makePickFromMediaAction(_ handler: @escaping () -> Void) -> UIAction { | ||
UIAction( | ||
title: Strings.pickFromMedia, | ||
image: UIImage(systemName: "photo.stack"), | ||
attributes: [], | ||
handler: { _ in handler() } | ||
) | ||
} | ||
} | ||
|
||
private enum Strings { | ||
static let pickFromPhotosLibrary = NSLocalizedString("mediaPicker.pickFromPhotosLibrary", value: "Choose from Device", comment: "The name of the action in the context menu") | ||
static let takePhoto = NSLocalizedString("mediaPicker.takePhoto", value: "Take Photo", comment: "The name of the action in the context menu") | ||
static let pickFromMedia = NSLocalizedString("mediaPicker.pickFromMediaLibrary", value: "Choose from Media", comment: "The name of the action in the context menu (user's WordPress Media Library") | ||
} |
Oops, something went wrong.