Set the initial screen image for the application with the Xcode Tab tab

New to Xcode, so I will try to correctly explain my needs.

I created a default tab bar template to create an application. The first tab is configured with a table view. I would like the home screen to simulate a splash screen and not display the table view until the user clicks a button on the tab bar. I would like the tab to not have the default button (highlighted) pressed until the user clicks on it.

Thus, in essence, I would like to have my initial view after loading the application, to mimic the presentation of the splash screen, but with a bottom tab bar, while the tab was not selected by default.

Thanks in advance for your help.

+3
source share
1 answer

I had the same problem. I used the following code. For it to work, it must be included in the application delegate. I use OSX and image, but you can use UIView instead. To do this, see the SDK or iPhone manuals. Code below:

.h class

@interface AppDelegate : NSObject {
    IBOutlet NSImageView *name;
}

- (IBAction)img1:(id)sender;
- (IBAction)img2:(id)sender;

@end

.m class

import "AppDelegate.h"

@implementation AppDelegate

- (IBAction)img1:(id)sender 
{
    NSImage *img = [NSImage imageNamed:@"Image1.png"]; [name setImage:img];
}

- (IBAction)img2:(id)sender 
{ 
    NSImage *img = [NSImage imageNamed:@"Image2.png"]; [name setImage:img]; 
}

@end
+1
source

Source: https://habr.com/ru/post/1794923/


All Articles