Created
October 30, 2012 05:19
-
-
Save satococoa/3978440 to your computer and use it in GitHub Desktop.
crash when deployment_target='5.1' or '5.0'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyViewController < UIViewController | |
| def viewDidLoad | |
| super | |
| view.backgroundColor = UIColor.whiteColor | |
| end | |
| def viewDidAppear(animated) | |
| super | |
| if TWTweetComposeViewController.canSendTweet | |
| tw = TWTweetComposeViewController.new.tap do |c| | |
| c.setInitialText('hoge') | |
| c.completionHandler = lambda {|result| | |
| dismissModalViewControllerAnimated(true) | |
| } | |
| end | |
| self.presentModalViewController(tw, animated:true) | |
| end | |
| end | |
| end | |
| class AppDelegate | |
| def application(application, didFinishLaunchingWithOptions:launchOptions) | |
| controller = MyViewController.new | |
| @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
| @window.rootViewController = controller | |
| @window.makeKeyAndVisible | |
| true | |
| end | |
| end |
satococoa
commented
Oct 30, 2012
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment