LoginSignup
10
10

More than 5 years have passed since last update.

Social.frameworkのSLComposeViewControllerがバグってる件

Last updated at Posted at 2015-05-20

最新のFacebook iOS公式アプリ(v30, 2015/05/20時点)がインストールされている状態で、Social.frameworkのSLComposeViewControllerが正しく動作しないようです。不具合としては

  • 初期値の文字列をセットできない
  • 投稿をキャンセルしても、投稿完了扱いとしてコールバックが返ってくる
import UIKit
import Social

class ViewController: UIViewController {

    @IBAction func touchButton(sender: AnyObject) {
        if let con = SLComposeViewController(forServiceType: SLServiceTypeFacebook) {
            con.completionHandler = {(result:SLComposeViewControllerResult) -> Void in

                con.setInitialText("Hello") //無視される

                switch result {
                case SLComposeViewControllerResult.Done:
                    println("done") //キャンセルしてもDone扱いになる
                case SLComposeViewControllerResult.Cancelled:
                    println("cancel")
                }
            }
            presentViewController(con, animated: true, completion: nil)
        }
    }
}

回避方法はいまのところなさそう。
ご注意ください。

参考:https://developers.facebook.com/bugs/962985360399542/

10
10
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10