Skip to content

Commit

Permalink
fix: Add logic for macCatalyst mac idiom
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed May 2, 2021
1 parent 3b1232b commit f4c8353
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Sources/Mantis/CropViewController/CropToolbar.swift
Expand Up @@ -131,6 +131,12 @@ public class CropToolbar: UIView, CropToolbarProtocol {
self.config = config
backgroundColor = .black

if #available(macCatalyst 14.0, iOS 14.0, *) {
if UIDevice.current.userInterfaceIdiom == .mac {
backgroundColor = .white
}
}

createButtonContainer()
setButtonContainerLayout()

Expand Down
2 changes: 1 addition & 1 deletion Sources/Mantis/CropViewController/RatioPresenter.swift
Expand Up @@ -82,7 +82,7 @@ public extension UIAlertController {
popoverPresentationController?.sourceRect = sourceView.bounds
}

if #available(macCatalyst 14.0, *) {
if #available(macCatalyst 14.0, iOS 14.0, *) {
if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac {
handlePopupInBigScreen(sourceView: sourceView, permittedArrowDirections: permittedArrowDirections)
}
Expand Down

0 comments on commit f4c8353

Please sign in to comment.