/***
 * Excerpted from "iOS SDK Development",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/adios for more book information.
***/
//
//  PRPViewController.m
//  PRPFirstProjectTweeter
//
//  Created by Chris Adamson on 9/13/12.
//  Copyright (c) 2012 Your Organization. All rights reserved.
//

#import "PRPViewController.h"
//
#import <Social/Social.h>
//

@interface PRPViewController ()

@end

@implementation PRPViewController

- (void)viewDidLoad
{
  [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}
-(IBAction) handleTweetButtonTapped: (id) sender {
  if ([SLComposeViewController isAvailableForServiceType: SLServiceTypeTwitter]) {
    SLComposeViewController *tweetVC =
    [SLComposeViewController composeViewControllerForServiceType:
     SLServiceTypeTwitter];
    [tweetVC setInitialText:
     @"I just finished the first project in iOS SDK Development. #pragsios"];
    [self presentViewController:tweetVC animated:YES completion:NULL];
  } else {
    NSLog (@"Can't send tweet");
  }
}

//
-(IBAction) handleShowMyTweetsTapped: (id) sender {
	[self.twitterWebView loadRequest: 
	 [NSURLRequest requestWithURL:
	  [NSURL URLWithString:@"http://www.twitter.com/pragprog"]]];
}
//


@end
