警告メッセージ:「TWtweetcomposeviewcontroller is deprecated in ios6」
iphoneアプリ開発で、Twitter連携機能を実装した際の警告
TWtweetcomposeviewcontrollerを使用するのは非推奨ですよと言っている。
解決方法:SLComposeViewCntrollerを使用する。
TWtweetcomposeviewcontrollerはIOS5以前で使用されていたクラスですね。
IOS6からはSocial.frameworkが使用できますのでそちらを使いましょう。
使用例:
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
controller.completionHandler = ^(SLComposeViewControllerResult res) {
[self dismissViewControllerAnimated:YES completion:nil];
};
[self presentViewController:controller animated:YES completion:nil];
Social.frameworkはTwitterの他にもFaceBook等のソーシャルアプリとの連携に使えるフレームワークです。
0 件のコメント:
コメントを投稿