Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 69

MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
01/11/14 07:11 AM (11 years ago)

Launch Screen question

Hey, I'm using the launch screen plugin. I set it up to be able to use a different menu plugin if 3inch or 4inch iphone. Using the tabbed layout, I set the first tab to be the launch screen, the app loads the correct menu depending on the device. So far so good. But after browsing the app, when I again select the first button tab, that is set for the launch screen, it just loads blank. It does not load the correspondent menu plugin. Any suggestions? Thanks. Miguel
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/11/14 09:48 AM (11 years ago)
Hi MadRod: I have figured out a solution to this problem, however there is one slight problem. When the right menu loads, it loads with a "back" button. When this button is tapped, nothing happens, but I can not seem to remove it. Here is an example: http://jakeserver.com/Uploads/Buzztouch/JC_LaunchScreen-HomescreenExample.mov Jake
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/11/14 10:59 AM (11 years ago)
For MadRod: Check the JSON to see if that Tab is assigned to be the desired screen (plugin). ---------------------- For Jake: Each tab is it's own stack of screens to push and pop. When one switches to another Tab, the current Tab's stack is saved in memory. Then the new Tab's stack is used. If the new Tab is truly new, then it starts off with that Tab's primary screen. If the new Tab had previously been used, then it picks up from the saved state of the stack. In Jake's example, he clicked on the bottom single Tab, that initiates the scenario as described above. -- Niraj
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/11/14 12:37 PM (11 years ago)
@Niraj: Yes, I believe the problem that is interesting has to do with the viewDidLoad, viewDidAppear, and viewWillAppear. Unless a memory error (or low memory) is experienced, iOS will save the view in RAM, so when you click the tab bar item, it will not reload the screen because that instance of JC_LaunchScreen believes it already has loaded a screen. What I have discovered is this: viewDidLoad - Loads only once viewDidAppear - Loads after the initial view has loaded (every time it is brought into the foreground) viewWillAppear - Loads every time the view is brought into the foreground. The example I recorded showed what happens if the screen is loaded in the viewWillAppear method, instead of the viewWillLoad. The one problem I am running into, is trying to remove the "Back" button from the screen that is supposed to be the home screen, and replace it with the "Refresh" button. Does this sound right? Thanks, Jake
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/11/14 01:08 PM (11 years ago)
Go back to the post in which you had asked about the Status bar fonts and colors. In there, I had responded with how to change the color of the refresh arrow. Then go look at the code with Xcode. Within that code section, you can glean a way to achieve your goal. That code section will give you some hints and things to think about. Let us know how you get along. See ya soon in SD Buzzday! -- Niraj
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
01/11/14 01:27 PM (11 years ago)
Ok, but if I'm the screens with no nav bar, I won't have that problem, right? I'll try it out. Where in the code should I change into viewwillappear? Thanks guys. Miguel
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/11/14 02:40 PM (11 years ago)
@MadRod: Can you PM me your email address and I will send you the updated code? Jake
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
01/11/14 02:59 PM (11 years ago)
Everyone: this is what you have to do (as of right now) to fix this problem. 1. Change the function name of from "viewDidLoad" to -(void)viewDidAppear:(BOOL)animated around line 52. 2. Comment out the existing viewWillAppear around line 110. Does this help? Jake
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
01/11/14 03:23 PM (11 years ago)
Seems to work fine. Thanks.
 

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.