Reputation: 345
in my application I have a UIView
object in second view controller. Now I want to display the UIView as a popup or sub view when I click the button from first view controller. Please tell me how to do this? I have seen many solution for the nib files but I didn't find any for storyboard.
I have connected the IBOulet
of view in my second view controller.
@property (strong, nonatomic) IBOutlet UIView *popview;
And i have imported the second view controller in my firstview please tell me how to make this one i have been stuck here for long time please help me out on this one.
Thanks.
Upvotes: 0
Views: 428
Reputation: 959
You don't need an extra UIViewController
@property (strong, nonatomic) IBOutlet UIView *popview;
) Upvotes: 0
Reputation: 461
Try Adding this in your code
-(void)viewDidLoad
{
popView.hidden=true;}
and when ever user clicks an action change the hidden property to false just like
-(IBAction)AnyActionPerferformed:(id)sender
{
popView.hidden=false;
}
You can Learn about this from
https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/AboutViewControllers/AboutViewControllers.html
Upvotes: 0
Reputation: 2503
In your FirstViewController
which has UIView *popview
:
- (void)viewDidLoad
{
[super viewDidLoad];
// you don't want to show PopView
self.popview.alpha = 0;
}
- (void) showPopView
{
//you want to show PopView
self.popview.alpha = 1;
}
Upvotes: 1