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 |
With the development of App development technolog...
I don't know if it's because people are r...
Taobao gave birth to another son, named "QuA...
Writing a headline is like having a difficult lab...
We have to watch our competitors taking orders wh...
1. "After the COVID-19 test turns negative, ...
2014 was a boom year for mobile healthcare. Accor...
In recent years, Internet finance has developed r...
Recently, the Internet finance industry and campu...
Commuting is a topic that modern people cannot av...
WeChat may be the most frequently used app in eve...
There is a saying in the Internet circle: "I...
In iOS applications, one of the core mechanisms f...