- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
您好,如果使用 SLComposeViewController CompletionHandler 完成推文,我如何收到通知。这是发送推文的代码
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Tweeting from my own app! :)"];
[tweetSheet addURL:[NSURL URLWithString:@"www.someurl.com"]];
[self presentViewController:tweetSheet animated:YES completion:NULL];
}
最佳答案
找到答案
- (void)showTweetSheet
{
// Create an instance of the Tweet Sheet
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:
SLServiceTypeTwitter];
// Sets the completion handler. Note that we don't know which thread the
// block will be called on, so we need to ensure that any UI updates occur
// on the main queue
tweetSheet.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;
}
// dismiss the Tweet Sheet
dispatch_async(dispatch_get_main_queue(), ^{
[self dismissViewControllerAnimated:NO completion:^{
NSLog(@"Tweet Sheet has been dismissed.");
}];
});
};
// Set the initial body of the Tweet
[tweetSheet setInitialText:@"just setting up my twttr"];
// Adds an image to the Tweet. For demo purposes, assume we have an
// image named 'larry.png' that we wish to attach
if (![tweetSheet addImage:[UIImage imageNamed:@"larry.png"]]) {
NSLog(@"Unable to add the image!");
}
// Add an URL to the Tweet. You can add multiple URLs.
if (![tweetSheet addURL:[NSURL URLWithString:@"http://twitter.com/"]]){
NSLog(@"Unable to add the URL!");
}
// Presents the Tweet Sheet to the user
[self presentViewController:tweetSheet animated:NO completion:^{
NSLog(@"Tweet sheet has been presented.");
}];
}
关于objective-c - SLComposeViewController 完成处理程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13428304/
在 iOS 7 应用程序中呈现 SLComposeViewController 时,位置字段始终默认为“无”,即使关联的 Twitter 和/或 Facebook 帐户具有允许显示其当前位置的隐私设置
当我在没有网络的情况下查看 twitter(iOS5 和 6)时,它会在完成处理程序中返回 SLComposeViewControllerResultDone。是否有任何解决方案可以显示成功的结果?任
SLComposeViewController 在呈现后需要 3-4 秒才能出现。但是 presentViewController:(UIViewController *) animated:(BOO
我正在尝试使用 SLComposeViewController 在 iOS 应用程序中将帖子分享到 Facebook。但是,如果我在帖子上点击取消,“完成”的结果将返回到完成处理程序而不是“取消”。当
我注意到 Mobile Safari 的 Twitter 和 Facebook 分享添加了当前页面的屏幕截图而没有真正分享它,例如: 我试图通过 SLComposeViewController 复制它
我一直在使用此代码进行 Twitter 发布。 SLComposeViewController *fbController=[SLComposeViewController composeViewCo
如何将 UIKeyboardAppearanceDark 与 SLComposeViewController 一起使用? SLComposeViewController 类向用户呈现一个 View ,
是否可以使用 SLComposeViewController 回复推文?有人做过吗? 最佳答案 好吧,我们就到这里吧。首先,我们需要在每次点击回复按钮时生成一个 SLComposeViewContro
我即将通过 iTunes Connect 提交我的应用程序,在填写信息时,我注意到隐私政策的可选 URL。我的应用程序不会从我的任何用户那里收集个人信息,但它确实允许用户使用社交框架中的 SLComp
现在,我们的代码设置为从 获取文本。 UITextField 作为 setInitialText 用于 Facebook/Twitter 帖子。 我们要做的是:在 Facebook/Twitter 帖
This question already has answers here: Prevent users from modifying part of the text in SLComposeVi
我正在开发一个需要社交框架支持的应用程序。所以我决定用这个 SLComposeViewController *cntrlr = [[SLComposeViewController alloc]init
使用SLComposeViewController/SLServiceTypeTwitter时,是否可以附加声音或视频?对象实例化如下: SLComposeViewController *tweetC
我正在使用 SLComposeViewController 将文章发布到 facebook 墙。当在设备设置中关闭 facebook 的应用程序权限时,SLComposeViewController
好的,我有一个单一 View 的 iOS 应用程序。在 View Controller 内部,我有一个附加到 Storyboard 中的按钮的方法。这是按下按钮时的方法: - (IBAction)tw
我正在尝试创建 SLComposeViewController 的子类,以便在我的案例中更易于使用。当我尝试创建 required init 并调用 super.init(forServiceType
我正在使用 SLComposeViewController 在 facebook 和 twitter 上分享。当我执行操作然后打开对话框,但对话框中没有出现任何文本。 最佳答案 自从 Facebook
我在使用 Twitter SLComposeViewController 时遇到了一个奇怪的问题。我现在在 imagePickerController 方法中有一个错误,显示“发送 void 到不兼容
将图像添加到 SLComposeViewController 时,图像会显示在 SLComposeViewController View 的右侧。然而,它显示在下面(如下层)另一个看起来像指南针的默认
我正在代表客户构建一个 IOS7 native 应用程序 - 它适用于健身教练。 客户可以在社交上分享进度更新的简短请求 - 其中包括指向教师网站的链接以帮助宣传,例如 - 'Joe ran 3000
我是一名优秀的程序员,十分优秀!