将初始文本显示为SLComposeViewController中的链接

时间:2014-02-26 07:32:18

标签: ios iphone social-networking sharing

我希望setinitialtext以这种方式发布到时间轴。它应该如下所示,我想在GlanseApp仅文本

后面设置一个网址
NSString *KSocialSharingTextFBPT=@" Just discovered this great item via [GlanseApp](https://itunes.apple.com/us/app/glanse/id762075664?mt=8) for iPhone"

我怎么能做到这一点?

以下是共享代码

SLComposeViewController *composeController = [SLComposeViewController 
           composeViewControllerForServiceType:SLServiceTypeFacebook];
[composeController setInitialText:KSocialSharingTextFBPT];
[composeController addImage:image];
[composeController addURL: [NSURL URLWithString:[product objectForKey:@"producturl"]]];
composeController.completionHandler =^(SLComposeViewControllerResult result) {
    switch(result) {
            //  This means the user cancelled without sending the Tweet
        case SLComposeViewControllerResultCancelled:
            break;
            //  This means the user hit 'Send'
        case SLComposeViewControllerResultDone:
            break;
    }
};

1 个答案:

答案 0 :(得分:0)

iOS不支持像MacOS那样的富文本格式(RTF)。唯一直接支持可点击文本链接的UI对象是UIWebView 如果有帮助,您可以尝试使用This链接。