Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 61

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
04/15/14 08:01 PM (10 years ago)

Tab Bar - able to set variable (setPrefString) when icon tapped (iOS)

Looking to add code when a TabBar icon is tapped. For example doing a setPrefString for third icon (2) Have tried approaches where code is added to a blank screen after a tap, but would be a huge benefit to not require going thru another screen. Does anyone know where this code can be added. Have looked at: tabBarController.m and application.m but can not see where??
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/15/14 08:30 PM (10 years ago)
If you're looking to 'trigger' when a tab is pressed, you'll find that in your 'projectName_appDelegate.m' file, around line 475 or so… It's a method called "didSelectViewController" You would discern which tab was pressed by getting the value from [tabBarController selectedIndex] Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
04/16/14 04:08 AM (10 years ago)
Awesome Thanks! Should work perfect- will check out tonight.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/12/14 04:29 AM (9 years ago)
Hi NCbuzz did you manage to get the Scringo to launch from the Tab Bar Layout? If so, how? Don't really get what you guys have been discussing.
 

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.