Commit 30004d7d by Daniel Dahan

added performance updates

parent b864a98b
...@@ -39,7 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -39,7 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let bottomNavigationController: BottomNavigationController = BottomNavigationController() let bottomNavigationController: BottomNavigationController = BottomNavigationController()
bottomNavigationController.viewControllers = [AppNavigationController(rootViewController: RecipesViewController()), VideoViewController(), PhotoViewController()] bottomNavigationController.viewControllers = [AppMenuViewController(mainViewController: AppNavigationController(rootViewController: RecipesViewController())), VideoViewController(), PhotoViewController()]
bottomNavigationController.selectedIndex = 0 bottomNavigationController.selectedIndex = 0
bottomNavigationController.tabBar.tintColor = MaterialColor.lightBlue.base bottomNavigationController.tabBar.tintColor = MaterialColor.lightBlue.base
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4 bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
......
...@@ -100,11 +100,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -100,11 +100,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController
} }
} }
} }
if let v: Array<UIViewController> = viewControllers {
for controller in v {
controller.edgesForExtendedLayout = .None
}
}
} }
/** /**
...@@ -115,6 +110,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -115,6 +110,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepareView() {
view.clipsToBounds = true
delegate = self delegate = self
tabBar.depth = .Depth1 tabBar.depth = .Depth1
tabBar.backgroundColor = MaterialColor.white tabBar.backgroundColor = MaterialColor.white
...@@ -122,6 +118,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -122,6 +118,7 @@ public class BottomNavigationController : UITabBarController, UITabBarController
tabBar.backgroundImage = UIImage() tabBar.backgroundImage = UIImage()
} }
/// Handles transitions when tabBarItems are pressed.
public func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { public func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return .Fade == transitionAnimation ? BottomNavigationFadeAnimatedTransitioning() : nil return .Fade == transitionAnimation ? BottomNavigationFadeAnimatedTransitioning() : nil
} }
......
...@@ -153,6 +153,8 @@ public class MenuViewController : UIViewController { ...@@ -153,6 +153,8 @@ public class MenuViewController : UIViewController {
/// A method that generally prepares the MenuViewController. /// A method that generally prepares the MenuViewController.
private func prepareView() { private func prepareView() {
edgesForExtendedLayout = .None
view.clipsToBounds = true
prepareMenuView() prepareMenuView()
prepareMainViewController() prepareMainViewController()
} }
......
...@@ -60,6 +60,8 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD ...@@ -60,6 +60,8 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
public override func viewDidLoad() { public override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
edgesForExtendedLayout = .None
view.clipsToBounds = true
// This ensures the panning gesture is available when going back between views. // This ensures the panning gesture is available when going back between views.
if let v: UIGestureRecognizer = interactivePopGestureRecognizer { if let v: UIGestureRecognizer = interactivePopGestureRecognizer {
......
...@@ -723,6 +723,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -723,6 +723,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// A method that generally prepares the SideNavigationController. /// A method that generally prepares the SideNavigationController.
private func prepareView() { private func prepareView() {
edgesForExtendedLayout = .None
prepareMainViewController() prepareMainViewController()
prepareLeftView() prepareLeftView()
prepareRightView() prepareRightView()
...@@ -733,6 +734,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel ...@@ -733,6 +734,7 @@ public class SideNavigationController : UIViewController, UIGestureRecognizerDel
/// A method that prepares the mainViewController. /// A method that prepares the mainViewController.
private func prepareMainViewController() { private func prepareMainViewController() {
mainViewController.view.clipsToBounds = true
prepareViewControllerWithinContainer(mainViewController, container: view) prepareViewControllerWithinContainer(mainViewController, container: view)
} }
......
...@@ -114,6 +114,8 @@ public class StatusBarViewController : UIViewController { ...@@ -114,6 +114,8 @@ public class StatusBarViewController : UIViewController {
when subclassing. when subclassing.
*/ */
public func prepareView() { public func prepareView() {
edgesForExtendedLayout = .None
view.clipsToBounds = true
prepareMainViewController() prepareMainViewController()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment