zoukankan      html  css  js  c++  java
  • iOS中使用UIActivityViewController系统分享到微信QQ微博包含文字图片URL

    NSMutableArray *activityItems = [NSMutableArray array];

      // 文字

        [activityItems addObject:title];

     

        // 页面URL

        if ([NSURL URLWithString:webPageURL]) {

            [activityItems addObject:[NSURL URLWithString:webPageURL]];

        }

     

      // 图片

        if ([NSData dataWithContentsOfFile:thumbPath]) {

            [activityItems addObject:[NSData dataWithContentsOfFile:thumbPath]];

        }

        _currentShowSystemShare = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];

     

    总结下:文字使用NSString类型,URL使用NSURL类型,图片使用NSData类型,并且每种只能有一个类型

  • 相关阅读:
    CSS
    引入缺陷的原因都有哪些?
    测试基础---软件研发中几个重要的过程是什么,每个过程中的主要内容是什么?
    测试基础---软件生命周期中的各个模型及其优缺点
    测试基础---测试目的是什么
    测试常用术语4
    测试常用术语3
    测试常用术语2
    测试常用术语1
    测试覆盖率
  • 原文地址:https://www.cnblogs.com/programmer-blog/p/7462775.html
Copyright © 2011-2022 走看看