Guest User

Untitled

a guest
Jan 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. var button2 = UIButton.FromType (UIButtonType.RoundedRect);
  2. button2.Frame = new RectangleF (0f, 0f, 300f, 40f);
  3. button2.SetTitle ("Tweet!", UIControlState.Normal);
  4. button2.TouchUpInside += (sender, e) => {
  5. var tvc = new TWTweetComposeViewController ();
  6. tvc.SetInitialText ("Here is a tweet...");
  7. tvc.SetCompletionHandler ((result) => {
  8. if (result == TWTweetComposeViewControllerResult.Cancelled) {
  9. Console.WriteLine ("Cancelled sending the tweet!");
  10. } else {
  11. Console.WriteLine ("Tweet sent! hurrah!");
  12. }
  13. this.DismissModalViewControllerAnimated (true);
  14. });
  15. this.PresentModalViewController (tvc, true);
  16. };
  17. View.AddSubview (button2);
Add Comment
Please, Sign In to add comment