iPad에서 공유하기 처리 안되는 문제 해결
2021. 12. 8. 12:31ㆍ아이폰 개발
iPhone에서는 다음과 같은 방법은 쉽게 처리가 되는데, iPad에서만 이 방식으로는 처리가 안되는 문제가 발생하였다.
https://maivve.tistory.com/175
[Swift] iOS의 Native 기능인 공유하기(Share) 를 구현해보자!
안녕하세요. *** 버전 체크 하고 진행하세요! - Swift : 5 - XCode : 11.5 - iOS : min 9.0 주로 특정 파일, URL, TEXT 를 카카오톡, SNS, 메세지 등 다른 앱에다 공유하고자 할 때 사용됩니다. 그럼 공유하기 의..
maivve.tistory.com
이것 저것 테스트를 해보니, sourceRect가 빠진 경우에 iPad에서 문제가 생기는 것이었다.
let objectsToShare = [textToShare]
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)
Basic example for sharing text or image with UIActivityViewController in Swift - Code Redirect
I started my search by wanting to know how I could share to other apps in iOS. I discovered that two important ways are UIActivityViewControllerUIDocumentInteractionController These and other m...
coderedirect.com