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#6 from ltranframgia/develop
Develop
- Loading branch information
Showing
34 changed files
with
831 additions
and
140 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,72 @@ | ||
// | ||
// 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() | ||
self.addBtnRightNavWithTitle(title: "Setting") | ||
} | ||
|
||
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) | ||
} | ||
|
||
override func actionTouchBtnRight() { | ||
let userSettingVC = LoginViewController.getViewControllerFromStoryboard(Storyboard.User.name) | ||
let navigationVC = UINavigationController(rootViewController: userSettingVC) | ||
|
||
// create animator for present | ||
// let animator = Animator(presentedType: .push, dismissedType: .push) | ||
// self.menuViewController?.animator = animator | ||
// | ||
// navigationVC.transitioningDelegate = self.menuViewController | ||
|
||
// present | ||
self.present(navigationVC, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// UserDao.swift | ||
// Project | ||
// | ||
// Created by Henry Tran on 6/24/17. | ||
// Copyright © 2017 THL. All rights reserved. | ||
// | ||
|
||
import RealmSwift | ||
|
||
struct UserDao { | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
struct Config { | ||
static let baseUrl = "https://dev.mvc.vn" | ||
static let clientId = "MVC" | ||
static let clientSecrect = "secret" | ||
static let dataVersion = 1 | ||
static let appId = "12345678" | ||
static let platform = "iOS" | ||
} |
File renamed without changes.
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,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" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
public struct GroupItem<Group, Item> { | ||
public var group: Group | ||
public var items: [Item] | ||
|
||
public init(group: Group, items: [Item]) { | ||
self.group = group | ||
self.items = items | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.