트위터를 쓸라며는

#import <Twitter/Twitter.h>


if ([TWTweetComposeViewController canSendTweet]) {
                twBtn.selected = YES;
                ACAccountStore *acStore = [[ACAccountStore alloc] init];
                ACAccountType *acType = [acStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
                [acStore requestAccessToAccountsWithType:acType withCompletionHandler:^(BOOL granted, NSError *error) {
                   
                    //                if( !granted ){
                    //                    // todo: error msg to user.
                    //                    twBtn.selected = NO;
                    //                    return;
                    //                }
                   
                    NSArray *arrayOfAccounts = [acStore accountsWithAccountType:acType];
                    if ([arrayOfAccounts count]) {
                        twAccount = [arrayOfAccounts objectAtIndex:0];
                        twBtn.selected = YES;
                    } else {
                        [[[[iToastNew makeText:@"트위터 계정 없음 ㅠ"]
                           setGravity:iToastGravityTop] setDuration:iToastDurationShort] show];
                        twBtn.selected = NO;
                    }
                }];

            } else {
                //todo : 설정에서 트위터 아이디 설정해야함
            }

예전에 페이스북처럼 웹으로 넘어갔다가 다시 왔는디 이건 설정에 트위터 계정 등록되어 있어야 사용 가능한 부분.


이래야 하는건가? ㅋㅋ

아 퇴근하고 싶어서 집중이 안된다. 나중에 추가 설명 고고싱 ㅠ

+ Recent posts