Storyboards Tutorial (iii)

Source: Internet
Author: User

This section mainly introduces Segues,static table view cells and Add Player screen and a game picker screen.

Introducing segues

Open Main.storyboard Drag a bar Button item to the right of the players window navigation bar. Change the identifier to add in Attributes Inspector and A + button will appear.

When the user clicks, a modal window pops up to enter the details of the new player.

Drag a new navigation controller and then Ctrl+drag to connect the previous plus sign to the view controller. Select Modal.

This connection is known as Segue (Seg-way), which represents the transfer from one screen to another. By eating segue you do not need to write code for the display of the view room.

Run the code, click the plus sign, and a new page will appear.

Create a new Playerdetailsviewcontroller and set the class of the table view controller in the previous modal to Playerdetailsviewcontroller. Double-click Navigation bar to change the name to add Player. Add cacel and Done bar item.

The following modifications are made in the PlayerDetailsViewController.h:

#import <UIKit/UIKit.h>

@class Playerdetailsviewcontroller;

@protocol Playerdetailsviewcontrollerdelegater <NSObject>

-(void) Playerdetailsviewcontrollerdidcancel: (Playerdetailsviewcontroller *) controller;
-(void) Playerdetailsviewcontrollerdidsave: (Playerdetailsviewcontroller *) controller;

@end

@interface Playerdetailsviewcontroller:uitableviewcontroller
@property (nonatomic, weak) ID <PlayerDetailsViewControllerDelegater>delegate;

-(Ibaction) Cancel: (ID) sender;
-(Ibaction) Done: (ID) sender;

@end

Storyboards Tutorial (iii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.