Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when using with ipad #59

Open
jamesrv43 opened this issue Dec 24, 2018 · 2 comments
Open

Problems when using with ipad #59

jamesrv43 opened this issue Dec 24, 2018 · 2 comments

Comments

@jamesrv43
Copy link

jamesrv43 commented Dec 24, 2018

fix bug in ipad

PhotoEditor+Controls.swift line at 88

@IBAction func shareButtonTapped(_ sender: UIButton) {
        //        let activity = UIActivityViewController(activityItems: [canvasView.toImage()], applicationActivities: nil)
        //        present(activity, animated: true, completion: nil)
        //
        print("shareButtonTapped")
        let objectsToShare = [canvasView.toImage()]
        let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
        activityVC.title = "Share One"
        activityVC.excludedActivityTypes = []
        
        activityVC.popoverPresentationController?.sourceView = self.view
        activityVC.popoverPresentationController?.sourceRect = sender.frame
        
        self.present(activityVC, animated: true, completion: nil)
        
    }

CropViewController.swift line at 148

func constrain(_ sender: UIBarButtonItem) {
        let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
        if let popoverController = actionSheet.popoverPresentationController {
            popoverController.barButtonItem = sender
            popoverController.permittedArrowDirections = .down
        }
@0xWDG
Copy link

0xWDG commented Mar 31, 2019

What is the bug?

  • crash?

  • unexpected behavior?

  • something else?

@0xWDG
Copy link

0xWDG commented Mar 31, 2019

If it crashes try:

func constrain(_ sender: UIBarButtonItem) {
        let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
        if let popoverController = actionSheet.popoverPresentationController {
            ///popoverController.barButtonItem = sender
            popoverController.popoverPresentationController?.sourceView = sender
popoverController.permittedArrowDirections = .down
        }

Disclaimer: this code is untested, I’m browsing from my phone, but maybe it can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants