iOS>> ShareKit>>选择所需的共享服务 [英] iOS >> ShareKit >> Selecting the Required Sharing Services
问题描述
在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屋!