Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 101

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
01/19/14 09:30 AM (10 years ago)

BT30 - Day 15 - Add custom button to Socialize

BT30 is my personal project to contribute to buzztouch: https://www.buzztouch.com/forum/thread.php?fid=2348BA49BA5737C92E3D9B5&tid=2348BA49BA5737C92E3D9B5 Day 15 - Add custom button to Socialize Bar! --------------- DESCRIPTION --------------- This code is real fun, add custom buttons to your Socialize Bar that go to BT screens! SO COOL! Very usefull if you use socialize and want to make it more integrated into your app, so enough talking, lets do it! (super simple) ------- CODE ------- IN PLUGIN .M FILE YOU USED TO SHOW SOCIALIZE 1. CREATE NEW FUNCTION - (void)sharenewButtonPress{ YOURAPPNAME_appDelegate *appDelegate = (YOURAPPNAME_appDelegate *)[[UIApplication sharedApplication] delegate]; BT_item *screenToLoad = [appDelegate.rootApp getScreenDataByNickname:@"Share Menu"]; [BT_viewControllerManager handleTapToLoadScreen:nil theMenuItemData:nil theScreenData:screenToLoad]; } 2. THEN ADD THIS TO VIEW WILL APPEAR //this code adds a new custom button linked to screen SZActionButton *newshareButton = [SZActionButton actionButtonWithIcon:nil title:@"Share"]; newshareButton.actionBlock = ^(SZActionButton *button, SZActionBar *bar) { //code here [self sharenewButtonPress]; }; // self.actionBar.itemsLeft = [NSArray arrayWithObjects:panicButton, [SZActionButton viewsButton], nil]; self.actionBar.itemsLeft = [NSArray arrayWithObjects:[SZActionButton viewsButton], newshareButton, nil]; ------- NOTES ------- 1. Notice, this code will launch the screen you named nickname screenname "Share", change "Share" to whatever screen name you made with another plugin that you want opened with your new custom button! 2. Change all instances of "YOURAPPNAME" to your project name. Hope this helps someone. David
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/19/14 10:17 AM (10 years ago)
Nice! I have to check socialize out again. With the new 3.0 core back in December my socialize didn't show up with Image plugin. I guess because there are still a few bugs in the tab bar? Have you gotten it to work with the Mac Image plugin? I prefer using Socialize in my gallery :)
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
01/19/14 10:50 AM (10 years ago)
Once your done with the 30 days I hope you put all of these in a pdf.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/19/14 10:52 AM (10 years ago)
@mysps I got it to work, never noticed an issue! @Aruba, of course! Will do something like that for-sure. David
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.