1. System native UIActivityViewController Pros and Cons
UIActivityViewController sharing interface use:
ActivityItems is the content to be shared, including text, pictures, and URLs. However, it should be noted that not all platforms support sharing of these three types of content. For example, WeChat cannot share pictures and URLs at the same time, and text cannot be shared directly. The following figure is a summary of sharing on several platforms Overview of sharing on each platform When the view box pops up, we find that many of the icons on it are not used by us. We can remove the icons that we don’t need by setting the following properties:
Set a callback block to do something after sharing succeeds or fails.
2. System-native Social Framework Pros and Cons
use Import Social.framework
The system only provides the following sharing platforms:
In fact, you can share it to more platforms based on the ID, such as WeChat:
The reason why it can be used in this way is that the Share Extension launched by the system after iOS8 does not implement WeChat sharing by the system, but the Share Extension of the WeChat App provides a sharing entrance. Therefore, this is not a private API and can be used with confidence. If you want to obtain all the Share Extension methods of the Apps installed on your phone, just call the following code.
Looking at the console output, the bundle IDs of all available Share Extensions in the phone are displayed. 3. Third-party sharing platforms such as Umeng Pros and Cons
use Umeng shares usage documentation and SDK downloads (http://dev.umeng.com/social/ios/operation) 4. OpenShare Pros and Cons
use
http://www.gfzj.us/series/openshare/
https://github.com/100apps/openshare Summarize These four sharing solutions have their own advantages and disadvantages. There is no best sharing solution, only the one that best suits your App needs. If your App interface needs to be customized, the sharing type needs to support multimedia (sound, video, files, etc.), and the sharing platform is limited to WeChat, QQ, Weibo, Renren, and Alipay, use openshare. If you need to support many platforms, use Umeng sharing. If the sharing type is limited to text, image, and URL, and the interface requirements are not high, the system's native UIActivityViewController can be used. If the interface needs to be customized, use the Social Framework.
Except for the first solution where UIActivityViewController does not need to draw its own interface, other solutions require you to draw the share pop-up menu yourself. To solve the above problems, I wrote a wheel IFMShare (Swift version) with highly customizable interface and functions for everyone to use. recommend IFMShare (Swift version) is simple and elegant to use, and its interface and functions are highly customizable. It supports multiple styles such as single-line scrolling, double-line scrolling, multi-line, nine-square grid, header view, footer view, etc. The sharing function can directly call Share Extension with a platform name, or use the SDK of each platform or OpenShare to customize the sharing function. Welcome to issue, pull request, star, the code example is as follows:
Partial custom interface display Picture Show GIF display Animated picture display Reference articles: 《Use the system's own UIActivityViewController and UIActivity to share content》 Beginner's Guide: Using Social Framework and UIActivityViewController iOS implements native sharing function through UIActivityViewController UIActivityViewController and SLComposeViewController Share to WeChat within the app |
What is the price of Tongchuan Steel Mini Program...
What software is available for website promotion?...
Whether you are doing shopping mall event plannin...
[[420320]] iPhone users with only 64G or 128G may...
Changsha high-quality tea tasting recommendations,...
According to the "2020 Xiaohongshu Double El...
Joint statement by Sanmao's family and copyri...
Perhaps no one knows that Edison invented the bat...
Review of the Phenomenon-level Screen Sweeping Ju...
When you arrive in a new place, your safety will ...
If we take a look at the impression of Sony mobil...
"Is it too late for me to do live streaming ...
The launch of the iPhone in 2007 not only ushered...
Practical course on sharing good products with sh...