TWComposeViewController.m 802 Bytes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
//
// TWComposeViewController.m
// TwitterKitExample
//
// Created by DongSoo Lee on 2015. 12. 8..
// Copyright © 2015년 DongSoo Lee. All rights reserved.
//

#import "TWComposeViewController.h"
#import <TwitterKit/TwitterKit.h>

@implementation TWComposeViewController

- (void)viewDidLoad {
[super viewDidLoad];

self.title = @"트위터 작성";

TWTRComposer *composer = [[TWTRComposer alloc] init];

[composer setText:@"just setting up my Fabric"];
[composer setImage:[UIImage imageNamed:@"fabric"]];

[composer showFromViewController:self completion:^(TWTRComposerResult result) {
if (result == TWTRComposerResultCancelled) {
NSLog(@"Tweet composition cancelled");
} else {
NSLog(@"Sending Tweet!");
}
}];
}

@end