0

I am looking to have a custom looking tweet sheet to use in my application.

Obviously I can build my own and use the twitter API for posting; however, this would SEEM (Maybe its not THAT MUCH work, I can't say) to take a lot of work to build, especially in features like autocomplete for user twitter followers etc.

Is there anyway to customize the tweet sheet used by Apple's frameworks? It just looks god awful, especially compared to the design of my app.

If not, where can I look to implement the displaying friend results while typing in @user?

Any thoughts, idea's, links, suggestions would be great. Thanks in advance!

4

2 回答 2

0

这是您自己的自定义推文表的一个良好开端: https ://github.com/doubleencore/DETweetComposeViewController

于 2013-10-17T17:10:04.580 回答
0

您可以使用 Social.framework 使用系统中的帐户数据对您的请求进行签名。

第二步 - 为推特创建自己的视图。

第三 - 获取 ACAccount。像这样:

ACAccountStore *store = [[ACAccountStore alloc] init];
    ACAccountType *accountTypeTwitter = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    [store requestAccessToAccountsWithType:accountTypeTwitter options:nil completion:^(BOOL granted, NSError *error) {
                                     if(granted) {
                                         dispatch_sync(dispatch_get_main_queue(), ^{
                                             NSArray *accounts = [store accountsWithAccountType:accountTypeTwitter];

                                             //All twitter accounts are in array, show sheet to select one of them.
                                         });
                                     }
                                 }];

第四 - 将 SLRequest 发送到 twitter 以进行发布。

SLRequest 示例(获取有关用户的信息):

 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.twitter.com/1.1/users/show.json?screen_name=%@",account.username]];

        SLRequest *req = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:url parameters:nil];
        [req setAccount:account];
        [req performRequestWithHandler:^(NSData *respData, NSHTTPURLResponse *resp, NSError *err){
//Req finished
        }];
于 2013-07-21T20:14:14.000 回答