Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 151

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
04/25/13 09:05 AM (12 years ago)

Removed refresh button, now to add one?

Hi guys, Used Kittsy's awesome tweak to remove the refresh button from the top left navigation bar on the homescreen: https://www.buzztouch.com/forum/thread.php?tid=92B9273E946FB5DEF8AC5CB Now I would like to replace it with a new button, that will link to a predefined screen. Any ideas how I would accomplish this? Thanks! David https://buzztouchmods.com
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
04/25/13 10:04 AM (12 years ago)
So that refresh button sends you to a function called downloadAppData. You can either change that function call to something that you write. Or dig into the downloadAppData function and make some changes. initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:appDelegate action:@selector(downloadAppData)]; You'll also need to uncomment that code from the kittys post.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
04/25/13 10:52 AM (12 years ago)
I wouldn't make any use of the appdelegate I'm not at the mac setting up my new home office give me an hour or two it's only one line of code to add a nav bar button. The launch screen method I guess you know if not ill add that also
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
04/25/13 11:00 AM (12 years ago)
To add a button add this to the plugin that is the new home screen In the view did load screen UIBarButtonItem *newRefreshButton = [[UIBarButtonItem alloc] initWithTitle:@"Yipee" style:UIBarButtonItemStyleBordered target:self action:@selector(methodToLaunchScreen)]; self.navigationItem.leftBarButtonItem = newRefreshButton; [newRefreshButton release]; Then for your method -(void)methodToLaunchScreen){ Code to load } Hope this helps
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
04/25/13 11:01 AM (12 years ago)
If this plugin is used on multiple screen you may need to add a if this is home screen statement Not sure if the back button will override it
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
04/25/13 11:10 AM (12 years ago)
If your using this for scringo Add #import <Scringo/ScringoAgent.h> self.navigationItem.leftBarButtonItem = [scringoagent scringoActivationBarItem]; That line may not be accurate but start typing and the auto fill should take over
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
04/25/13 11:14 AM (12 years ago)
Kittsy you are a LIFESAVER. THANK YOU. David https://buzztouchmods.com
 

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.