{"id":2859,"date":"2016-11-18T20:52:17","date_gmt":"2016-11-18T11:52:17","guid":{"rendered":"http:\/\/redwing.moo.jp\/cocoa\/?p=2859"},"modified":"2016-11-18T20:54:13","modified_gmt":"2016-11-18T11:54:13","slug":"uiactivityviewcontroller-%e3%81%ae%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/redwing.moo.jp\/cocoa\/archives\/2859","title":{"rendered":"UIActivityViewController \u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u5148\u65e5\uff0cLINE\u3067\u9001\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u305f\u306e\u304c\uff0cUIActivityViewController \u3092\u4f7f\u7528\u3059\u308b\u969b\u306b iOS\u4ed5\u69d8\u3067\u60a9\u3093\u3060\u70b9\u304c\u3042\u3063\u305f\u306e\u3067\uff0c\u30e1\u30e2\u3057\u3066\u304a\u304f\uff0e<\/p>\n<p>\u5f93\u6765\u3088\u308a\u30a2\u30d7\u30ea\u306b\u300cLINE\u3067\u9001\u308b\u300d\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\uff0c<strong>line:\/\/msg\/<\/strong> \u3068\u3044\u3063\u305f URL\u3092\u30aa\u30fc\u30d7\u30f3\u3059\u308b\u3053\u3068\u3067 LINE \u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u624b\u6cd5\u3092\u5229\u7528\u3057\u3066\u3044\u305f\u306e\u3060\u304c\uff0c\u4eca\u56de\u306f UIActivityViewController \u3092\u4f7f\u7528\u3057\u3066\u307f\u305f\uff0e<\/p>\n<p>\u307e\u305a\uff0cUIActivityViewController \u306b\u3064\u3044\u3066\u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u304c\uff0c\u4e0a\u6bb5\/\u4e0b\u6bb5\u304c\u3069\u306e\u3088\u3046\u306a\u30eb\u30fc\u30eb\u3067\u5206\u3051\u3089\u308c\u3066\u3044\u308b\u306e\u304b\uff1f\u3068\u3044\u3046\u70b9\uff0e<\/p>\n<p>\u8abf\u3079\u3066\u307f\u308b\u3068 iOS \u3068\u3057\u3066\u306f\uff0c<strong>Share (Share Extension) \/ Action (Activity)<\/strong> \u3067\u5206\u3051\u305f\u3044\u3088\u3046\u3060\uff0e<br \/>\n(\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u307f\u305f\u8cc7\u6599\u306b\u4e0a\u6bb5\uff0c\u4e0b\u6bb5\u3068\u3082\u306b Evernote \u306e\u8272\u3064\u304d\u30a2\u30a4\u30b3\u30f3\u3068\u767d\u9ed2\u30a2\u30a4\u30b3\u30f3\u304c\u4e26\u3093\u3067\u3044\u308b\u69d8\u5b50\u3092\u307f\u3066\uff0c\u6700\u521d\u610f\u5473\u304c\u5206\u304b\u3089\u306a\u304b\u3063\u305f\uff0e\u305d\u308c\u305e\u308c\u306e\u30a2\u30a4\u30b3\u30f3\u3067\u3069\u3053\u304c\u9055\u3046\u306e\uff1f)<\/p>\n<p>\u3053\u308c\u306f\uff0c\u5c11\u3057\u5206\u304b\u308a\u3065\u3089\u3044\u4ed5\u69d8\u3060\u3068\u601d\u3044\u307e\u3059\uff0e<br \/>\n(\u5b9f\u969b\u306b\u306f\uff0c\u4e0b\u6bb5\u306b\u8868\u793a\u3055\u308c\u308b Activity \u3067\u3082\u30d7\u30ed\u30d1\u30c6\u30a3\u30fc\u8a2d\u5b9a\u306b\u3088\u308a\uff0c\u4e0a\u6bb5\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\uff0e)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/redwing.moo.jp\/cocoa\/wp-content\/uploads\/UIActivityViewController-e1479469226893.png\" alt=\"UIActivityViewController\" width=\"500\" height=\"427\" class=\"aligncenter size-full wp-image-2861\" \/><br \/>\n\u3053\u308c\u3089\u3092\u628a\u63e1\u3057\u3066\u304a\u3051\u3070\uff0c\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>Acitivity \u3092\u7406\u89e3\u3057\u305f\u3051\u308c\u3070\uff0c\u4ee5\u4e0b\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30b3\u30fc\u30c9\u3092\u3056\u3063\u3068\u307f\u308c\u3070\u78ba\u8a8d\u3067\u304d\u307e\u3059\uff0e<\/p>\n<p>\u4ee5\u4e0b\uff0c\u8abf\u3079\u305f\u4e8b\u67c4\u3092\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<h4>\u25bc iOS \u30a2\u30d7\u30ea\u304b\u3089\u300cLINE\u3067\u9001\u308b\u300d\u306b\u306f\uff1f<\/h4>\n<p><strong>LINE \u516c\u5f0f<\/strong><br \/>\n<a href=\"https:\/\/media.line.me\/ja\/\" target=\"_blank\">https:\/\/media.line.me\/ja\/<\/a><\/p>\n<h4>\u25bc iOS\u300cLINE \u3067\u9001\u4fe1\u300d\u3092\u884c\u3048\u308b\u30e9\u30a4\u30d6\u30e9\u30ea<\/h4>\n<p><strong>LineActivity<\/strong><br \/>\n<a href=\"https:\/\/github.com\/OopsMouse\/LINEActivity\" target=\"_blank\">https:\/\/github.com\/OopsMouse\/LINEActivity<\/a><\/p>\n<p><strong>LineKit<\/strong><br \/>\n<a href=\"https:\/\/github.com\/dlackty\/LineKit\" target=\"_blank\">https:\/\/github.com\/dlackty\/LineKit<\/a><\/p>\n<h4>\u25bc UIActivityViewController \u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5<\/h4>\n<p>\u4e0a\u8a18\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\uff0cUIActivityViewController \u306b LINE \u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u3092\u8868\u793a\u3059\u308b\u306b\u306f\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\uff0e<\/p>\n<pre lang=\"objc\" line=\"1\">\r\nNSArray *activities = @[[[LINEActivity alloc] init]];\r\nUIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:@[shareText]\r\n                                                                         \tapplicationActivities:activities];\r\n\/\/ \u4f7f\u7528\u3057\u306a\u3044\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u30bf\u30a4\u30d7\r\nNSArray *excludedActivityTypes = @[ UIActivityTypePostToWeibo,\r\n                                    UIActivityTypeSaveToCameraRoll,\r\n                                    UIActivityTypePrint,\r\n                                    UIActivityTypeCopyToPasteboard,\r\n                                    UIActivityTypeAirDrop,\r\n                                    UIActivityTypeAssignToContact,\r\n                                    UIActivityTypeAddToReadingList,\r\n\t\t\t\t    UIActivityTypeMail,\r\n                                    UIActivityTypeMessage ];\r\nactivityVC.excludedActivityTypes = excludedActivityTypes;\r\n[self presentViewController:activityVC animated:YES completion:NULL];\r\n<\/pre>\n<p><strong>&#8211; iOS 7\u304b\u3089UIAcitivity\u304c\u4e0a\u6bb5\u3068\u4e0b\u6bb5\u306b\u5206\u304b\u308c\u305f\u30c7\u30b6\u30a4\u30f3\u304c\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\uff0e<\/strong><br \/>\n+ (UIActivityCategory)activityCategory \u306b\u4ee5\u4e0b\u306e\u5024\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u8868\u793a\u4f4d\u7f6e\u304c\u6307\u5b9a\u3067\u304d\u308b\uff0e<br \/>\n\u4e0a\u6bb5:   UIActivityCategoryShare<br \/>\n\u4e0b\u6bb5:   UIActivityCategoryAction<\/p>\n<h4>\u25bc \u6ce8\u610f\u70b9<\/h4>\n<p><strong>&#8211; URL\u30b9\u30ad\u30fc\u30e0\u304ciOS9\u304b\u3089\u4f7f\u7528\u65b9\u6cd5\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u70b9<\/strong><br \/>\n\u30fbiOS9\u304b\u3089\u5f93\u6765\u306eopenURL\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u306f\uff0c\u30ab\u30b9\u30bf\u30e0URL\u30b9\u30ad\u30fc\u30e0\u304c\u4f7f\u7528\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3044\u308b\uff0e<\/p>\n<p>\u30fb\u30ab\u30b9\u30bf\u30e0URL\u30b9\u30ad\u30fc\u30e0\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\uff0cInfo.plist \u306b\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\uff0e<br \/>\n<strong>custom_url_scheme \u306f\uff0c\u300c:\/\/\u300d\u304c\u5fc5\u8981\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\uff0e<\/strong><\/p>\n<pre lang=\"bash\" line=\"1\">\r\n<key>LSApplicationQueriesSchemes<\/key>\r\n<array>\r\n    <string>custom_url_scheme<\/string>\r\n<\/array>\r\n<\/pre>\n<a href=\"https:\/\/twitter.com\/redwing1300?ref_src=twsrc%5Etfw\" class=\"twitter-follow-button\" data-size=\"large\" data-show-count=\"false\">Follow @redwing1300<\/a><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><div id=\"redwi-2305604880\" class=\"redwi- redwi-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9652476346722993\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-9652476346722993\" \ndata-ad-slot=\"\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>\u5148\u65e5\uff0cLINE\u3067\u9001\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u305f\u306e\u304c\uff0cUIActivityViewController \u3092\u4f7f\u7528\u3059\u308b\u969b\u306b iOS\u4ed5\u69d8\u3067\u60a9\u3093\u3060\u70b9\u304c\u3042\u3063\u305f\u306e\u3067\uff0c\u30e1\u30e2\u3057\u3066\u304a\u304f\uff0e \u5f93\u6765\u3088\u308a\u30a2\u30d7\u30ea\u306b\u300cLINE\u3067\u9001\u308b\u300d\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u5834\u5408\uff0cline: &hellip; <a href=\"https:\/\/redwing.moo.jp\/cocoa\/archives\/2859\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,117],"tags":[],"class_list":["post-2859","post","type-post","status-publish","format-standard","hentry","category-ios","category-objective-c"],"_links":{"self":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/2859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/comments?post=2859"}],"version-history":[{"count":11,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/2859\/revisions"}],"predecessor-version":[{"id":2871,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/2859\/revisions\/2871"}],"wp:attachment":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/media?parent=2859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/categories?post=2859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/tags?post=2859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}