Commit e85b4f14 by Daniel Dahan

fixed issue-196, where NavigationBarView was not sizing correctly on iPad

parent 83bb987b
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationBarViewController(mainViewController: InboxViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController()) window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationBarViewController(mainViewController: InboxViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -59,7 +59,7 @@ class ViewController: UIViewController { ...@@ -59,7 +59,7 @@ class ViewController: UIViewController {
let imageCardView: ImageCardView = ImageCardView() let imageCardView: ImageCardView = ImageCardView()
// Image. // Image.
let size: CGSize = CGSizeMake(UIScreen.mainScreen().bounds.width - CGFloat(40), 150) let size: CGSize = CGSizeMake(MaterialDevice.bounds.width - CGFloat(40), 150)
imageCardView.image = UIImage.imageWithColor(MaterialColor.cyan.darken1, size: size) imageCardView.image = UIImage.imageWithColor(MaterialColor.cyan.darken1, size: size)
// Title label. // Title label.
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -60,7 +60,7 @@ class ViewController: UIViewController { ...@@ -60,7 +60,7 @@ class ViewController: UIViewController {
*/ */
private func prepareGeneralMaterialLayerExample() { private func prepareGeneralMaterialLayerExample() {
let diameter: CGFloat = 150 let diameter: CGFloat = 150
let point: CGFloat = UIScreen.mainScreen().bounds.width / 2 - diameter / 2 let point: CGFloat = MaterialDevice.bounds.width / 2 - diameter / 2
let materialLayer: MaterialLayer = MaterialLayer(frame: CGRectMake(point, point, diameter, diameter)) let materialLayer: MaterialLayer = MaterialLayer(frame: CGRectMake(point, point, diameter, diameter))
materialLayer.shape = .Circle materialLayer.shape = .Circle
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -51,7 +51,7 @@ class ViewController: UIViewController { ...@@ -51,7 +51,7 @@ class ViewController: UIViewController {
/// Prepares the MaterialPulseView example. /// Prepares the MaterialPulseView example.
private func prepareGeneralMaterialPulseViewExample() { private func prepareGeneralMaterialPulseViewExample() {
let point: CGFloat = (UIScreen.mainScreen().bounds.width - 150) / 2 let point: CGFloat = (MaterialDevice.bounds.width - 150) / 2
let pulseView: MaterialPulseView = MaterialPulseView(frame: CGRectMake(point, point, 150, 150)) let pulseView: MaterialPulseView = MaterialPulseView(frame: CGRectMake(point, point, 150, 150))
pulseView.image = UIImage(named: "Graph") pulseView.image = UIImage(named: "Graph")
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -52,7 +52,7 @@ class ViewController: UIViewController { ...@@ -52,7 +52,7 @@ class ViewController: UIViewController {
/// Prepare the MaterialView. /// Prepare the MaterialView.
private func prepareGeneralMaterialViewExample() { private func prepareGeneralMaterialViewExample() {
let point: CGFloat = (UIScreen.mainScreen().bounds.width - 125) / 2 let point: CGFloat = (MaterialDevice.bounds.width - 125) / 2
let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, 125, 125)) let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, 125, 125))
materialView.image = UIImage(named: "CosmicMind") materialView.image = UIImage(named: "CosmicMind")
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = AppMenuViewController(mainViewController: YellowViewController()) window!.rootViewController = AppMenuViewController(mainViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = AppNavigationBarViewController(mainViewController: YellowViewController()) window!.rootViewController = AppNavigationBarViewController(mainViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = AppSearchBarViewController(mainViewController: YellowViewController()) window!.rootViewController = AppSearchBarViewController(mainViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = SideNavigationViewController(mainViewController: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController()) window!.rootViewController = SideNavigationViewController(mainViewController: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
return true return true
......
...@@ -44,7 +44,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -44,7 +44,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController let sideViewController = storyboard.instantiateViewControllerWithIdentifier("SideViewController") as! SideViewController
// Configure the window with the SideNavigationViewController as the root view controller // Configure the window with the SideNavigationViewController as the root view controller
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: MaterialDevice.bounds)
window?.rootViewController = SideNavigationViewController(mainViewController: mainViewController, leftViewController: sideViewController) window?.rootViewController = SideNavigationViewController(mainViewController: mainViewController, leftViewController: sideViewController)
window?.makeKeyAndVisible() window?.makeKeyAndVisible()
return true return true
......
...@@ -35,6 +35,14 @@ ...@@ -35,6 +35,14 @@
96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; }; 96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; };
96442ADF1C28EF3E00C3C574 /* MaterialTableViewCell.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96442ADF1C28EF3E00C3C574 /* MaterialTableViewCell.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626421C874FAE004ADEF7 /* MaterialDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965626411C874FAE004ADEF7 /* MaterialDevice.swift */; }; 965626421C874FAE004ADEF7 /* MaterialDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965626411C874FAE004ADEF7 /* MaterialDevice.swift */; };
965626431C8757B4004ADEF7 /* MaterialSpacing.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC089F1C80CB180034FF84 /* MaterialSpacing.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626441C8757B4004ADEF7 /* MaterialDevice.swift in Headers */ = {isa = PBXBuildFile; fileRef = 965626411C874FAE004ADEF7 /* MaterialDevice.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626451C8757B4004ADEF7 /* MaterialCollectionView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC088B1C7FEC170034FF84 /* MaterialCollectionView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626461C8757B4004ADEF7 /* MaterialCollectionViewCell.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC088C1C7FEC170034FF84 /* MaterialCollectionViewCell.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626471C8757B4004ADEF7 /* MaterialCollectionViewDataSource.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC088D1C7FEC170034FF84 /* MaterialCollectionViewDataSource.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626481C8757B4004ADEF7 /* MaterialCollectionViewDelegate.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC088E1C7FEC170034FF84 /* MaterialCollectionViewDelegate.swift */; settings = {ATTRIBUTES = (Public, ); }; };
965626491C8757B4004ADEF7 /* MaterialCollectionViewLayout.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC088F1C7FEC170034FF84 /* MaterialCollectionViewLayout.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9656264A1C8757B4004ADEF7 /* MaterialDataSourceItem.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96CC08901C7FEC170034FF84 /* MaterialDataSourceItem.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9656CD0C1C6BD33700EBCEF1 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; }; 9656CD0C1C6BD33700EBCEF1 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; };
966F57B81C226D75009185B7 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; }; 966F57B81C226D75009185B7 /* TextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; };
96A71E911C6FBC2200C0C4AE /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; }; 96A71E911C6FBC2200C0C4AE /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; };
...@@ -599,6 +607,14 @@ ...@@ -599,6 +607,14 @@
96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */, 96CC08371C7CCB7C0034FF84 /* SearchBarViewController.swift in Headers */,
96CC08381C7CCB7C0034FF84 /* NavigationBarViewController.swift in Headers */, 96CC08381C7CCB7C0034FF84 /* NavigationBarViewController.swift in Headers */,
96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */, 96CC083E1C7CFF2A0034FF84 /* StatusBarViewController.swift in Headers */,
965626431C8757B4004ADEF7 /* MaterialSpacing.swift in Headers */,
965626441C8757B4004ADEF7 /* MaterialDevice.swift in Headers */,
965626451C8757B4004ADEF7 /* MaterialCollectionView.swift in Headers */,
965626461C8757B4004ADEF7 /* MaterialCollectionViewCell.swift in Headers */,
965626471C8757B4004ADEF7 /* MaterialCollectionViewDataSource.swift in Headers */,
965626481C8757B4004ADEF7 /* MaterialCollectionViewDelegate.swift in Headers */,
965626491C8757B4004ADEF7 /* MaterialCollectionViewLayout.swift in Headers */,
9656264A1C8757B4004ADEF7 /* MaterialDataSourceItem.swift in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
...@@ -491,7 +491,7 @@ public class MaterialButton : UIButton { ...@@ -491,7 +491,7 @@ public class MaterialButton : UIButton {
let d: CGFloat = 2 * f let d: CGFloat = 2 * f
let s: CGFloat = 1.05 let s: CGFloat = 1.05
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
...@@ -534,7 +534,7 @@ public class MaterialButton : UIButton { ...@@ -534,7 +534,7 @@ public class MaterialButton : UIButton {
/// Executes the shrink animation for the pulse effect. /// Executes the shrink animation for the pulse effect.
internal func shrinkAnimation() { internal func shrinkAnimation() {
if pulseScale { if pulseScale {
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
......
...@@ -545,7 +545,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -545,7 +545,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
let d: CGFloat = 2 * f let d: CGFloat = 2 * f
let s: CGFloat = 1.05 let s: CGFloat = 1.05
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
...@@ -588,7 +588,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -588,7 +588,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// Executes the shrink animation for the pulse effect. /// Executes the shrink animation for the pulse effect.
internal func shrinkAnimation() { internal func shrinkAnimation() {
if pulseScale { if pulseScale {
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
......
...@@ -56,4 +56,19 @@ public struct MaterialDevice { ...@@ -56,4 +56,19 @@ public struct MaterialDevice {
public static var landscape: Bool { public static var landscape: Bool {
return UIApplication.sharedApplication().statusBarOrientation.isLandscape return UIApplication.sharedApplication().statusBarOrientation.isLandscape
} }
/// Retrieves the device bounds.
public static var bounds: CGRect {
return UIScreen.mainScreen().bounds
}
/// Retrieves the device width.
public static var width: CGFloat {
return bounds.width
}
/// Retrieves the device height.
public static var height: CGFloat {
return bounds.height
}
} }
\ No newline at end of file
...@@ -116,7 +116,7 @@ public class MaterialPulseView : MaterialView { ...@@ -116,7 +116,7 @@ public class MaterialPulseView : MaterialView {
let d: CGFloat = 2 * f let d: CGFloat = 2 * f
let s: CGFloat = 1.05 let s: CGFloat = 1.05
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
...@@ -159,7 +159,7 @@ public class MaterialPulseView : MaterialView { ...@@ -159,7 +159,7 @@ public class MaterialPulseView : MaterialView {
/// Executes the shrink animation for the pulse effect. /// Executes the shrink animation for the pulse effect.
internal func shrinkAnimation() { internal func shrinkAnimation() {
if pulseScale { if pulseScale {
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
......
...@@ -444,7 +444,7 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -444,7 +444,7 @@ public class MaterialTableViewCell: UITableViewCell {
let d: CGFloat = 2 * f let d: CGFloat = 2 * f
let s: CGFloat = 1.05 let s: CGFloat = 1.05
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
...@@ -487,7 +487,7 @@ public class MaterialTableViewCell: UITableViewCell { ...@@ -487,7 +487,7 @@ public class MaterialTableViewCell: UITableViewCell {
/// Executes the shrink animation for the pulse effect. /// Executes the shrink animation for the pulse effect.
internal func shrinkAnimation() { internal func shrinkAnimation() {
if pulseScale { if pulseScale {
var t: CFTimeInterval = CFTimeInterval(1.5 * width / UIScreen.mainScreen().bounds.width) var t: CFTimeInterval = CFTimeInterval(1.5 * width / MaterialDevice.bounds.width)
if 0.55 < t || 0.25 > t { if 0.55 < t || 0.25 > t {
t = 0.55 t = 0.55
} }
......
...@@ -64,7 +64,7 @@ public class NavigationBarView : StatusBarView { ...@@ -64,7 +64,7 @@ public class NavigationBarView : StatusBarView {
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) { public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, MaterialDevice.bounds.width, 64))
prepareProperties(titleLabel, detailLabel: detailLabel, leftControls: leftControls, rightControls: rightControls) prepareProperties(titleLabel, detailLabel: detailLabel, leftControls: leftControls, rightControls: rightControls)
} }
......
...@@ -82,7 +82,7 @@ public class SearchBarView : StatusBarView { ...@@ -82,7 +82,7 @@ public class SearchBarView : StatusBarView {
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, MaterialDevice.bounds.width, 64))
} }
/** /**
......
...@@ -78,7 +78,7 @@ public class SearchBarViewController: StatusBarViewController { ...@@ -78,7 +78,7 @@ public class SearchBarViewController: StatusBarViewController {
/// Layout subviews. /// Layout subviews.
private func layoutSubviews() { private func layoutSubviews() {
let size: CGSize = UIScreen.mainScreen().bounds.size let size: CGSize = MaterialDevice.bounds.size
let h: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height let h: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height
mainViewController.view.frame = CGRectMake(0, searchBarView.height, size.width, size.height - searchBarView.height - (20 >= h ? 0 : h - 20)) mainViewController.view.frame = CGRectMake(0, searchBarView.height, size.width, size.height - searchBarView.height - (20 >= h ? 0 : h - 20))
} }
......
...@@ -848,7 +848,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer ...@@ -848,7 +848,7 @@ public class SideNavigationViewController: UIViewController, UIGestureRecognizer
private func toggleStatusBar(hide: Bool = false) { private func toggleStatusBar(hide: Bool = false) {
if hideStatusBar { if hideStatusBar {
// General alignment. // General alignment.
if UIApplication.sharedApplication().statusBarOrientation.isLandscape { if .iPhone == MaterialDevice.type && MaterialDevice.landscape {
UIApplication.sharedApplication().statusBarHidden = true UIApplication.sharedApplication().statusBarHidden = true
} else { } else {
UIApplication.sharedApplication().statusBarHidden = opened ? true : hide UIApplication.sharedApplication().statusBarHidden = opened ? true : hide
......
...@@ -47,21 +47,19 @@ public class StatusBarView : ControlView { ...@@ -47,21 +47,19 @@ public class StatusBarView : ControlView {
- Parameter rightControls: An Array of UIControls that go on the right side. - Parameter rightControls: An Array of UIControls that go on the right side.
*/ */
public convenience init?(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) { public convenience init?(leftControls: Array<UIControl>? = nil, rightControls: Array<UIControl>? = nil) {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, MaterialDevice.width, 64))
prepareProperties(leftControls, rightControls: rightControls) prepareProperties(leftControls, rightControls: rightControls)
} }
/// A convenience initializer. /// A convenience initializer.
public convenience init() { public convenience init() {
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 64)) self.init(frame: CGRectMake(0, 0, MaterialDevice.width, 64))
} }
public override func layoutSubviews() { public override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
grid.axis.columns = Int(width / 48) grid.axis.columns = Int(width / 48)
print(UIDevice.currentDevice().userInterfaceIdiom)
// General alignment. // General alignment.
if .iPhone == MaterialDevice.type && MaterialDevice.landscape { if .iPhone == MaterialDevice.type && MaterialDevice.landscape {
grid.contentInset.top = 8 grid.contentInset.top = 8
...@@ -82,11 +80,7 @@ public class StatusBarView : ControlView { ...@@ -82,11 +80,7 @@ public class StatusBarView : ControlView {
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
if UIApplication.sharedApplication().statusBarOrientation.isLandscape { return CGSizeMake(MaterialDevice.width, .iPhone == MaterialDevice.type && MaterialDevice.landscape ? 44 : 64)
return CGSizeMake(UIScreen.mainScreen().bounds.width, 44)
} else {
return CGSizeMake(UIScreen.mainScreen().bounds.width, 64)
}
} }
/** /**
......
...@@ -114,15 +114,21 @@ public class StatusBarViewController: UIViewController { ...@@ -114,15 +114,21 @@ public class StatusBarViewController: UIViewController {
/// Layout subviews. /// Layout subviews.
private func layoutSubviews() { private func layoutSubviews() {
let size: CGSize = UIScreen.mainScreen().bounds.size let size: CGSize = MaterialDevice.bounds.size
let h: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height let h: CGFloat = UIApplication.sharedApplication().statusBarFrame.size.height
print(size)
// mainViewController.view.frame = CGRectMake(0, navigationBarView.height, size.width, size.height - navigationBarView.height - (20 >= h ? 0 : h - 20)) if .iPhone == MaterialDevice.type && MaterialDevice.landscape {
mainViewController.view.frame.origin.y = 44
mainViewController.view.frame.size.height = size.height - (20 >= h ? 44 : h - 64)
} else {
mainViewController.view.frame.origin.y = 64
mainViewController.view.frame.size.height = size.height - (20 >= h ? 64 : h - 84)
}
} }
/// A method that prepares the mainViewController. /// A method that prepares the mainViewController.
private func prepareMainViewController() { private func prepareMainViewController() {
mainViewController.view.autoresizingMask = .FlexibleWidth
prepareViewControllerWithinContainer(mainViewController, container: view) prepareViewControllerWithinContainer(mainViewController, container: view)
} }
......
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