From 9b6f39501d09084ae3317d3f651ac3e244112f24 Mon Sep 17 00:00:00 2001 From: Jeremy Massel Date: Thu, 12 Mar 2020 12:23:49 -0600 Subject: [PATCH 01/22] Pin the ruby version for this project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures we’re using a consistent version, which will prevent bundler weirdness. --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..0cadbc1 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.5.5 From de99b09d67bb6a4806bff7c8e912fae696d7e914 Mon Sep 17 00:00:00 2001 From: Jeremy Massel Date: Thu, 12 Mar 2020 12:52:55 -0600 Subject: [PATCH 02/22] Use 2.6.4 instead --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 0cadbc1..2714f53 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.5 +2.6.4 From 88cc3af6d4b63c11412af1293c501e32a750b92f Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 1 May 2020 10:46:48 +0100 Subject: [PATCH 03/22] Add first attempt at PencilKit support. * Added MediaEditorDrawing view controller + storyboard * Added to MediaEditor capabilities --- Cartfile.resolved | 2 +- MediaEditor.xcodeproj/project.pbxproj | 16 +++ .../Drawing/MediaEditorDrawing.storyboard | 109 ++++++++++++++++++ .../Drawing/MediaEditorDrawing.swift | 93 +++++++++++++++ Sources/MediaEditor.swift | 10 +- 5 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard create mode 100644 Sources/Capabilities/Drawing/MediaEditorDrawing.swift diff --git a/Cartfile.resolved b/Cartfile.resolved index 0d4ea38..d57c23f 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Quick/Nimble" "v8.0.5" +github "Quick/Nimble" "v8.0.7" github "TimOliver/TOCropViewController" "2.5.2" diff --git a/MediaEditor.xcodeproj/project.pbxproj b/MediaEditor.xcodeproj/project.pbxproj index 3dc6d6c..22d7b4a 100644 --- a/MediaEditor.xcodeproj/project.pbxproj +++ b/MediaEditor.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 17002A9D245C27400021216C /* MediaEditorDrawing.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */; }; + 17DBA238245B1507006CD67F /* MediaEditorDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */; }; 8B05570523E1BF5900C10787 /* DeviceLibraryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B05570423E1BF5900C10787 /* DeviceLibraryViewController.swift */; }; 8B05570723E1C1D800C10787 /* ImageViewCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B05570623E1C1D800C10787 /* ImageViewCollectionCell.swift */; }; 8B05570923E1CF2E00C10787 /* PlainUIImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B05570823E1CF2E00C10787 /* PlainUIImageViewController.swift */; }; @@ -92,6 +94,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MediaEditorDrawing.storyboard; sourceTree = ""; }; + 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaEditorDrawing.swift; sourceTree = ""; }; 8B05570423E1BF5900C10787 /* DeviceLibraryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceLibraryViewController.swift; sourceTree = ""; }; 8B05570623E1C1D800C10787 /* ImageViewCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewCollectionCell.swift; sourceTree = ""; }; 8B05570823E1CF2E00C10787 /* PlainUIImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlainUIImageViewController.swift; sourceTree = ""; }; @@ -170,6 +174,15 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 17DBA236245B14F5006CD67F /* Drawing */ = { + isa = PBXGroup; + children = ( + 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */, + 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */, + ); + path = Drawing; + sourceTree = ""; + }; 8B05570E23E1F63A00C10787 /* BrightnessCapability */ = { isa = PBXGroup; children = ( @@ -336,6 +349,7 @@ 8B5046C823D7CE1600068F66 /* Capabilities */ = { isa = PBXGroup; children = ( + 17DBA236245B14F5006CD67F /* Drawing */, 8B5046C923D7CE1600068F66 /* Crop */, 8B062DC723E865F800488F80 /* Filters */, 8B5046CC23D7CE1600068F66 /* MediaEditorCapability.swift */, @@ -521,6 +535,7 @@ 8B5046E023D7CE1600068F66 /* MediaEditorHub.storyboard in Resources */, 8B5046DF23D7CE1600068F66 /* Media.xcassets in Resources */, 8B062DCB23E8661400488F80 /* MediaEditorFilters.storyboard in Resources */, + 17002A9D245C27400021216C /* MediaEditorDrawing.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -573,6 +588,7 @@ files = ( 8B5046E223D7CE1600068F66 /* MediaEditorThumbCell.swift in Sources */, 8B062DD423E8925100488F80 /* MediaEditorFilterCell.swift in Sources */, + 17DBA238245B1507006CD67F /* MediaEditorDrawing.swift in Sources */, 8B5046D623D7CE1600068F66 /* UIImage+AsyncImage.swift in Sources */, 8B5046DE23D7CE1600068F66 /* AsyncImage.swift in Sources */, 8B5046DC23D7CE1600068F66 /* MediaEditorCapability.swift in Sources */, diff --git a/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard new file mode 100644 index 0000000..7baf7a9 --- /dev/null +++ b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/Capabilities/Drawing/MediaEditorDrawing.swift b/Sources/Capabilities/Drawing/MediaEditorDrawing.swift new file mode 100644 index 0000000..a21cd5c --- /dev/null +++ b/Sources/Capabilities/Drawing/MediaEditorDrawing.swift @@ -0,0 +1,93 @@ +import UIKit +import PencilKit + +@available(iOS 13.0, *) +class MediaEditorDrawing: UIViewController, PKToolPickerObserver { + @IBOutlet weak var imageView: UIImageView! + @IBOutlet weak var cancelButton: UIButton! + @IBOutlet weak var doneButton: UIButton! + @IBOutlet weak var canvasView: PKCanvasView! + + var image: UIImage! + + let context = MediaEditor.ciContext + + var onFinishEditing: ((UIImage, [MediaEditorOperation]) -> ())? + + var onCancel: (() -> ())? + + static func initialize() -> MediaEditorDrawing { + return UIStoryboard( + name: "MediaEditorDrawing", + bundle: Bundle(for: MediaEditorDrawing.self) + ).instantiateViewController(withIdentifier: "drawingViewController") as! MediaEditorDrawing + } + + override func viewDidLoad() { + super.viewDidLoad() + + imageView.image = image + + canvasView.backgroundColor = .clear + canvasView.isOpaque = false + + // Ensure ink remains the same color regardless of light / dark mode + canvasView.overrideUserInterfaceStyle = .light + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + // Based on Apple's sample PencilKit code from WWDC 2019 + // Set up the tool picker, using the window of our parent because our view has not + // been added to a window yet. + if let window = parent?.view.window, let toolPicker = PKToolPicker.shared(for: window) { + toolPicker.setVisible(true, forFirstResponder: canvasView) + toolPicker.addObserver(canvasView) + toolPicker.addObserver(self) + + canvasView.becomeFirstResponder() + } + } + + // MARK: - Actions + + @IBAction func cancel(_ sender: Any) { + onCancel?() + } + + @IBAction func done(_ sender: Any) { + let image = canvasView.drawing.image(from: canvasView.bounds, scale: UIScreen.main.scale) + + onFinishEditing?(image, [.other]) + } +} + +@available(iOS 13.0, *) +extension MediaEditorDrawing: MediaEditorCapability { + static var name = "Drawing" + + static var icon = UIImage(systemName: "pencil.tip.crop.circle")! + + static func initialize(_ image: UIImage, onFinishEditing: @escaping (UIImage, [MediaEditorOperation]) -> (), onCancel: @escaping () -> ()) -> CapabilityViewController { + let viewController: MediaEditorDrawing = MediaEditorDrawing.initialize() + viewController.onFinishEditing = onFinishEditing + viewController.onCancel = onCancel + viewController.image = image + return viewController + } + + func apply(styles: MediaEditorStyles) { + if let doneLabel = styles[.doneLabel] as? String { + doneButton.setTitle(doneLabel, for: .normal) + } + + if let cancelLabel = styles[.cancelLabel] as? String { + cancelButton.setTitle(cancelLabel, for: .normal) + } + + if let cancelColor = styles[.cancelColor] as? UIColor { + cancelButton.tintColor = cancelColor + } + } +} diff --git a/Sources/MediaEditor.swift b/Sources/MediaEditor.swift index baa15c2..07f02a1 100644 --- a/Sources/MediaEditor.swift +++ b/Sources/MediaEditor.swift @@ -12,7 +12,15 @@ import UIKit */ open class MediaEditor: UINavigationController { /// The capabilities are displayed in the Media Editor. You can add your own capabilities here. - public static var capabilities: [MediaEditorCapability.Type] = [MediaEditorFilters.self, MediaEditorCropZoomRotate.self] + public static var capabilities: [MediaEditorCapability.Type] = { + var capabilities: [MediaEditorCapability.Type] = [MediaEditorFilters.self, MediaEditorCropZoomRotate.self] + + if #available(iOS 13.0, *) { + capabilities.insert(MediaEditorDrawing.self, at: 0) + } + + return capabilities + }() /// A CIContext to be shared among capabilities. If your app already has one, you can assign it here. public static var ciContext = CIContext() From 5ea1d697ff2726736d2e90af9ef8e2371c6b50ac Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 1 May 2020 14:48:53 +0100 Subject: [PATCH 04/22] Drawing: Fit canvas to image size and render resulting image * Moves canvas and imageview to a custom UIView subclass to better fit the canvas to the size of the imageview * Render the resulting image out to a UIImage instance --- MediaEditor.xcodeproj/project.pbxproj | 4 + .../Drawing/MediaEditorAnnotationView.swift | 124 ++++++++++++++++++ .../Drawing/MediaEditorDrawing.storyboard | 24 ++-- .../Drawing/MediaEditorDrawing.swift | 28 ++-- 4 files changed, 146 insertions(+), 34 deletions(-) create mode 100644 Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift diff --git a/MediaEditor.xcodeproj/project.pbxproj b/MediaEditor.xcodeproj/project.pbxproj index 22d7b4a..b73a03b 100644 --- a/MediaEditor.xcodeproj/project.pbxproj +++ b/MediaEditor.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 17002A9D245C27400021216C /* MediaEditorDrawing.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */; }; + 17002A9F245C54160021216C /* MediaEditorAnnotationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17002A9E245C54150021216C /* MediaEditorAnnotationView.swift */; }; 17DBA238245B1507006CD67F /* MediaEditorDrawing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */; }; 8B05570523E1BF5900C10787 /* DeviceLibraryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B05570423E1BF5900C10787 /* DeviceLibraryViewController.swift */; }; 8B05570723E1C1D800C10787 /* ImageViewCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B05570623E1C1D800C10787 /* ImageViewCollectionCell.swift */; }; @@ -95,6 +96,7 @@ /* Begin PBXFileReference section */ 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MediaEditorDrawing.storyboard; sourceTree = ""; }; + 17002A9E245C54150021216C /* MediaEditorAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaEditorAnnotationView.swift; sourceTree = ""; }; 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaEditorDrawing.swift; sourceTree = ""; }; 8B05570423E1BF5900C10787 /* DeviceLibraryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceLibraryViewController.swift; sourceTree = ""; }; 8B05570623E1C1D800C10787 /* ImageViewCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewCollectionCell.swift; sourceTree = ""; }; @@ -179,6 +181,7 @@ children = ( 17002A9C245C27400021216C /* MediaEditorDrawing.storyboard */, 17DBA237245B1507006CD67F /* MediaEditorDrawing.swift */, + 17002A9E245C54150021216C /* MediaEditorAnnotationView.swift */, ); path = Drawing; sourceTree = ""; @@ -592,6 +595,7 @@ 8B5046D623D7CE1600068F66 /* UIImage+AsyncImage.swift in Sources */, 8B5046DE23D7CE1600068F66 /* AsyncImage.swift in Sources */, 8B5046DC23D7CE1600068F66 /* MediaEditorCapability.swift in Sources */, + 17002A9F245C54160021216C /* MediaEditorAnnotationView.swift in Sources */, 8B062DCD23E8663C00488F80 /* UIImage+withSize.swift in Sources */, 8B062DD723E8937100488F80 /* MediaEditorFilters.swift in Sources */, 8B5046DB23D7CE1600068F66 /* MediaEditorCropZoomRotate.swift in Sources */, diff --git a/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift b/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift new file mode 100644 index 0000000..37a06c0 --- /dev/null +++ b/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift @@ -0,0 +1,124 @@ +import UIKit +import AVFoundation +import PencilKit + +/// Wrapper view that contains an image view and a PencilKit canvas to allow +/// drawing on top of the image. +/// +@available(iOS 13.0, *) +class MediaEditorAnnotationView: UIView { + + private let imageView = UIImageView() + private let canvasView = PKCanvasView() + + var image: UIImage? { + set { + imageView.image = newValue + } + get { + return renderedImage + } + } + + // MARK: - Initialization + + override init(frame: CGRect) { + super.init(frame: frame) + commonInit() + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + commonInit() + } + + private func commonInit() { + configureImageView() + configureCanvasView() + } + + private func configureImageView() { + addSubview(imageView) + imageView.translatesAutoresizingMaskIntoConstraints = false + + imageView.contentMode = .scaleAspectFit + + NSLayoutConstraint.activate([ + imageView.leadingAnchor.constraint(equalTo: leadingAnchor), + imageView.trailingAnchor.constraint(equalTo: trailingAnchor), + imageView.topAnchor.constraint(equalTo: topAnchor), + imageView.bottomAnchor.constraint(equalTo: bottomAnchor), + ]) + } + + private func configureCanvasView() { + addSubview(canvasView) + + canvasView.backgroundColor = .clear + canvasView.isOpaque = false + + // Ensure ink remains the same color regardless of light / dark mode + canvasView.overrideUserInterfaceStyle = .light + } + + // MARK: - View Layout + + override func layoutSubviews() { + super.layoutSubviews() + + canvasView.frame = calculateCanvasFrame() + } + + private func calculateCanvasFrame() -> CGRect { + guard let image = imageView.image, + imageView.contentMode == .scaleAspectFit, + image.size.width > 0 && image.size.height > 0 else { + return bounds + } + + let size = AVMakeRect(aspectRatio: image.size, insideRect: bounds) + + let x = (bounds.width - size.width) * 0.5 + let y = (bounds.height - size.height) * 0.5 + + return CGRect(x: x, y: y, width: size.width, height: size.height) + } + + // MARK: - Public methods + + /// Displays the system tool picker in the specified window + /// + func showTools(in window: UIWindow) { + if let toolPicker = PKToolPicker.shared(for: window) { + toolPicker.setVisible(true, forFirstResponder: canvasView) + toolPicker.addObserver(canvasView) + toolPicker.addObserver(self) + + canvasView.becomeFirstResponder() + } + } + + /// Renders the initial image with the canvas's image overlaid on top + /// into a single UIImage instance. + /// + private var renderedImage: UIImage? { + guard let imageViewImage = imageView.image else { + return nil + } + + let targetSize = imageViewImage.size + + let canvasViewImage = canvasView.drawing.image(from: canvasView.bounds, scale: UIScreen.main.scale) + + let renderer = UIGraphicsImageRenderer(size: targetSize, format: .default()) + let renderedImage = renderer.image { context in + imageViewImage.draw(at: .zero) + canvasViewImage.draw(in: CGRect(origin: .zero, size: targetSize)) + } + + return renderedImage + } +} + +@available(iOS 13.0, *) +extension MediaEditorAnnotationView: PKToolPickerObserver {} diff --git a/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard index 7baf7a9..a1d6912 100644 --- a/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard +++ b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard @@ -62,43 +62,35 @@ - + - + + - - - - + + + + - - - - - - - - + - - diff --git a/Sources/Capabilities/Drawing/MediaEditorDrawing.swift b/Sources/Capabilities/Drawing/MediaEditorDrawing.swift index a21cd5c..3bac403 100644 --- a/Sources/Capabilities/Drawing/MediaEditorDrawing.swift +++ b/Sources/Capabilities/Drawing/MediaEditorDrawing.swift @@ -2,11 +2,10 @@ import UIKit import PencilKit @available(iOS 13.0, *) -class MediaEditorDrawing: UIViewController, PKToolPickerObserver { - @IBOutlet weak var imageView: UIImageView! +class MediaEditorDrawing: UIViewController { + @IBOutlet weak var annotationView: MediaEditorAnnotationView! @IBOutlet weak var cancelButton: UIButton! @IBOutlet weak var doneButton: UIButton! - @IBOutlet weak var canvasView: PKCanvasView! var image: UIImage! @@ -26,27 +25,17 @@ class MediaEditorDrawing: UIViewController, PKToolPickerObserver { override func viewDidLoad() { super.viewDidLoad() - imageView.image = image - - canvasView.backgroundColor = .clear - canvasView.isOpaque = false - - // Ensure ink remains the same color regardless of light / dark mode - canvasView.overrideUserInterfaceStyle = .light + annotationView.image = image } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - // Based on Apple's sample PencilKit code from WWDC 2019 + // Based on Apple's sample PencilKit code from WWDC 2019: https://developer.apple.com/documentation/pencilkit/drawing_with_pencilkit // Set up the tool picker, using the window of our parent because our view has not // been added to a window yet. - if let window = parent?.view.window, let toolPicker = PKToolPicker.shared(for: window) { - toolPicker.setVisible(true, forFirstResponder: canvasView) - toolPicker.addObserver(canvasView) - toolPicker.addObserver(self) - - canvasView.becomeFirstResponder() + if let window = parent?.view.window { + annotationView.showTools(in: window) } } @@ -57,7 +46,10 @@ class MediaEditorDrawing: UIViewController, PKToolPickerObserver { } @IBAction func done(_ sender: Any) { - let image = canvasView.drawing.image(from: canvasView.bounds, scale: UIScreen.main.scale) + guard let image = annotationView.image else { + onCancel?() + return + } onFinishEditing?(image, [.other]) } From a871ed447243f4c3dad7fbbfbffac3a36b01c096 Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 1 May 2020 15:27:57 +0100 Subject: [PATCH 05/22] Drawing: Add undo and redo functionality --- .../Drawing/MediaEditorAnnotationView.swift | 16 +++++-- .../Drawing/MediaEditorDrawing.storyboard | 43 ++++++++++++++++++- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift b/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift index 37a06c0..00af134 100644 --- a/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift +++ b/Sources/Capabilities/Drawing/MediaEditorAnnotationView.swift @@ -11,6 +11,9 @@ class MediaEditorAnnotationView: UIView { private let imageView = UIImageView() private let canvasView = PKCanvasView() + @IBOutlet weak var undoButton: UIButton! + @IBOutlet weak var redoButton: UIButton! + var image: UIImage? { set { imageView.image = newValue @@ -59,6 +62,15 @@ class MediaEditorAnnotationView: UIView { // Ensure ink remains the same color regardless of light / dark mode canvasView.overrideUserInterfaceStyle = .light + + NotificationCenter.default.addObserver(forName: NSNotification.Name.NSUndoManagerCheckpoint, object: canvasView.undoManager, queue: nil) { [weak self] _ in + self?.updateUndoRedoButtons() + } + } + + private func updateUndoRedoButtons() { + undoButton.isEnabled = canvasView.undoManager?.canUndo ?? false + redoButton.isEnabled = canvasView.undoManager?.canRedo ?? false } // MARK: - View Layout @@ -92,7 +104,6 @@ class MediaEditorAnnotationView: UIView { if let toolPicker = PKToolPicker.shared(for: window) { toolPicker.setVisible(true, forFirstResponder: canvasView) toolPicker.addObserver(canvasView) - toolPicker.addObserver(self) canvasView.becomeFirstResponder() } @@ -119,6 +130,3 @@ class MediaEditorAnnotationView: UIView { return renderedImage } } - -@available(iOS 13.0, *) -extension MediaEditorAnnotationView: PKToolPickerObserver {} diff --git a/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard index a1d6912..d561b48 100644 --- a/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard +++ b/Sources/Capabilities/Drawing/MediaEditorDrawing.storyboard @@ -23,7 +23,7 @@ - + + + + + + + +