Skip to content

Commit

Permalink
fix: present full screen for mac catalyst (#226)
Browse files Browse the repository at this point in the history
fix some demos
  • Loading branch information
guoyingtao committed Nov 4, 2022
1 parent df288a2 commit 3921dbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Example/ViewController.swift
Expand Up @@ -81,7 +81,7 @@ class ViewController: UIViewController, CropViewControllerDelegate {

var config = Mantis.Config()
config.showAttachedCropToolbar = false
config.cropViewConfig.showRotationDial = true
config.cropViewConfig.showRotationDial = false
config.cropViewConfig.minimumZoomScale = 2.0
config.cropViewConfig.maximumZoomScale = 10.0

Expand All @@ -90,7 +90,6 @@ class ViewController: UIViewController, CropViewControllerDelegate {
cropViewController.delegate = self
cropViewController.title = "Change Profile Picture"
let navigationController = UINavigationController(rootViewController: cropViewController)
navigationController.modalPresentationStyle = .fullScreen

cropToolbar.cropViewController = cropViewController

Expand All @@ -105,7 +104,6 @@ class ViewController: UIViewController, CropViewControllerDelegate {
let config = Mantis.Config()

let cropViewController = Mantis.cropViewController(image: image, config: config)
cropViewController.modalPresentationStyle = .fullScreen
cropViewController.delegate = self
cropViewController.config.presetFixedRatioType = .alwaysUsingOnePresetFixedRatio(ratio: 16.0 / 9.0)
present(cropViewController, animated: true)
Expand Down
6 changes: 5 additions & 1 deletion Sources/Mantis/CropViewController/CropViewController.swift
Expand Up @@ -171,7 +171,11 @@ public class CropViewController: UIViewController {

override public func viewDidLoad() {
super.viewDidLoad()


#if targetEnvironment(macCatalyst)
modalPresentationStyle = .fullScreen
navigationController?.modalPresentationStyle = .fullScreen
#endif
view.backgroundColor = .black

createCropView()
Expand Down

0 comments on commit 3921dbc

Please sign in to comment.