tuanbinhb / IOSChallenge20092017

0 stars 1 forks source link

init base #4

Closed tuanbinhb closed 6 years ago

tuanbinhb commented 6 years ago
phamminhtien305 commented 6 years ago

-(id)initUsingNib{ -> - (id)initUsingNib { nhé =)) bé nhưng lên làm chuẩn từ đầu. Đọc cái style guide Tuyên chịch nó gửi đấy. Muốn init ngắn nữa thì viết thêm class function này nhé:


+ (id)initViewController {
        return [[self alloc] initWithNibName:[self nibName] bundle:nil];
}

UIStoryboard storyboard = [UIStoryboard storyboardWithName:@"Login" bundle:nil]; LoginViewController controller = [storyboard instantiateInitialViewController];

Chuyển hết về:
[info]
[[TimelineViewController alloc] initUsingNib];
Hoặc:
[TimelineViewController initViewController];
[/info]

Mấy cái hàm:

-(void)initNavigationBarView; -(void)initNavigationBarViewWithType:(NavigationBarType)type;

Sau này phân tích cái app xem có những loại navi nào mình sẽ update sau cũng được.

* Anh đã thấy em tạo một MainViewController. Cái này em thêm shareInstance cho nó nhé (singleton). Em initapplication trong này cũng được

*TabbarController:
- rootTab cái này để private đi em
Bổ sung cho anh thêm cái event này nữa đi :)). Sau này làm giống facebook double touch vào cái tabbar nó scroll lên top luôn :3.
[info]
- (IBAction)doubleTapOnButton:(id)sender;
[/info]

Tạo khung app:

Trong Apppdelegate self.window.rootViewController = [MainViewController shared]; Viết thêm hàm checklogin sử dụng userhelper hôm trước anh bảo nhé nếu chưa login thì present lên. Khi dismis thì lại trở về khung app đã xây dụng như trên. [self checklogin];