Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>in SHK.m find this method </p> <pre><code>+ (NSArray *)favoriteSharersForType:(SHKShareType)type </code></pre> <p>and change</p> <pre><code>switch (type) { case SHKShareTypeURL: favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]; break; case SHKShareTypeImage: favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]; break; case SHKShareTypeText: favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]; break; case SHKShareTypeFile: favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]; break; </code></pre> <p>to the following for each instance of the switch statement:</p> <pre><code>favoriteSharers = [NSArray arrayWithObjects:@"SHKFacebook", nil]; </code></pre> <p>or what ever other options you want to support (ie if you only want twitter and facebook add @"SHKTwitter", to the array)</p> <p>that will eliminate the other options but the action sheet that displays the options wont reflect the change and it will still give the more option, which we also need to disable.</p> <p>So to do that go to SHKActionSheet.m</p> <p>in this method you can change the title from "Share" to something more specific (this part is optional) ie "Share with Facebook and Twitter"</p> <pre><code>+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type </code></pre> <p>change</p> <pre><code>SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"PUT YOUR NEW TITLE HERE") delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil]; as.item = [[[SHKItem alloc] init] autorelease]; as.item.shareType = type; </code></pre> <p>than in that same method, delete this line</p> <pre><code> // Add More button [as addButtonWithTitle:SHKLocalizedString(@"More...")]; </code></pre> <p>that will remove the more button but now the code will now confuse the more button with the cancel button, so to fix that, go to this method:</p> <pre><code>- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated </code></pre> <p>and delete the following else if statement</p> <pre><code>// More else if (buttonIndex == sharers.count) { SHKShareMenu *shareMenu = [[SHKCustomShareMenu alloc] initWithStyle:UITableViewStyleGrouped]; shareMenu.item = item; [[SHK currentHelper] showViewController:shareMenu]; [shareMenu release]; } </code></pre> <p>what this method is susposted to do is take the button that is normally the more button and open the more options. So by deleting it the code has no associated action with the cancel button so it just closes and release the action sheet, effectively creating a cancel button</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload