iOS>> ShareKit>>选择所需的共享服务 [英] iOS >> ShareKit >> Selecting the Required Sharing Services

查看:144
本文介绍了iOS>> ShareKit>>选择所需的共享服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中实现了ShareKit。我可以使用它的默认方式,但我希望控制可用的用户选择的服务;更具体地说,我不想处理默认嵌入的所有服务,只有Facebook,Twitter和Mail。



在ShareKit文件中哪里做这些设置(删除所有这些忽略的服务,我不想处理他们的API等)?

解决方案

您需要在ShareKit框架中编辑 SHK.m 。将 favoriteSharersForType:方法更改为:

  favoriteSharers = [NSArray arrayWithObjects :@SHKFacebook,@SHKTwitter,nil]; 
return favoriteSharers;

您可以随时从此阵列中添加/删除服务。



编辑



要删除更多...按钮,找到 actionSheetForType 方法在 SHKActionSheet.m 并删除:



[as addButtonWithTitle :SHKLocalizedString(@More ...)];



完成后,您将需要修复索引。找到 dismissWithClickedButtonIndex:代理方法,并删除整个 else if(buttonIndex == sharers.count)块。 p>

I've implemented ShareKit in my app. I'm OK with the default way that it works, but I wish to control the services available to the user to select from; to be more specific, I don't want to deal with all the service embedded by default and just have Facebook, Twitter and Mail.

Where in the ShareKit files do I do these settings (removing all of these neglected services that I don't want to deal with their APIs and such)?

解决方案

You would need to edit SHK.m in the ShareKit framework. Change the favoriteSharersForType: method to only:

favoriteSharers = [NSArray arrayWithObjects:@"SHKFacebook", @"SHKTwitter", nil];
return favoriteSharers;

You can add/remove services from this array as you please.

EDIT

To remove the More... button, locate the actionSheetForType method in SHKActionSheet.m and remove:

[as addButtonWithTitle:SHKLocalizedString(@"More...")];

After completing this, you will need to fix the indices. Locate the dismissWithClickedButtonIndex: delegate method and delete the entire else if (buttonIndex == sharers.count) block.

这篇关于iOS>> ShareKit>>选择所需的共享服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆