Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 64

AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
07/31/13 07:04 PM (12 years ago)

QuizTimer in Navigation Bar

Hi, does anyone know how to put the QuizTimer in the quiz's Navigation Bar? (Quiz plugin iOS) Thanks
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
08/01/13 02:50 AM (12 years ago)
easy go to BT_screen_quiz.m scroll to line 723 it should be the method below //quizRunningLoop -(void)quizRunningLoop{ //if we are showing the timer if(quizShowTimer){ [quizTimeLabel setHidden:FALSE]; //setup text in footer label if(quizRunning){ //increment seconds [self setTotalSeconds:totalSeconds + 1]; NSString *formatted = [NSString stringWithFormat:@"%d", totalSeconds]; [quizTimeLabel setText:[BT_strings formatTimeFromSeconds:formatted]]; } }else{ [quizTimeLabel setHidden:TRUE]; } } replace this line [quizTimeLabel setText:[BT_strings formatTimeFromSeconds:formatted]]; with this self.navigationController.navigationBar.topItem.title = [BT_strings formatTimeFromSeconds:formatted]; and your good to go the method should now look like this //quizRunningLoop -(void)quizRunningLoop{ //if we are showing the timer if(quizShowTimer){ [quizTimeLabel setHidden:FALSE]; //setup text in footer label if(quizRunning){ //increment seconds [self setTotalSeconds:totalSeconds + 1]; NSString *formatted = [NSString stringWithFormat:@"%d", totalSeconds]; self.navigationController.navigationBar.topItem.title = [BT_strings formatTimeFromSeconds:formatted]; } }else{ [quizTimeLabel setHidden:TRUE]; } }
 
AppOne
buzztouch Evangelist
Profile
Posts: 348
Reg: Apr 03, 2012
London
13,980
like
08/01/13 04:31 PM (12 years ago)
Thanks Kittsy - worked like a charm!!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/17/14 03:49 AM (11 years ago)
Awesome post :) worked great.. Especially because my timer seemed to have disappeared. Thanks Kittsy.
 

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.