相关疑难解决方法(0)

iOS 13 UIActivityViewController automatically present previous VC after image saving

I'm trying to implement “Save image to Library” function and then return back to the current view controller, but on a new iOS 13 it dismisses back to the view controller that presented the current one:

PHPhotoLibrary.requestAuthorization({(_ status: PHAuthorizationStatus) -> Void in })

let shareItems: Array = [newImg,"Hello"] as [Any]

let activityController = UIActivityViewController(activityItems: shareItems, applicationActivities: nil)

if UIDevice.current.userInterfaceIdiom == .pad {
    activityController.popoverPresentationController?.sourceView = saveButton
}

present(activityController, animated: true)
Run Code Online (Sandbox Code Playgroud)

ios uiactivityviewcontroller swift ios13

13
推荐指数
2
解决办法
1833
查看次数

标签 统计

ios ×1

ios13 ×1

swift ×1

uiactivityviewcontroller ×1