Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 74

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
03/01/14 12:32 PM (10 years ago)

Load Scringo with tab bar (or tabbar utility)?

I have scringo installed at it works great. Currently setup as a sidebar to come up when swiping in from the left. I also have the code to launch it full screen with a button press event. Trying to figure out how to load the full screen from a tab within my tabbar utility plugin, and can't seem to make it work. Willing to modify the files if needed, no issues there. This is for the regular version of Scringo, not the Scringo chat room plugin. Chris1, Tabbar Utility is setup to launch a screen in the project. Is there any possible workflow that you can think of that would allow me to use the code to make a button launch scringo to execute on a BT screen? I tried adding the code to a viewdidload on the blank screen plugin, but that just launched the scringo view over the top of a blank BT screen, so when the user hits the back button, it showed a blank screen, and one would have to hit back again. I'm guessing the scringo framework creates a subview over the top of the existing view. Short of making a screen trigger the scringo code... is there a mod I can do to the tabbar utility plugin that will just affect tab1 (not the home screen tab, the next one)? I looked at the code, but seems to use an array for the tab numbers, which makes it difficult to just affect one of the tabs. The only reason the side bar version of scringo isn't ideal for my project is I use a horizontal Buzz Carousel menu in several of my screens, so swiping horizontally left or right is how the user navigates those menus... now, with the sidebar installed, user swipes those menus from the right, no problem. If they swipe from the left, scringo pops up over the top of their menu they are trying to navigate
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/01/14 06:47 PM (10 years ago)
It'll take a little surgery, but a possibility would be to 'directly swap out' a tabbed screen. Not talking Chris' plugin; not sure how I'd implement on that. But for a 'regular' BT Tabbed layout, you might try the following: 1) Use a 'blank screen' for your tab screen assignment. Note the 'index' of the tab, counting from 'zero', so if it 'were' the fourth tab, it would be tab 'index' 3, etc… 2) In your BT_application.m file, find the 'buildInterface' method, and locate the area where the tabs (if any) are populated. In mine, it's close to line 530-ish a bit further (554ish) you'll see where it populates the tabs one at a time: for(int i = 0; i < [[self tabs] count]; i++) { So, what you'll want to do is add an 'if' statement to grab control when it reaches your 'scringo' tab… for(int i = 0; i < [[self tabs] count]; i++){ if (i == 3) { // isolating your 'blank' screen code to put scringo in goes here… } else { all that normal code that already exists within the loop should be cut and pasted here } } // end of for…loop Naturally, a backup is recommended before too much editing is done. Cheers! -- Smug
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
03/01/14 06:52 PM (10 years ago)
Cool, thanks smug. I think I can use the basic principle above and apply it to Chris's tabbar plugin. Have to keep those shiny colored icons in my tabbar ya know :)
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
03/01/14 07:58 PM (10 years ago)
Smug, you're a damn genius! For anyone else looking to do it with Chris1's tabbar utility (and more to archive it for myself if I ever need to do it again, lol), In CR_tabbar_utilities.m... --------------------------------------------- Import the header at the top of the file --------------------------------------------- #import "Scringo/Scringo.h" ---------------------------------------------- The example below shows tapping it on my second tab (rowIndex 1) Around line 492, replace the entire section with this (thanks Smug!): ---------------------------------------------- //on row select - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didSelectRowAtIndexPath: Selected Row: %i", indexPath.row]]; if (indexPath.row == 1) { // first tab is 0, 2nd is 1, 3rd is 2, 4th is 3.... etc, etc [Scringo initWithAppId:@"YOUR_APP_ID_HERE" completion:^{ [Scringo openMenuWithNavigationController:nil withScringoNavControllerEnabled:YES]; }]; } else{ //appDelegate universal_appDelegate *appDelegate = (universal_appDelegate *)[[UIApplication sharedApplication] delegate]; NSLog(@"setting VC to %i of %i", indexPath.row, appDelegate.rootApp.rootTabBarController.viewControllers.count); appDelegate.rootApp.rootTabBarController.selectedIndex = indexPath.row; appDelegate.rootApp.rootTabBarController.selectedViewController = [appDelegate.rootApp.rootTabBarController.viewControllers objectAtIndex:indexPath.row]; } }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
03/01/14 10:19 PM (10 years ago)
good job, Angry Ninja! Suggestion -- lets make this a bit bulletproof, in the way Smug had implied. Rather than hardcoding it to the Row #, match it to the "itemNickname" of the Blank Screen. That way, you can move it around, yet still be connected to it. In a few months, you will be glad you went the extra mile on this tip. ( Attention students -- this is an independant study homework assignment :-) -- Niraj
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
04/15/14 07:29 PM (10 years ago)
Hi all... I am back at the Tab Bar again... Trying yet another approach with Scringo. The code from Smug above would not work for this approach as I am looking to execute code when the Tab Bar icon is tapped as opposed to being setup. Will try starting a new thread.... https://www.buzztouch.com/forum/thread.php?tid=BFBEC09D01BEF508FDE5010&fid=BC70C36A743CD4FAD95D17F&sortColumn=FT.id&sortUpDown=DESC&currentPage=1
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/16/14 06:17 AM (10 years ago)
Hey NCBuzz, That's what the above code does... When the 2nd icon in the tabbar is tapped (changeable to whatever icon you want to tap by changing the indexpath.row number. See the post I made showing the app.io demo of my universal studios app to see it in action.when the "social" tab is tapped in the tabbar, the above scringo code fires. It's just placed in the tabbar utility code so that it knows what to do in advance when the tabbar is created, but not fired until the tab is pressed
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
04/16/14 08:40 AM (10 years ago)
Heck, don't go to his App.io -- just buy the doggone app! Then you will experience it in all of its glory :-) https://itunes.apple.com/us/app/universal-orlando-tour-guide/id857178975?mt=8
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/16/14 08:43 AM (10 years ago)
That works too! :) (thanks Niraj!)
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
04/16/14 11:46 AM (10 years ago)
The code above only works for Chris1 TabBar utilities The link above with tip from Smug should work for the a normal tab. ( I will post a short how to after implementing)
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
10/10/14 10:24 PM (9 years ago)
I'm trying to implement something similar on Android (eventually iOS), was wondering if anyone could help me out. I basically want the home screen of my app to be a full screen scringo home screen. So when the app first opens, they see the scringo menu full screen. Right now I have a blank screen set as my homescreen, but I'm unsure of where to go from here..
 

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.