iOSã§ããã¹ããã¼ã¿ãç»åãå
±æãããå ´åãUIActivityViewController
ã使ç¨ãã¾ãã
SwiftUIã§ã¯ãã®UIActivityViewControllerãã©ããã³ã°ãã¦å©ç¨ããã¨ä¾¿å©ã§ããSwiftUIã§UIActivityViewController ã使ãæ¹æ³ã«ã¤ãã¦ã¯ãSwiftUIで UIActivityViewControllerを使って画像を共有する - SwiftUIなんもわからんãã«ã¦ç´¹ä»ãã¾ããã
大æµã®ã¢ããªã§ã¯å ±æããå¦çã§åé¡ã¯çºçããªãã®ã§ããã確èªã§ãã¦ãããªãã§ã¯å¯ä¸Tweetbotã¸ç»åãå ±æãã¦ãæåå ¥åããã¨åæã«dismissãããç¾è±¡ã«ééãã¾ããã
å®è¡ç°å¢
- Xcode 11.6
- iOS 13.6
- Tweetbot 5.1.4
åé¡ã®æå
UIActivityViewControllerã使ã£ã¦ç»åãå ±æãã¾ãã大æµã®ã¢ããªã§ã¯å ±ææã«åé¡ã¯çºçãã¾ããããTweetbotã®ã¿ç»åãå ±æãã¦å ±æã¨ã¯ã¹ãã³ã·ã§ã³ã表示ãããç¶æ ã§ããã¹ããå ¥åãããã¨ããã¨ãå ±æã¨ã¯ã¹ãã³ã·ã§ã³ãåæã«dismissããã¦ãã¾ãã¾ãã
æåå
¥åããç¬éã« activityType
ã nil
ã§è¿ã£ã¦ãã¾ãã¾ãããã®æã®ãã°ã¯ä»¥ä¸ã®éãã§ããããã¾ã¾ã§è¸ãã ãã¨ã®ãªãå°é·ã§æ¸æã£ã¦ãã¾ãã
MediaCropper[18763:4998440] [lifecycle ] [u ABAE30D9-DA4A-4CD6-8580-1E8819AF5654:m (null)] [com.tapbots.Tweetbot4.shareextension(5.1.4)] Connection to plugin interrupted while in use. MediaCropper[18763:4997352] [core] SLRemoteComposeViewController: (this may be harmless) viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} MediaCropper[18763:4997352] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} MediaCropper[18763:4998440] [lifecycle ] [u ABAE30D9-DA4A-4CD6-8580-1E8819AF5654:m (null)] [com.tapbots.Tweetbot4.shareextension(5.1.4)] Connection to plugin invalidated while in use.
éå»ãã¼ã¸ã§ã³ã§UIKitã§Tweetbotã¸ç»åãå ±æããã¨ãã«ã¯ä½ãçºçãã¦ããªãã£ãã¨æãã®ã§ãSwiftUI+Tweetbotã®ç¸æ§ãæªãã¦çºçãã¦ããã®ããããã¾ããã
解決編
2020/08/01æç¹ã§è§£æ±ºæ¹æ³ã¯ãªãããã°ããå¼ã£ã¦è§£æ±ºããªãã£ãããSwiftUIã®Viewããã¹ãã£ã³ã°ããViewControllerãä½ã£ã¦ãããããç»åãå ±æããããã«ãã¾ãã
調æ»ã®çµæã
- iOS 13.6 + Tweetbot 5.1.4ã§
- è¤æ°ã®ç»åã Tweetbotã¸å ±æãã¦
- ãã¼ãã¼ãã§æåå ¥åããã¨ å ±æã¨ã¯ã¹ãã³ã·ã§ã³ãã¯ã©ãã·ã¥ãã
ãã¨ããããã¾ããã
Photosã¢ããª(åçã¢ããª)ããè¤æ°æã®åçãå ±æããã¨ãã«ãæåå ¥åããã¨Tweetbotã®å ±æã¨ã¯ã¹ãã³ã·ã§ã³ãã¯ã©ãã·ã¥ãããã¨ã確èªã§ããã®ã§ãç¹ã«SwitUIã¯é¢ä¿ãªãã£ãã
ãã ãSwiftUIããå ±æã·ã¼ãã表示ãããã¨ãªãã.fullScreenã«ãªã£ã¦ãã¾ãã®ã§ãUIViewControllerããUIActivityViewControllerãå¼ã¶ããã«ä¿®æ£ãã¾ããã