forked from ltransun-asterisk/BaseMVC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ltransun-asterisk#5 from ltranframgia/main_app
add location manager
- Loading branch information
Showing
16 changed files
with
680 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// LoginViewController.swift | ||
// BaseMVC | ||
// | ||
// Created by Henry Tran on 6/21/17. | ||
// Copyright © 2017 THL. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class LoginViewController: BaseViewController { | ||
|
||
// MARK: - IBOutlet | ||
|
||
// MARK: - Varialbes | ||
|
||
// MARK: - View Lifecycle | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
} | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
} | ||
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
} | ||
|
||
override func viewWillDisappear(_ animated: Bool) { | ||
super.viewWillDisappear(animated) | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
// MARK: - Navigation | ||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
// Get the new view controller using segue.destinationViewController. | ||
// Pass the selected object to the new view controller. | ||
} | ||
|
||
// MARK: - Setup View | ||
|
||
// MARK: - Call Api | ||
|
||
// MARK: - Actions | ||
@IBAction func actionTouchBtnLogin(_ sender: Any) { | ||
self.mainTabBarViewController?.setupMainApp() | ||
self.dismiss(animated: true, completion: nil) | ||
} | ||
|
||
// MARK: - Functions | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import UIKit | ||
|
||
enum TabBarType: String { | ||
case timeline | ||
case message | ||
case more | ||
} | ||
|
||
class MainTabBarController: UITabBarController { | ||
|
||
// MARK: - Varialbes | ||
|
||
// MARK: - View Lifecycle | ||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
|
||
// setup | ||
self.setupStartApp() | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
// self.view.alpha = 0.0 | ||
// setup view | ||
self.setupView() | ||
} | ||
|
||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
} | ||
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
|
||
// animate when appear | ||
UIView.animate(withDuration: 0.5) { | ||
self.view.alpha = 1.0 | ||
} | ||
} | ||
|
||
override func viewWillDisappear(_ animated: Bool) { | ||
super.viewWillDisappear(animated) | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
// MARK: - Setup View | ||
private func setupView() { | ||
|
||
} | ||
|
||
func hideTabbar(hide: Bool?, animated: Bool = false) { | ||
self.tabBar.isHidden = hide ?? false | ||
} | ||
|
||
// MARK: - Actions | ||
|
||
// MARK: - Call Api | ||
|
||
// MARK: - Functions | ||
private func setupStartApp() { | ||
let startViewController = StartViewController.getViewControllerFromStoryboard(Storyboard.Main.name) | ||
// set list childs controller to tabbar | ||
let controllers = [startViewController] | ||
self.viewControllers = controllers | ||
self.hideTabbar(hide: true) | ||
} | ||
|
||
func setupMainApp() { | ||
|
||
// Timeline | ||
let navigationTimeline = UIStoryboard(name: Storyboard.Timeline.name, bundle: nil).instantiateInitialViewController()! | ||
let tabBarItemTimeline = UITabBarItem(tabBarSystemItem: .contacts, tag: 10) | ||
navigationTimeline.tabBarItem = tabBarItemTimeline | ||
|
||
// Message | ||
let navigationMessage = UIStoryboard(name: Storyboard.Message.name, bundle: nil).instantiateInitialViewController()! | ||
let tabBarItemMessage = UITabBarItem(tabBarSystemItem: .bookmarks, tag: 20) | ||
navigationMessage.tabBarItem = tabBarItemMessage | ||
|
||
// User | ||
let navigationUser = UIStoryboard(name: Storyboard.User.name, bundle: nil).instantiateInitialViewController()! | ||
let tabBarItemUser = UITabBarItem(tabBarSystemItem: .more, tag: 30) | ||
navigationUser.tabBarItem = tabBarItemUser | ||
|
||
// set list childs controller to tabbar | ||
let controllers = [navigationTimeline, navigationMessage, navigationUser] | ||
self.viewControllers = controllers | ||
self.hideTabbar(hide: false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
// | ||
enum DateFormat: String { | ||
case yyyyssDash = "yyyy-MM-dd'T'HH:mm:ss" | ||
case ddmmSlash = "dd/MM/yyyy HH:mm" | ||
case ddMMyyyy = "dd/MM/yyyy" | ||
case yyyyMMddDash = "yyyy-MM-dd" | ||
case MMyyyy = "MM/yyyy" | ||
case yyyyssSSSZZZZZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" | ||
} |
Oops, something went wrong.