Commit 2709465c by Ramon Vicente

Merge branch 'master' of https://github.com/CosmicMind/Material

# Conflicts:
#	Sources/Assets.xcassets/cm_add_white.imageset/Contents.json
#	Sources/Assets.xcassets/cm_audio_white.imageset/cm_audio_white.png
#	Sources/Assets.xcassets/cm_audio_white.imageset/cm_audio_white_2x.png
#	Sources/Assets.xcassets/cm_audio_white.imageset/cm_audio_white_3x.png
#	Sources/Assets.xcassets/cm_pen_white.imageset/cm_pen_white.png
#	Sources/Assets.xcassets/cm_pen_white.imageset/cm_pen_white_2x.png
#	Sources/Assets.xcassets/cm_pen_white.imageset/cm_pen_white_3x.png
#	Sources/Assets.xcassets/cm_share_white.imageset/Contents.json
#	Sources/Assets.xcassets/cm_star_white.imageset/Contents.json
#	Sources/Assets.xcassets/cm_video_white.imageset/cm_video_white.png
#	Sources/Assets.xcassets/cm_video_white.imageset/cm_video_white_2x.png
#	Sources/Assets.xcassets/cm_video_white.imageset/cm_video_white_3x.png
#	Sources/Assets.xcassets/ic_photo_camera_white.imageset/Contents.json
#	Sources/Assets.xcassets/ic_photo_library_white.imageset/Contents.json
#	Sources/Assets.xcassets/ic_settings_white.imageset/Contents.json
#	Sources/iOS/MaterialIcon.swift
parents f0540f54 356e4fab
...@@ -50,7 +50,10 @@ ...@@ -50,7 +50,10 @@
location = "group:Programmatic/MenuViewController/MenuViewController.xcodeproj"> location = "group:Programmatic/MenuViewController/MenuViewController.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:/Users/danieldahan/Dropbox/CosmicMind/Technology/Repositories/Material/Examples/Programmatic/NavigationBar/NavigationBar.xcodeproj"> location = "group:Programmatic/TabBar/TabBar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/NavigationBar/NavigationBar.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:Programmatic/Toolbar/Toolbar.xcodeproj"> location = "group:Programmatic/Toolbar/Toolbar.xcodeproj">
......
...@@ -51,7 +51,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -51,7 +51,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let sideNavigationController: SideNavigationController = SideNavigationController(rootViewController: bottomNavigationController, leftViewController: AppLeftViewController()) let sideNavigationController: SideNavigationController = SideNavigationController(rootViewController: bottomNavigationController, leftViewController: AppLeftViewController())
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = sideNavigationController window!.rootViewController = sideNavigationController
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -110,7 +110,7 @@ class AppMenuViewController: MenuViewController { ...@@ -110,7 +110,7 @@ class AppMenuViewController: MenuViewController {
/// Prepares the add button. /// Prepares the add button.
private func prepareMenuView() { private func prepareMenuView() {
var image: UIImage? = MaterialIcon.add var image: UIImage? = MaterialIcon.cm.add
let menuButton: FabButton = FabButton() let menuButton: FabButton = FabButton()
menuButton.tintColor = MaterialColor.white menuButton.tintColor = MaterialColor.white
menuButton.setImage(image, forState: .Normal) menuButton.setImage(image, forState: .Normal)
...@@ -118,7 +118,7 @@ class AppMenuViewController: MenuViewController { ...@@ -118,7 +118,7 @@ class AppMenuViewController: MenuViewController {
menuButton.addTarget(self, action: #selector(handleMenu), forControlEvents: .TouchUpInside) menuButton.addTarget(self, action: #selector(handleMenu), forControlEvents: .TouchUpInside)
menuView.addSubview(menuButton) menuView.addSubview(menuButton)
image = MaterialIcon.pen image = MaterialIcon.cm.pen
let blueButton: FabButton = FabButton() let blueButton: FabButton = FabButton()
blueButton.tintColor = MaterialColor.white blueButton.tintColor = MaterialColor.white
blueButton.backgroundColor = MaterialColor.blue.base blueButton.backgroundColor = MaterialColor.blue.base
...@@ -127,7 +127,7 @@ class AppMenuViewController: MenuViewController { ...@@ -127,7 +127,7 @@ class AppMenuViewController: MenuViewController {
menuView.addSubview(blueButton) menuView.addSubview(blueButton)
blueButton.addTarget(self, action: #selector(handleBlueButton), forControlEvents: .TouchUpInside) blueButton.addTarget(self, action: #selector(handleBlueButton), forControlEvents: .TouchUpInside)
image = MaterialIcon.photoCamera image = MaterialIcon.cm.photoCamera
let greenButton: FabButton = FabButton() let greenButton: FabButton = FabButton()
greenButton.tintColor = MaterialColor.white greenButton.tintColor = MaterialColor.white
greenButton.backgroundColor = MaterialColor.green.base greenButton.backgroundColor = MaterialColor.green.base
...@@ -136,7 +136,7 @@ class AppMenuViewController: MenuViewController { ...@@ -136,7 +136,7 @@ class AppMenuViewController: MenuViewController {
menuView.addSubview(greenButton) menuView.addSubview(greenButton)
greenButton.addTarget(self, action: #selector(handleGreenButton), forControlEvents: .TouchUpInside) greenButton.addTarget(self, action: #selector(handleGreenButton), forControlEvents: .TouchUpInside)
image = MaterialIcon.star image = MaterialIcon.cm.star
let yellowButton: FabButton = FabButton() let yellowButton: FabButton = FabButton()
yellowButton.tintColor = MaterialColor.white yellowButton.tintColor = MaterialColor.white
yellowButton.backgroundColor = MaterialColor.yellow.base yellowButton.backgroundColor = MaterialColor.yellow.base
...@@ -157,7 +157,7 @@ class AppMenuViewController: MenuViewController { ...@@ -157,7 +157,7 @@ class AppMenuViewController: MenuViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = MaterialIcon.photoLibrary tabBarItem.image = MaterialIcon.cm.photoLibrary
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected)
} }
......
...@@ -74,42 +74,27 @@ class AppSearchBarController: SearchBarController { ...@@ -74,42 +74,27 @@ class AppSearchBarController: SearchBarController {
/// Prepares the searchBar. /// Prepares the searchBar.
private func prepareSearchBar() { private func prepareSearchBar() {
var image: UIImage? = MaterialIcon.close var image: UIImage? = MaterialIcon.cm.arrowBack
let clearButton: FlatButton = FlatButton()
clearButton.pulseScale = false
clearButton.pulseColor = MaterialColor.grey.darken4
clearButton.tintColor = MaterialColor.grey.darken4
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
// Back button. // Back button.
image = MaterialIcon.arrowBack
let backButton: FlatButton = FlatButton() let backButton: FlatButton = FlatButton()
backButton.pulseScale = false backButton.pulseScale = false
backButton.pulseColor = MaterialColor.grey.darken4 backButton.pulseColor = MaterialColor.grey.base
backButton.tintColor = MaterialColor.grey.darken4 backButton.tintColor = MaterialColor.grey.darken4
backButton.setImage(image, forState: .Normal) backButton.setImage(image, forState: .Normal)
backButton.setImage(image, forState: .Highlighted) backButton.setImage(image, forState: .Highlighted)
backButton.addTarget(self, action: #selector(handleBackButton), forControlEvents: .TouchUpInside) backButton.addTarget(self, action: #selector(handleBackButton), forControlEvents: .TouchUpInside)
// More button. // More button.
image = MaterialIcon.moreHorizontal image = MaterialIcon.cm.moreHorizontal
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.pulseScale = false moreButton.pulseScale = false
moreButton.pulseColor = MaterialColor.grey.darken4 moreButton.pulseColor = MaterialColor.grey.base
moreButton.tintColor = MaterialColor.grey.darken4 moreButton.tintColor = MaterialColor.grey.darken4
moreButton.setImage(image, forState: .Normal) moreButton.setImage(image, forState: .Normal)
moreButton.setImage(image, forState: .Highlighted) moreButton.setImage(image, forState: .Highlighted)
searchBar.placeholder = "Search"
searchBar.tintColor = MaterialColor.grey.darken4
searchBar.textColor = MaterialColor.grey.darken4
searchBar.placeholderTextColor = MaterialColor.grey.darken4
searchBar.textField.font = RobotoFont.regular
searchBar.textField.delegate = self searchBar.textField.delegate = self
searchBar.clearButton = clearButton
searchBar.leftControls = [backButton] searchBar.leftControls = [backButton]
searchBar.rightControls = [moreButton] searchBar.rightControls = [moreButton]
} }
......
...@@ -68,7 +68,7 @@ class ItemViewController: UIViewController { ...@@ -68,7 +68,7 @@ class ItemViewController: UIViewController {
prepareView() prepareView()
prepareTitleLabel() prepareTitleLabel()
prepareShareButton() prepareShareButton()
prepareNavigationBar() prepareNavigationItem()
prepareScrollView() prepareScrollView()
prepareImageCardView() prepareImageCardView()
} }
...@@ -114,7 +114,7 @@ class ItemViewController: UIViewController { ...@@ -114,7 +114,7 @@ class ItemViewController: UIViewController {
/// Prepares the shareButton. /// Prepares the shareButton.
private func prepareShareButton() { private func prepareShareButton() {
let image: UIImage? = MaterialIcon.share let image: UIImage? = MaterialIcon.cm.share
shareButton = FlatButton() shareButton = FlatButton()
shareButton.pulseScale = false shareButton.pulseScale = false
shareButton.pulseColor = MaterialColor.white shareButton.pulseColor = MaterialColor.white
...@@ -123,7 +123,7 @@ class ItemViewController: UIViewController { ...@@ -123,7 +123,7 @@ class ItemViewController: UIViewController {
} }
/// Prepares the navigationItem. /// Prepares the navigationItem.
private func prepareNavigationBar() { private func prepareNavigationItem() {
navigationItem.titleLabel = titleLabel navigationItem.titleLabel = titleLabel
navigationItem.detailLabel = detailLabel navigationItem.detailLabel = detailLabel
navigationItem.rightControls = [shareButton] navigationItem.rightControls = [shareButton]
......
...@@ -57,7 +57,7 @@ class PhotoViewController: UIViewController { ...@@ -57,7 +57,7 @@ class PhotoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = MaterialIcon.photoCamera tabBarItem.image = MaterialIcon.cm.photoCamera
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected)
} }
......
...@@ -58,7 +58,7 @@ class RecipesViewController: UIViewController { ...@@ -58,7 +58,7 @@ class RecipesViewController: UIViewController {
prepareMenuButton() prepareMenuButton()
prepareSwitchControl() prepareSwitchControl()
prepareSearchButton() prepareSearchButton()
prepareNavigationBar() prepareNavigationItem()
prepareTableView() prepareTableView()
} }
...@@ -229,7 +229,7 @@ class RecipesViewController: UIViewController { ...@@ -229,7 +229,7 @@ class RecipesViewController: UIViewController {
/// Prepares the menuButton. /// Prepares the menuButton.
private func prepareMenuButton() { private func prepareMenuButton() {
let image: UIImage? = MaterialIcon.menu let image: UIImage? = MaterialIcon.cm.menu
menuButton = FlatButton() menuButton = FlatButton()
menuButton.pulseScale = false menuButton.pulseScale = false
menuButton.pulseColor = MaterialColor.white menuButton.pulseColor = MaterialColor.white
...@@ -245,7 +245,7 @@ class RecipesViewController: UIViewController { ...@@ -245,7 +245,7 @@ class RecipesViewController: UIViewController {
/// Prepares the searchButton. /// Prepares the searchButton.
private func prepareSearchButton() { private func prepareSearchButton() {
let image: UIImage? = MaterialIcon.search let image: UIImage? = MaterialIcon.cm.search
searchButton = FlatButton() searchButton = FlatButton()
searchButton.pulseScale = false searchButton.pulseScale = false
searchButton.pulseColor = MaterialColor.white searchButton.pulseColor = MaterialColor.white
...@@ -255,7 +255,7 @@ class RecipesViewController: UIViewController { ...@@ -255,7 +255,7 @@ class RecipesViewController: UIViewController {
} }
/// Prepares the navigationItem. /// Prepares the navigationItem.
private func prepareNavigationBar() { private func prepareNavigationItem() {
navigationItem.titleLabel = titleLabel navigationItem.titleLabel = titleLabel
navigationItem.leftControls = [menuButton] navigationItem.leftControls = [menuButton]
navigationItem.rightControls = [switchControl, searchButton] navigationItem.rightControls = [switchControl, searchButton]
......
...@@ -57,7 +57,7 @@ class VideoViewController: UIViewController { ...@@ -57,7 +57,7 @@ class VideoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.image = MaterialIcon.videocam tabBarItem.image = MaterialIcon.cm.videocam
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.white, forState: .Selected)
} }
......
...@@ -43,7 +43,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat ...@@ -43,7 +43,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat
bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4 bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = bottomNavigationController window!.rootViewController = bottomNavigationController
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -58,7 +58,7 @@ class LibraryViewController: UIViewController { ...@@ -58,7 +58,7 @@ class LibraryViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = "Library" tabBarItem.title = "Library"
tabBarItem.image = MaterialIcon.photoLibrary tabBarItem.image = MaterialIcon.cm.photoLibrary
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
} }
......
...@@ -58,7 +58,7 @@ class PhotoViewController: UIViewController { ...@@ -58,7 +58,7 @@ class PhotoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = "Photo" tabBarItem.title = "Photo"
tabBarItem.image = MaterialIcon.photoCamera tabBarItem.image = MaterialIcon.cm.photoCamera
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
} }
......
...@@ -58,7 +58,7 @@ class VideoViewController: UIViewController { ...@@ -58,7 +58,7 @@ class VideoViewController: UIViewController {
/// Prepare tabBarItem. /// Prepare tabBarItem.
private func prepareTabBarItem() { private func prepareTabBarItem() {
tabBarItem.title = "Video" tabBarItem.title = "Video"
tabBarItem.image = MaterialIcon.videocam tabBarItem.image = MaterialIcon.cm.videocam
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
} }
......
...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -53,15 +53,15 @@ class ViewController: UIViewController { ...@@ -53,15 +53,15 @@ class ViewController: UIViewController {
bottomTabBar.backgroundColor = MaterialColor.grey.darken4 bottomTabBar.backgroundColor = MaterialColor.grey.darken4
view.addSubview(bottomTabBar) view.addSubview(bottomTabBar)
let videoItem: UITabBarItem = UITabBarItem(title: "Video", image: MaterialIcon.videocam, selectedImage: nil) let videoItem: UITabBarItem = UITabBarItem(title: "Video", image: MaterialIcon.cm.videocam, selectedImage: nil)
videoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) videoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
videoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) videoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
let photoItem: UITabBarItem = UITabBarItem(title: "Photo", image: MaterialIcon.photoCamera, selectedImage: nil) let photoItem: UITabBarItem = UITabBarItem(title: "Photo", image: MaterialIcon.cm.photoCamera, selectedImage: nil)
photoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) photoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
photoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) photoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
let libraryItem: UITabBarItem = UITabBarItem(title: "Library", image: MaterialIcon.photoLibrary, selectedImage: nil) let libraryItem: UITabBarItem = UITabBarItem(title: "Library", image: MaterialIcon.cm.photoLibrary, selectedImage: nil)
libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -202,7 +202,7 @@ class ViewController: UIViewController { ...@@ -202,7 +202,7 @@ class ViewController: UIViewController {
titleLabel.backgroundColor = MaterialColor.clear titleLabel.backgroundColor = MaterialColor.clear
contentView.addSubview(titleLabel) contentView.addSubview(titleLabel)
image = MaterialIcon.moreVertical image = MaterialIcon.cm.moreVertical
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.contentEdgeInsetsPreset = .None moreButton.contentEdgeInsetsPreset = .None
moreButton.pulseColor = MaterialColor.blueGrey.darken4 moreButton.pulseColor = MaterialColor.blueGrey.darken4
...@@ -299,7 +299,7 @@ class ViewController: UIViewController { ...@@ -299,7 +299,7 @@ class ViewController: UIViewController {
titleLabel.backgroundColor = MaterialColor.clear titleLabel.backgroundColor = MaterialColor.clear
contentView.addSubview(titleLabel) contentView.addSubview(titleLabel)
image = MaterialIcon.moreVertical image = MaterialIcon.cm.moreVertical
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.contentEdgeInsetsPreset = .None moreButton.contentEdgeInsetsPreset = .None
moreButton.pulseColor = MaterialColor.blueGrey.darken4 moreButton.pulseColor = MaterialColor.blueGrey.darken4
...@@ -408,7 +408,7 @@ class ViewController: UIViewController { ...@@ -408,7 +408,7 @@ class ViewController: UIViewController {
titleLabel.backgroundColor = MaterialColor.clear titleLabel.backgroundColor = MaterialColor.clear
contentView.addSubview(titleLabel) contentView.addSubview(titleLabel)
image = MaterialIcon.moreHorizontal image = MaterialIcon.cm.moreHorizontal
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.contentEdgeInsetsPreset = .None moreButton.contentEdgeInsetsPreset = .None
moreButton.pulseColor = MaterialColor.blueGrey.darken4 moreButton.pulseColor = MaterialColor.blueGrey.darken4
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -80,12 +80,12 @@ class ViewController: UIViewController { ...@@ -80,12 +80,12 @@ class ViewController: UIViewController {
if fabMenu.opened { if fabMenu.opened {
fabMenu.close() fabMenu.close()
image = MaterialIcon.add image = MaterialIcon.cm.add
} else { } else {
fabMenu.open() { (v: UIView) in fabMenu.open() { (v: UIView) in
(v as? MaterialButton)?.pulse() (v as? MaterialButton)?.pulse()
} }
image = MaterialIcon.close image = MaterialIcon.cm.close
} }
// Add a nice rotation animation to the base button. // Add a nice rotation animation to the base button.
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = AppMenuViewController(rootViewController: YellowViewController()) window!.rootViewController = AppMenuViewController(rootViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -89,7 +89,7 @@ class ViewController: UIViewController { ...@@ -89,7 +89,7 @@ class ViewController: UIViewController {
/// Prepares the menuButton. /// Prepares the menuButton.
private func prepareMenuButton() { private func prepareMenuButton() {
let image: UIImage? = MaterialIcon.menu let image: UIImage? = MaterialIcon.cm.menu
menuButton = FlatButton() menuButton = FlatButton()
menuButton.pulseScale = false menuButton.pulseScale = false
menuButton.pulseColor = MaterialColor.white menuButton.pulseColor = MaterialColor.white
...@@ -104,7 +104,7 @@ class ViewController: UIViewController { ...@@ -104,7 +104,7 @@ class ViewController: UIViewController {
/// Prepares the searchButton. /// Prepares the searchButton.
private func prepareSearchButton() { private func prepareSearchButton() {
let image: UIImage? = MaterialIcon.search let image: UIImage? = MaterialIcon.cm.search
searchButton = FlatButton() searchButton = FlatButton()
searchButton.pulseScale = false searchButton.pulseScale = false
searchButton.pulseColor = MaterialColor.white searchButton.pulseColor = MaterialColor.white
......
...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -54,21 +54,13 @@ class ViewController: UIViewController { ...@@ -54,21 +54,13 @@ class ViewController: UIViewController {
/// Prepare toolbar. /// Prepare toolbar.
private func prepareSearchBar() { private func prepareSearchBar() {
var image: UIImage? = MaterialIcon.close var image: UIImage? = MaterialIcon.cm.arrowBack
let clearButton: FlatButton = FlatButton()
clearButton.pulseScale = false
clearButton.pulseColor = MaterialColor.blueGrey.darken4
clearButton.tintColor = MaterialColor.blueGrey.darken4
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
// Back button. // Back button.
image = MaterialIcon.arrowBack
let backButton: FlatButton = FlatButton() let backButton: FlatButton = FlatButton()
backButton.pulseScale = false backButton.pulseScale = false
backButton.pulseColor = MaterialColor.blueGrey.darken4 backButton.pulseColor = MaterialColor.grey.base
backButton.tintColor = MaterialColor.blueGrey.darken4 backButton.tintColor = MaterialColor.grey.darken4
backButton.setImage(image, forState: .Normal) backButton.setImage(image, forState: .Normal)
backButton.setImage(image, forState: .Highlighted) backButton.setImage(image, forState: .Highlighted)
...@@ -76,11 +68,11 @@ class ViewController: UIViewController { ...@@ -76,11 +68,11 @@ class ViewController: UIViewController {
let switchControl: MaterialSwitch = MaterialSwitch(state: .Off, style: .Default, size: .Small) let switchControl: MaterialSwitch = MaterialSwitch(state: .Off, style: .Default, size: .Small)
// More button. // More button.
image = MaterialIcon.moreHorizontal image = MaterialIcon.cm.moreHorizontal
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.pulseScale = false moreButton.pulseScale = false
moreButton.pulseColor = MaterialColor.blueGrey.darken4 moreButton.pulseColor = MaterialColor.grey.base
moreButton.tintColor = MaterialColor.blueGrey.darken4 moreButton.tintColor = MaterialColor.grey.darken4
moreButton.setImage(image, forState: .Normal) moreButton.setImage(image, forState: .Normal)
moreButton.setImage(image, forState: .Highlighted) moreButton.setImage(image, forState: .Highlighted)
...@@ -90,14 +82,6 @@ class ViewController: UIViewController { ...@@ -90,14 +82,6 @@ class ViewController: UIViewController {
to your info.plist file and set the following property. to your info.plist file and set the following property.
*/ */
searchBar.statusBarStyle = .Default searchBar.statusBarStyle = .Default
searchBar.placeholder = "Search"
searchBar.tintColor = MaterialColor.blueGrey.darken4
searchBar.textColor = MaterialColor.blueGrey.darken4
searchBar.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBar.textField.font = RobotoFont.regular
searchBar.clearButton = clearButton
searchBar.leftControls = [backButton] searchBar.leftControls = [backButton]
searchBar.rightControls = [switchControl, moreButton] searchBar.rightControls = [switchControl, moreButton]
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = AppSearchBarController(rootViewController: YellowViewController()) window!.rootViewController = AppSearchBarController(rootViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -76,18 +76,9 @@ class AppSearchBarController: SearchBarController { ...@@ -76,18 +76,9 @@ class AppSearchBarController: SearchBarController {
/// Prepares the searchBar. /// Prepares the searchBar.
private func prepareSearchBar() { private func prepareSearchBar() {
var image: UIImage? = MaterialIcon.close var image: UIImage? = MaterialIcon.cm.arrowBack
let clearButton: FlatButton = FlatButton()
clearButton.pulseColor = nil
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.blueGrey.darken4
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
clearButton.addTarget(self, action: #selector(handleYellowButton), forControlEvents: .TouchUpInside)
// Back button. // Back button.
image = MaterialIcon.arrowBack
let backButton: FlatButton = FlatButton() let backButton: FlatButton = FlatButton()
backButton.pulseColor = nil backButton.pulseColor = nil
backButton.pulseScale = false backButton.pulseScale = false
...@@ -97,7 +88,7 @@ class AppSearchBarController: SearchBarController { ...@@ -97,7 +88,7 @@ class AppSearchBarController: SearchBarController {
backButton.addTarget(self, action: #selector(handleBlueButton), forControlEvents: .TouchUpInside) backButton.addTarget(self, action: #selector(handleBlueButton), forControlEvents: .TouchUpInside)
// More button. // More button.
image = MaterialIcon.moreHorizontal image = MaterialIcon.cm.moreHorizontal
let moreButton: FlatButton = FlatButton() let moreButton: FlatButton = FlatButton()
moreButton.pulseColor = nil moreButton.pulseColor = nil
moreButton.pulseScale = false moreButton.pulseScale = false
...@@ -112,15 +103,7 @@ class AppSearchBarController: SearchBarController { ...@@ -112,15 +103,7 @@ class AppSearchBarController: SearchBarController {
to your info.plist file and set the following property. to your info.plist file and set the following property.
*/ */
searchBar.statusBarStyle = .Default searchBar.statusBarStyle = .Default
searchBar.placeholder = "Search"
searchBar.tintColor = MaterialColor.blueGrey.darken4
searchBar.textColor = MaterialColor.blueGrey.darken4
searchBar.placeholderTextColor = MaterialColor.blueGrey.darken4
searchBar.textField.font = RobotoFont.regular
searchBar.textField.delegate = self searchBar.textField.delegate = self
searchBar.clearButton = clearButton
searchBar.leftControls = [backButton] searchBar.leftControls = [backButton]
searchBar.rightControls = [moreButton] searchBar.rightControls = [moreButton]
} }
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = SideNavigationController(rootViewController: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController()) window!.rootViewController = SideNavigationController(rootViewController: YellowViewController(), leftViewController: GreenViewController(), rightViewController: BlueViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
96E01FC01CB0441800411B61 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E01FBF1CB0441800411B61 /* AppDelegate.swift */; };
96E01FC21CB0441800411B61 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E01FC11CB0441800411B61 /* ViewController.swift */; };
96E01FC71CB0441800411B61 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96E01FC61CB0441800411B61 /* Assets.xcassets */; };
96E01FCA1CB0441800411B61 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96E01FC81CB0441800411B61 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
96E01FD41CB0448F00411B61 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96E01FBC1CB0441800411B61 /* TabBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TabBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96E01FBF1CB0441800411B61 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96E01FC11CB0441800411B61 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96E01FC61CB0441800411B61 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96E01FC91CB0441800411B61 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96E01FCB1CB0441800411B61 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
96E01FB91CB0441800411B61 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
96E01FB31CB0441800411B61 = {
isa = PBXGroup;
children = (
96E01FBE1CB0441800411B61 /* TabBar */,
96E01FBD1CB0441800411B61 /* Products */,
);
sourceTree = "<group>";
};
96E01FBD1CB0441800411B61 /* Products */ = {
isa = PBXGroup;
children = (
96E01FBC1CB0441800411B61 /* TabBar.app */,
);
name = Products;
sourceTree = "<group>";
};
96E01FBE1CB0441800411B61 /* TabBar */ = {
isa = PBXGroup;
children = (
96E01FBF1CB0441800411B61 /* AppDelegate.swift */,
96E01FC11CB0441800411B61 /* ViewController.swift */,
96E01FC61CB0441800411B61 /* Assets.xcassets */,
96E01FC81CB0441800411B61 /* LaunchScreen.storyboard */,
96E01FCB1CB0441800411B61 /* Info.plist */,
);
path = TabBar;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96E01FBB1CB0441800411B61 /* TabBar */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96E01FCE1CB0441800411B61 /* Build configuration list for PBXNativeTarget "TabBar" */;
buildPhases = (
96E01FB81CB0441800411B61 /* Sources */,
96E01FB91CB0441800411B61 /* Frameworks */,
96E01FBA1CB0441800411B61 /* Resources */,
96E01FD41CB0448F00411B61 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = TabBar;
productName = TabBar;
productReference = 96E01FBC1CB0441800411B61 /* TabBar.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
96E01FB41CB0441800411B61 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
96E01FBB1CB0441800411B61 = {
CreatedOnToolsVersion = 7.3;
};
};
};
buildConfigurationList = 96E01FB71CB0441800411B61 /* Build configuration list for PBXProject "TabBar" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 96E01FB31CB0441800411B61;
productRefGroup = 96E01FBD1CB0441800411B61 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
96E01FBB1CB0441800411B61 /* TabBar */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
96E01FBA1CB0441800411B61 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96E01FCA1CB0441800411B61 /* LaunchScreen.storyboard in Resources */,
96E01FC71CB0441800411B61 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
96E01FB81CB0441800411B61 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96E01FC21CB0441800411B61 /* ViewController.swift in Sources */,
96E01FC01CB0441800411B61 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96E01FC81CB0441800411B61 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96E01FC91CB0441800411B61 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
96E01FCC1CB0441800411B61 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
96E01FCD1CB0441800411B61 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
96E01FCF1CB0441800411B61 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TabBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
96E01FD01CB0441800411B61 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TabBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96E01FB71CB0441800411B61 /* Build configuration list for PBXProject "TabBar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96E01FCC1CB0441800411B61 /* Debug */,
96E01FCD1CB0441800411B61 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96E01FCE1CB0441800411B61 /* Build configuration list for PBXNativeTarget "TabBar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96E01FCF1CB0441800411B61 /* Debug */,
96E01FD01CB0441800411B61 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 96E01FB41CB0441800411B61 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:TabBar.xcodeproj">
</FileRef>
</Workspace>
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
import Material
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
window!.makeKeyAndVisible()
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Material-Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Material-Icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Material-Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Material-Icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Material-Icon-83.5@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
import Material
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
let tabBar: TabBar = TabBar(frame: CGRectMake(0, 100, view.bounds.width, 44))
tabBar.backgroundColor = MaterialColor.blue.base
view.addSubview(tabBar)
let btn1: FlatButton = FlatButton()
btn1.pulseColor = MaterialColor.white
btn1.pulseScale = false
btn1.setTitle("ONE", forState: .Normal)
btn1.setTitleColor(MaterialColor.white, forState: .Normal)
let btn2: FlatButton = FlatButton()
btn2.pulseColor = MaterialColor.white
btn2.pulseScale = false
btn2.setTitle("TWO", forState: .Normal)
btn2.setTitleColor(MaterialColor.white, forState: .Normal)
let btn3: FlatButton = FlatButton()
btn3.pulseColor = MaterialColor.white
btn3.pulseScale = false
btn3.setTitle("THREE", forState: .Normal)
btn3.setTitleColor(MaterialColor.white, forState: .Normal)
let btn4: FlatButton = FlatButton()
btn4.pulseColor = MaterialColor.white
btn4.pulseScale = false
btn4.setTitle("FOUR", forState: .Normal)
btn4.setTitleColor(MaterialColor.white, forState: .Normal)
tabBar.buttons = [btn1, btn2, btn3, btn4]
}
/// Prepares view.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
}
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
966F57B51C226CA3009185B7 /* Embed Frameworks */ = { 966015DB1CB2B0BA00AAB661 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase; isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
dstPath = ""; dstPath = "";
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
966F57991C226BAA009185B7 /* Sources */, 966F57991C226BAA009185B7 /* Sources */,
966F579A1C226BAA009185B7 /* Frameworks */, 966F579A1C226BAA009185B7 /* Frameworks */,
966F579B1C226BAA009185B7 /* Resources */, 966F579B1C226BAA009185B7 /* Resources */,
966F57B51C226CA3009185B7 /* Embed Frameworks */, 966015DB1CB2B0BA00AAB661 /* Embed Frameworks */,
); );
buildRules = ( buildRules = (
); );
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -53,44 +53,20 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -53,44 +53,20 @@ class ViewController: UIViewController, TextFieldDelegate {
/// Prepares the name TextField. /// Prepares the name TextField.
private func prepareNameField() { private func prepareNameField() {
let textField: TextField = TextField(frame: CGRectMake(57, 100, 300, 24)) let w: CGFloat = 300
let x: CGFloat = (MaterialDevice.width - w) / 2
let textField: TextField = TextField(frame: CGRectMake(x, 100, w, 24))
textField.placeholder = "First Name" textField.placeholder = "First Name"
textField.placeholderTextColor = MaterialColor.grey.base
textField.font = RobotoFont.regularWithSize(20)
textField.textColor = MaterialColor.black
textField.titleLabel = UILabel()
textField.titleLabel!.font = RobotoFont.mediumWithSize(12)
textField.titleLabelColor = MaterialColor.grey.base
textField.titleLabelActiveColor = MaterialColor.blue.accent3
let image: UIImage? = MaterialIcon.close
let clearButton: FlatButton = FlatButton()
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
textField.clearButton = clearButton
view.addSubview(textField) view.addSubview(textField)
} }
/// Prepares the email TextField. /// Prepares the email TextField.
private func prepareEmailField() { private func prepareEmailField() {
let textField: TextField = TextField(frame: CGRectMake(57, 200, 300, 24)) let w: CGFloat = 300
let x: CGFloat = (MaterialDevice.width - w) / 2
let textField: TextField = TextField(frame: CGRectMake(x, 200, w, 24))
textField.delegate = self textField.delegate = self
textField.placeholder = "Email" textField.placeholder = "Email"
textField.placeholderTextColor = MaterialColor.grey.base
textField.font = RobotoFont.regularWithSize(20)
textField.textColor = MaterialColor.black
textField.titleLabel = UILabel()
textField.titleLabel!.font = RobotoFont.mediumWithSize(12)
textField.titleLabelColor = MaterialColor.grey.base
textField.titleLabelActiveColor = MaterialColor.blue.accent3
/* /*
Used to display the error message, which is displayed when Used to display the error message, which is displayed when
...@@ -98,21 +74,10 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -98,21 +74,10 @@ class ViewController: UIViewController, TextFieldDelegate {
*/ */
textField.detailLabel = UILabel() textField.detailLabel = UILabel()
textField.detailLabel!.text = "Email is incorrect." textField.detailLabel!.text = "Email is incorrect."
textField.detailLabel!.font = RobotoFont.mediumWithSize(12) textField.detailLabel!.font = RobotoFont.regularWithSize(12)
textField.detailLabelActiveColor = MaterialColor.red.accent3 textField.detailLabelActiveColor = MaterialColor.red.accent3
// textField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding. // textField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding.
let image: UIImage? = MaterialIcon.close
let clearButton: FlatButton = FlatButton()
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
textField.clearButton = clearButton
view.addSubview(textField) view.addSubview(textField)
} }
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ 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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -36,7 +36,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController() window!.rootViewController = ViewController()
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -68,7 +68,7 @@ class ViewController: UIViewController { ...@@ -68,7 +68,7 @@ class ViewController: UIViewController {
detailLabel.textColor = MaterialColor.white detailLabel.textColor = MaterialColor.white
detailLabel.font = RobotoFont.regular detailLabel.font = RobotoFont.regular
var image: UIImage? = MaterialIcon.menu var image: UIImage? = MaterialIcon.cm.menu
// Menu button. // Menu button.
let menuButton: FlatButton = FlatButton() let menuButton: FlatButton = FlatButton()
...@@ -82,7 +82,7 @@ class ViewController: UIViewController { ...@@ -82,7 +82,7 @@ class ViewController: UIViewController {
let switchControl: MaterialSwitch = MaterialSwitch(state: .Off, style: .LightContent, size: .Small) let switchControl: MaterialSwitch = MaterialSwitch(state: .Off, style: .LightContent, size: .Small)
// Search button. // Search button.
image = MaterialIcon.search image = MaterialIcon.cm.search
let searchButton: FlatButton = FlatButton() let searchButton: FlatButton = FlatButton()
searchButton.pulseScale = false searchButton.pulseScale = false
searchButton.pulseColor = MaterialColor.white searchButton.pulseColor = MaterialColor.white
......
...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -37,7 +37,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
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.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = AppToolbarController(rootViewController: YellowViewController()) window!.rootViewController = AppToolbarController(rootViewController: YellowViewController())
window!.makeKeyAndVisible() window!.makeKeyAndVisible()
......
...@@ -91,7 +91,7 @@ class AppToolbarController: ToolbarController { ...@@ -91,7 +91,7 @@ class AppToolbarController: ToolbarController {
// detailLabel.font = RobotoFont.regular // detailLabel.font = RobotoFont.regular
// toolbar.detailLabel = detailLabel // toolbar.detailLabel = detailLabel
var image: UIImage? = MaterialIcon.menu var image: UIImage? = MaterialIcon.cm.menu
// Menu button. // Menu button.
let menuButton: FlatButton = FlatButton() let menuButton: FlatButton = FlatButton()
...@@ -107,7 +107,7 @@ class AppToolbarController: ToolbarController { ...@@ -107,7 +107,7 @@ class AppToolbarController: ToolbarController {
switchControl.delegate = self switchControl.delegate = self
// Search button. // Search button.
image = MaterialIcon.search image = MaterialIcon.cm.search
let searchButton: FlatButton = FlatButton() let searchButton: FlatButton = FlatButton()
searchButton.pulseColor = nil searchButton.pulseColor = nil
searchButton.pulseScale = false searchButton.pulseScale = false
......
...@@ -37,15 +37,15 @@ class ViewController: UIViewController { ...@@ -37,15 +37,15 @@ class ViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
let videoItem: UITabBarItem = UITabBarItem(title: "Video", image: MaterialIcon.videocam, selectedImage: nil) let videoItem: UITabBarItem = UITabBarItem(title: "Video", image: MaterialIcon.cm.videocam, selectedImage: nil)
videoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) videoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
videoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) videoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
let photoItem: UITabBarItem = UITabBarItem(title: "Photo", image: MaterialIcon.photoCamera, selectedImage: nil) let photoItem: UITabBarItem = UITabBarItem(title: "Photo", image: MaterialIcon.cm.photoCamera, selectedImage: nil)
photoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) photoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
photoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) photoItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
let libraryItem: UITabBarItem = UITabBarItem(title: "Library", image: MaterialIcon.photoLibrary, selectedImage: nil) let libraryItem: UITabBarItem = UITabBarItem(title: "Library", image: MaterialIcon.cm.photoLibrary, selectedImage: nil)
libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
......
...@@ -57,41 +57,12 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -57,41 +57,12 @@ class ViewController: UIViewController, TextFieldDelegate {
/// Prepares the name TextField. /// Prepares the name TextField.
private func prepareNameField() { private func prepareNameField() {
nameField.placeholder = "First Name" nameField.placeholder = "First Name"
nameField.placeholderTextColor = MaterialColor.grey.base
nameField.font = RobotoFont.regularWithSize(20)
nameField.textColor = MaterialColor.black
nameField.borderStyle = .None
nameField.titleLabel = UILabel()
nameField.titleLabel!.font = RobotoFont.mediumWithSize(12)
nameField.titleLabelColor = MaterialColor.grey.base
nameField.titleLabelActiveColor = MaterialColor.blue.accent3
let image: UIImage? = MaterialIcon.close
let clearButton: FlatButton = FlatButton()
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
nameField.clearButton = clearButton
} }
/// Prepares the email TextField. /// Prepares the email TextField.
private func prepareEmailField() { private func prepareEmailField() {
emailField.delegate = self emailField.delegate = self
emailField.placeholder = "Email" emailField.placeholder = "Email"
emailField.placeholderTextColor = MaterialColor.grey.base
emailField.font = RobotoFont.regularWithSize(20)
emailField.textColor = MaterialColor.black
emailField.borderStyle = .None
emailField.titleLabel = UILabel()
emailField.titleLabel!.font = RobotoFont.mediumWithSize(12)
emailField.titleLabelColor = MaterialColor.grey.base
emailField.titleLabelActiveColor = MaterialColor.blue.accent3
/* /*
Used to display the error message, which is displayed when Used to display the error message, which is displayed when
...@@ -99,20 +70,9 @@ class ViewController: UIViewController, TextFieldDelegate { ...@@ -99,20 +70,9 @@ class ViewController: UIViewController, TextFieldDelegate {
*/ */
emailField.detailLabel = UILabel() emailField.detailLabel = UILabel()
emailField.detailLabel!.text = "Email is incorrect." emailField.detailLabel!.text = "Email is incorrect."
emailField.detailLabel!.font = RobotoFont.mediumWithSize(12) emailField.detailLabel!.font = RobotoFont.regularWithSize(12)
emailField.detailLabelActiveColor = MaterialColor.red.accent3 emailField.detailLabelActiveColor = MaterialColor.red.accent3
// emailField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding. // emailField.detailLabelAutoHideEnabled = false // Uncomment this line to have manual hiding.
let image: UIImage? = MaterialIcon.close
let clearButton: FlatButton = FlatButton()
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
emailField.clearButton = clearButton
} }
/// Executed when the 'return' key is pressed when using the emailField. /// Executed when the 'return' key is pressed when using the emailField.
......
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
children = ( children = (
96F2F20D1C97AFC600A5FE27 /* AppDelegate.swift */, 96F2F20D1C97AFC600A5FE27 /* AppDelegate.swift */,
96F2F2141C97AFC600A5FE27 /* ViewController.swift */, 96F2F2141C97AFC600A5FE27 /* ViewController.swift */,
96F2F2111C97AFC600A5FE27 /* Main.storyboard */,
96F2F20E1C97AFC600A5FE27 /* Assets.xcassets */, 96F2F20E1C97AFC600A5FE27 /* Assets.xcassets */,
96F2F20F1C97AFC600A5FE27 /* LaunchScreen.storyboard */, 96F2F20F1C97AFC600A5FE27 /* LaunchScreen.storyboard */,
96F2F2111C97AFC600A5FE27 /* Main.storyboard */,
96F2F2131C97AFC600A5FE27 /* Info.plist */, 96F2F2131C97AFC600A5FE27 /* Info.plist */,
); );
path = Toolbar; path = Toolbar;
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
......
...@@ -94,23 +94,29 @@ class ViewController: UIViewController { ...@@ -94,23 +94,29 @@ class ViewController: UIViewController {
toolbar.detailLabel = detailLabel toolbar.detailLabel = detailLabel
// Menu button. // Menu button.
let img1: UIImage? = MaterialIcon.menu let img1: UIImage? = MaterialIcon.cm.menu
let btn1: FlatButton = FlatButton() let btn1: FlatButton = FlatButton()
btn1.pulseScale = false btn1.pulseScale = false
btn1.pulseColor = MaterialColor.white
btn1.tintColor = MaterialColor.white
btn1.setImage(img1, forState: .Normal) btn1.setImage(img1, forState: .Normal)
btn1.setImage(img1, forState: .Highlighted) btn1.setImage(img1, forState: .Highlighted)
// Star button. // Star button.
let img2: UIImage? = UIImage(named: "ic_star_white") let img2: UIImage? = MaterialIcon.cm.star
let btn2: FlatButton = FlatButton() let btn2: FlatButton = FlatButton()
btn2.pulseScale = false btn2.pulseScale = false
btn2.pulseColor = MaterialColor.white
btn2.tintColor = MaterialColor.white
btn2.setImage(img2, forState: .Normal) btn2.setImage(img2, forState: .Normal)
btn2.setImage(img2, forState: .Highlighted) btn2.setImage(img2, forState: .Highlighted)
// Search button. // Search button.
let img3: UIImage? = UIImage(named: "ic_search_white") let img3: UIImage? = MaterialIcon.cm.search
let btn3: FlatButton = FlatButton() let btn3: FlatButton = FlatButton()
btn3.pulseScale = false btn3.pulseScale = false
btn3.pulseColor = MaterialColor.white
btn3.tintColor = MaterialColor.white
btn3.setImage(img3, forState: .Normal) btn3.setImage(img3, forState: .Normal)
btn3.setImage(img3, forState: .Highlighted) btn3.setImage(img3, forState: .Highlighted)
......
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '1.38.5' s.version = '1.39.4'
s.license = 'BSD' s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.' s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io' s.homepage = 'http://cosmicmind.io'
...@@ -8,9 +8,12 @@ Pod::Spec.new do |s| ...@@ -8,9 +8,12 @@ Pod::Spec.new do |s|
s.authors = { 'CosmicMind, Inc.' => 'support@cosmicmind.io' } s.authors = { 'CosmicMind, Inc.' => 'support@cosmicmind.io' }
s.source = { :git => 'https://github.com/CosmicMind/Material.git', :tag => s.version } s.source = { :git => 'https://github.com/CosmicMind/Material.git', :tag => s.version }
s.ios.deployment_target = '8.0' s.ios.deployment_target = '8.0'
s.source_files = 'Sources/*.swift' s.ios.source_files = 'Sources/iOS/**/*.swift'
s.osx.deployment_target = '10.9'
s.osx.source_files = 'Sources/OSX/**/*.swift'
s.requires_arc = true s.requires_arc = true
s.resource_bundles = { s.resource_bundles = {
'io.cosmicmind.Material' => ['Sources/Assets.xcassets/**/*.png'] 'io.cosmicmind.material.fonts' => ['Sources/**/*.ttf'],
'io.cosmicmind.material.icons' => ['Sources/Assets.xcassets/**/*.png']
} }
end end
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "963832351B88DFD80015F710" BlueprintIdentifier = "963832351B88DFD80015F710"
BuildableName = "Material.framework" BuildableName = "Material.framework"
BlueprintName = "Material" BlueprintName = "Material iOS"
ReferencedContainer = "container:Material.xcodeproj"> ReferencedContainer = "container:Material.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "963832401B88DFD80015F710" BlueprintIdentifier = "963832401B88DFD80015F710"
BuildableName = "Material.xctest" BuildableName = "Material.xctest"
BlueprintName = "MaterialTests" BlueprintName = "Material iOS Tests"
ReferencedContainer = "container:Material.xcodeproj"> ReferencedContainer = "container:Material.xcodeproj">
</BuildableReference> </BuildableReference>
</TestableReference> </TestableReference>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "963832351B88DFD80015F710" BlueprintIdentifier = "963832351B88DFD80015F710"
BuildableName = "Material.framework" BuildableName = "Material.framework"
BlueprintName = "Material" BlueprintName = "Material iOS"
ReferencedContainer = "container:Material.xcodeproj"> ReferencedContainer = "container:Material.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "963832351B88DFD80015F710" BlueprintIdentifier = "963832351B88DFD80015F710"
BuildableName = "Material.framework" BuildableName = "Material.framework"
BlueprintName = "Material" BlueprintName = "Material iOS"
ReferencedContainer = "container:Material.xcodeproj"> ReferencedContainer = "container:Material.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "963832351B88DFD80015F710" BlueprintIdentifier = "963832351B88DFD80015F710"
BuildableName = "Material.framework" BuildableName = "Material.framework"
BlueprintName = "Material" BlueprintName = "Material iOS"
ReferencedContainer = "container:Material.xcodeproj"> ReferencedContainer = "container:Material.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
......
...@@ -26,7 +26,7 @@ Express your creativity with Material, an animation and graphics framework for G ...@@ -26,7 +26,7 @@ Express your creativity with Material, an animation and graphics framework for G
## Requirements ## Requirements
* iOS 8.0+ * iOS 8.0+ / Mac OS X 10.9+
* Xcode 7.3+ * Xcode 7.3+
## Communication ## Communication
...@@ -39,7 +39,7 @@ Express your creativity with Material, an animation and graphics framework for G ...@@ -39,7 +39,7 @@ Express your creativity with Material, an animation and graphics framework for G
## Installation ## Installation
> **Embedded frameworks require a minimum deployment target of iOS 8.** > **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).**
> - [Download Material](https://github.com/CosmicMind/Material/archive/master.zip) > - [Download Material](https://github.com/CosmicMind/Material/archive/master.zip)
Visit the [Installation](https://github.com/CosmicMind/Material/wiki/Installation) page to learn how to install Material using [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage). Visit the [Installation](https://github.com/CosmicMind/Material/wiki/Installation) page to learn how to install Material using [CocoaPods](http://cocoapods.org) and [Carthage](https://github.com/Carthage/Carthage).
...@@ -365,6 +365,11 @@ Add a new dimension of interactivity with CaptureView. CaptureView is a fully fu ...@@ -365,6 +365,11 @@ Add a new dimension of interactivity with CaptureView. CaptureView is a fully fu
* TabBarController * TabBarController
* Scrolling Techniques * Scrolling Techniques
* Snackbar * Snackbar
* BottomNavigationController with Snackbar.
* Bottom Sheets
* Dialogs
* Collapsing Toolbar
* RTL Support
* Advanced Camera / Audio Toolset & Views * Advanced Camera / Audio Toolset & Views
* More Examples * More Examples
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
"images" : [ "images" : [
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_bell_white.png", "filename" : "cm_add_white.png",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_bell_white_2x.png", "filename" : "cm_add_white_2x.png",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"idiom" : "universal", "idiom" : "universal",
"filename" : "ic_bell_white_3x.png", "filename" : "cm_add_white_3x.png",
"scale" : "3x" "scale" : "3x"
} }
], ],
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_arrow_back_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_arrow_back_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_arrow_back_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_arrow_downward_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_arrow_downward_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_arrow_downward_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_audio_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_audio_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_audio_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_bell_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_bell_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_bell_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_close_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_close_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_close_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_image_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_image_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_image_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_menu_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_menu_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_menu_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_more_horiz_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_more_horiz_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_more_horiz_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_more_vert_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_more_vert_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_more_vert_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_pen_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_pen_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_pen_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_photo_camera_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_photo_camera_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_photo_camera_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_photo_library_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_photo_library_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_photo_library_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_search_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_search_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_search_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_settings_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_settings_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_settings_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_share_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_share_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_share_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_star_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_star_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_star_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_video_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_video_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_video_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "cm_videocam_white.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "cm_videocam_white_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cm_videocam_white_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file

247 Bytes | W: | H:

175 Bytes | W: | H:

Sources/Assets.xcassets/ic_close_white.imageset/ic_close_white.png
Sources/Assets.xcassets/ic_close_white.imageset/ic_close_white.png
Sources/Assets.xcassets/ic_close_white.imageset/ic_close_white.png
Sources/Assets.xcassets/ic_close_white.imageset/ic_close_white.png
  • 2-up
  • Swipe
  • Onion skin
{
"images": [
{
"filename": "ic_image_white.png",
"idiom": "universal",
"scale": "1x"
},
{
"filename": "ic_image_white_2x.png",
"idiom": "universal",
"scale": "2x"
},
{
"filename": "ic_image_white_3x.png",
"idiom": "universal",
"scale": "3x"
}
],
"info": {
"author": "xcode",
"version": 1
}
}

375 Bytes | W: | H:

268 Bytes | W: | H:

Sources/Assets.xcassets/ic_share_white.imageset/ic_share_white.png
Sources/Assets.xcassets/ic_share_white.imageset/ic_share_white.png
Sources/Assets.xcassets/ic_share_white.imageset/ic_share_white.png
Sources/Assets.xcassets/ic_share_white.imageset/ic_share_white.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.38.5</string> <string>1.39.4</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#import <UIKit/UIKit.h> #import <Foundation/Foundation.h>
//! Project version number for Material. //! Project version number for Material.
FOUNDATION_EXPORT double MaterialVersionNumber; FOUNDATION_EXPORT double MaterialVersionNumber;
......
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public struct MaterialIcon {
private static var internalBundle: NSBundle?
public static var bundle: NSBundle {
if nil == MaterialIcon.internalBundle {
MaterialIcon.internalBundle = NSBundle(forClass: MaterialView.self)
let b: NSBundle? = NSBundle(URL: MaterialIcon.internalBundle!.resourceURL!.URLByAppendingPathComponent("io.cosmicmind.Material.bundle"))
if let v: NSBundle = b {
MaterialIcon.internalBundle = v
}
}
return MaterialIcon.internalBundle!
}
private static func image(name:String!) -> UIImage {
return (UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate))!
}
public static let add: UIImage? = MaterialIcon.image("ic_add_white")
public static let addCircle: UIImage? = MaterialIcon.image("ic_add_circle_white")
public static let addCircleOutline: UIImage? = MaterialIcon.image("ic_add_circle_outline_white")
public static let arrowBack: UIImage? = MaterialIcon.image("ic_arrow_back_white")
public static let arrowDownward: UIImage? = MaterialIcon.image("ic_arrow_downward_white")
public static let audio: UIImage? = MaterialIcon.image("ic_audiotrack_white")
public static let clear: UIImage? = MaterialIcon.image("ic_close_white")
public static let close: UIImage? = MaterialIcon.image("ic_close_white")
public static let edit: UIImage? = MaterialIcon.image("ic_edit_white")
public static let history: UIImage? = MaterialIcon.image("ic_history_white")
public static let picture: UIImage? = MaterialIcon.image("ic_image_white")
public static let menu: UIImage? = MaterialIcon.image("ic_menu_white")
public static let moreHorizontal: UIImage? = MaterialIcon.image("ic_more_horiz_white")
public static let moreVertical: UIImage? = MaterialIcon.image("ic_more_vert_white")
public static let movie: UIImage? = MaterialIcon.image("ic_movie_white")
public static let pen: UIImage? = MaterialIcon.image("ic_edit_white")
public static let place: UIImage? = MaterialIcon.image("ic_place_white")
public static let photoCamera: UIImage? = MaterialIcon.image("ic_photo_camera_white")
public static let photoLibrary: UIImage? = MaterialIcon.image("ic_photo_library_white")
public static let search: UIImage? = MaterialIcon.image("ic_search_white")
public static let settings: UIImage? = MaterialIcon.image("ic_settings_white")
public static let share: UIImage? = MaterialIcon.image("ic_share_white")
public static let star: UIImage? = MaterialIcon.image("ic_star_white")
public static let starBorder: UIImage? = MaterialIcon.image("ic_star_border_white")
public static let starHalf: UIImage? = MaterialIcon.image("ic_star_half_white")
public static let videocam: UIImage? = MaterialIcon.image("ic_videocam_white")
}
//
// MaterialPulseCollectionViewCell.swift
// Material
//
// Created by Daniel Dahan on 2016-02-24.
// Copyright © 2016 CosmicMind, Inc. All rights reserved.
//
import Foundation
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import AppKit
public struct MaterialColor {
// clear
public static let clear: NSColor = NSColor.clearColor()
// white
public static let white: NSColor = NSColor.whiteColor()
// black
public static let black: NSColor = NSColor.blackColor()
// dark text
public struct darkText {
public static let primary: NSColor = NSColor.blackColor().colorWithAlphaComponent(0.87)
public static let secondary: NSColor = NSColor.blackColor().colorWithAlphaComponent(0.54)
public static let others: NSColor = NSColor.blackColor().colorWithAlphaComponent(0.38)
public static let dividers: NSColor = NSColor.blackColor().colorWithAlphaComponent(0.12)
}
// light text
public struct lightText {
public static let primary: NSColor = NSColor.whiteColor()
public static let secondary: NSColor = NSColor.whiteColor().colorWithAlphaComponent(0.7)
public static let others: NSColor = NSColor.whiteColor().colorWithAlphaComponent(0.5)
public static let dividers: NSColor = NSColor.whiteColor().colorWithAlphaComponent(0.12)
}
// red
public struct red {
public static let lighten5: NSColor = NSColor(red: 255/255, green: 235/255, blue: 238/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 255/255, green: 205/255, blue: 210/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 239/255, green: 154/255, blue: 154/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 229/255, green: 115/255, blue: 115/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 229/255, green: 83/255, blue: 80/255, alpha: 1)
public static let base: NSColor = NSColor(red: 244/255, green: 67/255, blue: 54/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 229/255, green: 57/255, blue: 53/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 211/255, green: 47/255, blue: 47/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 198/255, green: 40/255, blue: 40/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 183/255, green: 28/255, blue: 28/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 138/255, blue: 128/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 82/255, blue: 82/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 255/255, green: 23/255, blue: 68/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 213/255, green: 0/255, blue: 0/255, alpha: 1)
}
// pink
public struct pink {
public static let lighten5: NSColor = NSColor(red: 252/255, green: 228/255, blue: 236/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 248/255, green: 187/255, blue: 208/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 244/255, green: 143/255, blue: 177/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 240/255, green: 98/255, blue: 146/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 236/255, green: 64/255, blue: 122/255, alpha: 1)
public static let base: NSColor = NSColor(red: 233/255, green: 30/255, blue: 99/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 216/255, green: 27/255, blue: 96/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 194/255, green: 24/255, blue: 91/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 173/255, green: 20/255, blue: 87/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 136/255, green: 14/255, blue: 79/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 128/255, blue: 171/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 64/255, blue: 129/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 245/255, green: 0/255, blue: 87/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 197/255, green: 17/255, blue: 98/255, alpha: 1)
}
// purple
public struct purple {
public static let lighten5: NSColor = NSColor(red: 243/255, green: 229/255, blue: 245/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 225/255, green: 190/255, blue: 231/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 206/255, green: 147/255, blue: 216/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 186/255, green: 104/255, blue: 200/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 171/255, green: 71/255, blue: 188/255, alpha: 1)
public static let base: NSColor = NSColor(red: 156/255, green: 39/255, blue: 176/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 142/255, green: 36/255, blue: 170/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 123/255, green: 31/255, blue: 162/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 106/255, green: 27/255, blue: 154/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 74/255, green: 20/255, blue: 140/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 234/255, green: 128/255, blue: 252/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 224/255, green: 64/255, blue: 251/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 213/255, green: 0/255, blue: 249/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 170/255, green: 0/255, blue: 255/255, alpha: 1)
}
// deepPurple
public struct deepPurple {
public static let lighten5: NSColor = NSColor(red: 237/255, green: 231/255, blue: 246/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 209/255, green: 196/255, blue: 233/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 179/255, green: 157/255, blue: 219/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 149/255, green: 117/255, blue: 205/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 126/255, green: 87/255, blue: 194/255, alpha: 1)
public static let base: NSColor = NSColor(red: 103/255, green: 58/255, blue: 183/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 94/255, green: 53/255, blue: 177/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 81/255, green: 45/255, blue: 168/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 69/255, green: 39/255, blue: 160/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 49/255, green: 27/255, blue: 146/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 179/255, green: 136/255, blue: 255/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 124/255, green: 77/255, blue: 255/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 101/255, green: 31/255, blue: 255/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 98/255, green: 0/255, blue: 234/255, alpha: 1)
}
// indigo
public struct indigo {
public static let lighten5: NSColor = NSColor(red: 232/255, green: 234/255, blue: 246/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 197/255, green: 202/255, blue: 233/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 159/255, green: 168/255, blue: 218/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 121/255, green: 134/255, blue: 203/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 92/255, green: 107/255, blue: 192/255, alpha: 1)
public static let base: NSColor = NSColor(red: 63/255, green: 81/255, blue: 181/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 57/255, green: 73/255, blue: 171/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 48/255, green: 63/255, blue: 159/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 40/255, green: 53/255, blue: 147/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 26/255, green: 35/255, blue: 126/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 140/255, green: 158/255, blue: 255/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 83/255, green: 109/255, blue: 254/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 61/255, green: 90/255, blue: 254/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 48/255, green: 79/255, blue: 254/255, alpha: 1)
}
// blue
public struct blue {
public static let lighten5: NSColor = NSColor(red: 227/255, green: 242/255, blue: 253/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 187/255, green: 222/255, blue: 251/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 144/255, green: 202/255, blue: 249/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 100/255, green: 181/255, blue: 246/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 66/255, green: 165/255, blue: 245/255, alpha: 1)
public static let base: NSColor = NSColor(red: 33/255, green: 150/255, blue: 243/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 30/255, green: 136/255, blue: 229/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 25/255, green: 118/255, blue: 210/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 21/255, green: 101/255, blue: 192/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 13/255, green: 71/255, blue: 161/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 130/255, green: 177/255, blue: 255/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 68/255, green: 138/255, blue: 255/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 41/255, green: 121/255, blue: 255/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 41/255, green: 98/255, blue: 255/255, alpha: 1)
}
// light blue
public struct lightBlue {
public static let lighten5: NSColor = NSColor(red: 225/255, green: 245/255, blue: 254/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 179/255, green: 229/255, blue: 252/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 129/255, green: 212/255, blue: 250/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 79/255, green: 195/255, blue: 247/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 41/255, green: 182/255, blue: 246/255, alpha: 1)
public static let base: NSColor = NSColor(red: 3/255, green: 169/255, blue: 244/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 3/255, green: 155/255, blue: 229/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 2/255, green: 136/255, blue: 209/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 2/255, green: 119/255, blue: 189/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 1/255, green: 87/255, blue: 155/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 128/255, green: 216/255, blue: 255/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 64/255, green: 196/255, blue: 255/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 0/255, green: 176/255, blue: 255/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 0/255, green: 145/255, blue: 234/255, alpha: 1)
}
// cyan
public struct cyan {
public static let lighten5: NSColor = NSColor(red: 224/255, green: 247/255, blue: 250/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 178/255, green: 235/255, blue: 242/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 128/255, green: 222/255, blue: 234/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 77/255, green: 208/255, blue: 225/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 38/255, green: 198/255, blue: 218/255, alpha: 1)
public static let base: NSColor = NSColor(red: 0/255, green: 188/255, blue: 212/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 0/255, green: 172/255, blue: 193/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 0/255, green: 151/255, blue: 167/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 0/255, green: 131/255, blue: 143/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 0/255, green: 96/255, blue: 100/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 132/255, green: 255/255, blue: 255/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 24/255, green: 255/255, blue: 255/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 0/255, green: 229/255, blue: 255/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 0/255, green: 184/255, blue: 212/255, alpha: 1)
}
// teal
public struct teal {
public static let lighten5: NSColor = NSColor(red: 224/255, green: 242/255, blue: 241/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 178/255, green: 223/255, blue: 219/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 128/255, green: 203/255, blue: 196/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 77/255, green: 182/255, blue: 172/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 38/255, green: 166/255, blue: 154/255, alpha: 1)
public static let base: NSColor = NSColor(red: 0/255, green: 150/255, blue: 136/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 0/255, green: 137/255, blue: 123/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 0/255, green: 121/255, blue: 107/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 0/255, green: 105/255, blue: 92/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 0/255, green: 77/255, blue: 64/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 167/255, green: 255/255, blue: 235/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 100/255, green: 255/255, blue: 218/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 29/255, green: 233/255, blue: 182/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 0/255, green: 191/255, blue: 165/255, alpha: 1)
}
// green
public struct green {
public static let lighten5: NSColor = NSColor(red: 232/255, green: 245/255, blue: 233/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 200/255, green: 230/255, blue: 201/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 165/255, green: 214/255, blue: 167/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 129/255, green: 199/255, blue: 132/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 102/255, green: 187/255, blue: 106/255, alpha: 1)
public static let base: NSColor = NSColor(red: 76/255, green: 175/255, blue: 80/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 67/255, green: 160/255, blue: 71/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 56/255, green: 142/255, blue: 60/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 46/255, green: 125/255, blue: 50/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 27/255, green: 94/255, blue: 32/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 185/255, green: 246/255, blue: 202/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 105/255, green: 240/255, blue: 174/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 0/255, green: 230/255, blue: 118/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 0/255, green: 200/255, blue: 83/255, alpha: 1)
}
// light green
public struct lightGreen {
public static let lighten5: NSColor = NSColor(red: 241/255, green: 248/255, blue: 233/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 220/255, green: 237/255, blue: 200/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 197/255, green: 225/255, blue: 165/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 174/255, green: 213/255, blue: 129/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 156/255, green: 204/255, blue: 101/255, alpha: 1)
public static let base: NSColor = NSColor(red: 139/255, green: 195/255, blue: 74/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 124/255, green: 179/255, blue: 66/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 104/255, green: 159/255, blue: 56/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 85/255, green: 139/255, blue: 47/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 51/255, green: 105/255, blue: 30/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 204/255, green: 255/255, blue: 144/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 178/255, green: 255/255, blue: 89/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 118/255, green: 255/255, blue: 3/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 100/255, green: 221/255, blue: 23/255, alpha: 1)
}
// lime
public struct lime {
public static let lighten5: NSColor = NSColor(red: 249/255, green: 251/255, blue: 231/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 240/255, green: 244/255, blue: 195/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 230/255, green: 238/255, blue: 156/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 220/255, green: 231/255, blue: 117/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 212/255, green: 225/255, blue: 87/255, alpha: 1)
public static let base: NSColor = NSColor(red: 205/255, green: 220/255, blue: 57/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 192/255, green: 202/255, blue: 51/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 175/255, green: 180/255, blue: 43/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 158/255, green: 157/255, blue: 36/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 130/255, green: 119/255, blue: 23/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 244/255, green: 255/255, blue: 129/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 238/255, green: 255/255, blue: 65/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 198/255, green: 255/255, blue: 0/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 174/255, green: 234/255, blue: 0/255, alpha: 1)
}
// yellow
public struct yellow {
public static let lighten5: NSColor = NSColor(red: 255/255, green: 253/255, blue: 231/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 255/255, green: 249/255, blue: 196/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 255/255, green: 245/255, blue: 157/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 255/255, green: 241/255, blue: 118/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 255/255, green: 238/255, blue: 88/255, alpha: 1)
public static let base: NSColor = NSColor(red: 255/255, green: 235/255, blue: 59/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 253/255, green: 216/255, blue: 53/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 251/255, green: 192/255, blue: 45/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 249/255, green: 168/255, blue: 37/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 245/255, green: 127/255, blue: 23/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 255/255, blue: 141/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 255/255, blue: 0/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 255/255, green: 234/255, blue: 0/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 255/255, green: 214/255, blue: 0/255, alpha: 1)
}
// amber
public struct amber {
public static let lighten5: NSColor = NSColor(red: 255/255, green: 248/255, blue: 225/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 255/255, green: 236/255, blue: 179/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 255/255, green: 224/255, blue: 130/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 255/255, green: 213/255, blue: 79/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 255/255, green: 202/255, blue: 40/255, alpha: 1)
public static let base: NSColor = NSColor(red: 255/255, green: 193/255, blue: 7/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 255/255, green: 179/255, blue: 0/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 255/255, green: 160/255, blue: 0/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 255/255, green: 143/255, blue: 0/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 255/255, green: 111/255, blue: 0/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 229/255, blue: 127/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 215/255, blue: 64/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 255/255, green: 196/255, blue: 0/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 255/255, green: 171/255, blue: 0/255, alpha: 1)
}
// orange
public struct orange {
public static let lighten5: NSColor = NSColor(red: 255/255, green: 243/255, blue: 224/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 255/255, green: 224/255, blue: 178/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 255/255, green: 204/255, blue: 128/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 255/255, green: 183/255, blue: 77/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 255/255, green: 167/255, blue: 38/255, alpha: 1)
public static let base: NSColor = NSColor(red: 255/255, green: 152/255, blue: 0/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 251/255, green: 140/255, blue: 0/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 245/255, green: 124/255, blue: 0/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 239/255, green: 108/255, blue: 0/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 230/255, green: 81/255, blue: 0/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 209/255, blue: 128/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 171/255, blue: 64/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 255/255, green: 145/255, blue: 0/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 255/255, green: 109/255, blue: 0/255, alpha: 1)
}
// deep orange
public struct deepOrange {
public static let lighten5: NSColor = NSColor(red: 251/255, green: 233/255, blue: 231/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 255/255, green: 204/255, blue: 188/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 255/255, green: 171/255, blue: 145/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 255/255, green: 138/255, blue: 101/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 255/255, green: 112/255, blue: 67/255, alpha: 1)
public static let base: NSColor = NSColor(red: 255/255, green: 87/255, blue: 34/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 244/255, green: 81/255, blue: 30/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 230/255, green: 74/255, blue: 25/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 216/255, green: 67/255, blue: 21/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 191/255, green: 54/255, blue: 12/255, alpha: 1)
public static let accent1: NSColor = NSColor(red: 255/255, green: 158/255, blue: 128/255, alpha: 1)
public static let accent2: NSColor = NSColor(red: 255/255, green: 110/255, blue: 64/255, alpha: 1)
public static let accent3: NSColor = NSColor(red: 255/255, green: 61/255, blue: 0/255, alpha: 1)
public static let accent4: NSColor = NSColor(red: 221/255, green: 44/255, blue: 0/255, alpha: 1)
}
// brown
public struct brown {
public static let lighten5: NSColor = NSColor(red: 239/255, green: 235/255, blue: 233/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 215/255, green: 204/255, blue: 200/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 188/255, green: 170/255, blue: 164/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 161/255, green: 136/255, blue: 127/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 141/255, green: 110/255, blue: 99/255, alpha: 1)
public static let base: NSColor = NSColor(red: 121/255, green: 85/255, blue: 72/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 109/255, green: 76/255, blue: 65/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 93/255, green: 64/255, blue: 55/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 78/255, green: 52/255, blue: 46/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 62/255, green: 39/255, blue: 35/255, alpha: 1)
}
// grey
public struct grey {
public static let lighten5: NSColor = NSColor(red: 250/255, green: 250/255, blue: 250/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 245/255, green: 245/255, blue: 245/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 238/255, green: 238/255, blue: 238/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 224/255, green: 224/255, blue: 224/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 189/255, green: 189/255, blue: 189/255, alpha: 1)
public static let base: NSColor = NSColor(red: 158/255, green: 158/255, blue: 158/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 117/255, green: 117/255, blue: 117/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 97/255, green: 97/255, blue: 97/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 66/255, green: 66/255, blue: 66/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 33/255, green: 33/255, blue: 33/255, alpha: 1)
}
// blue grey
public struct blueGrey {
public static let lighten5: NSColor = NSColor(red: 236/255, green: 239/255, blue: 241/255, alpha: 1)
public static let lighten4: NSColor = NSColor(red: 207/255, green: 216/255, blue: 220/255, alpha: 1)
public static let lighten3: NSColor = NSColor(red: 176/255, green: 190/255, blue: 197/255, alpha: 1)
public static let lighten2: NSColor = NSColor(red: 144/255, green: 164/255, blue: 174/255, alpha: 1)
public static let lighten1: NSColor = NSColor(red: 120/255, green: 144/255, blue: 156/255, alpha: 1)
public static let base: NSColor = NSColor(red: 96/255, green: 125/255, blue: 139/255, alpha: 1)
public static let darken1: NSColor = NSColor(red: 84/255, green: 110/255, blue: 122/255, alpha: 1)
public static let darken2: NSColor = NSColor(red: 69/255, green: 90/255, blue: 100/255, alpha: 1)
public static let darken3: NSColor = NSColor(red: 55/255, green: 71/255, blue: 79/255, alpha: 1)
public static let darken4: NSColor = NSColor(red: 38/255, green: 50/255, blue: 56/255, alpha: 1)
}
}
...@@ -85,7 +85,7 @@ public class BottomTabBar : UITabBar { ...@@ -85,7 +85,7 @@ public class BottomTabBar : UITabBar {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -100,7 +100,7 @@ public class BottomTabBar : UITabBar { ...@@ -100,7 +100,7 @@ public class BottomTabBar : UITabBar {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
......
...@@ -66,7 +66,7 @@ public class CardView : MaterialPulseView { ...@@ -66,7 +66,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: dividerInset :name: dividerInset
*/ */
public var dividerInset: UIEdgeInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) { @IBInspectable public var dividerInset: UIEdgeInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -84,7 +84,7 @@ public class CardView : MaterialPulseView { ...@@ -84,7 +84,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: contentInset :name: contentInset
*/ */
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -102,7 +102,7 @@ public class CardView : MaterialPulseView { ...@@ -102,7 +102,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: titleLabelInset :name: titleLabelInset
*/ */
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -111,7 +111,7 @@ public class CardView : MaterialPulseView { ...@@ -111,7 +111,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: titleLabel :name: titleLabel
*/ */
public var titleLabel: UILabel? { @IBInspectable public var titleLabel: UILabel? {
didSet { didSet {
titleLabel?.translatesAutoresizingMaskIntoConstraints = false titleLabel?.translatesAutoresizingMaskIntoConstraints = false
reloadView() reloadView()
...@@ -130,7 +130,7 @@ public class CardView : MaterialPulseView { ...@@ -130,7 +130,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: detailViewInset :name: detailViewInset
*/ */
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -139,7 +139,7 @@ public class CardView : MaterialPulseView { ...@@ -139,7 +139,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: detailView :name: detailView
*/ */
public var detailView: UIView? { @IBInspectable public var detailView: UIView? {
didSet { didSet {
detailView?.translatesAutoresizingMaskIntoConstraints = false detailView?.translatesAutoresizingMaskIntoConstraints = false
reloadView() reloadView()
...@@ -158,7 +158,7 @@ public class CardView : MaterialPulseView { ...@@ -158,7 +158,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: leftButtonsInset :name: leftButtonsInset
*/ */
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) { @IBInspectable public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -190,7 +190,7 @@ public class CardView : MaterialPulseView { ...@@ -190,7 +190,7 @@ public class CardView : MaterialPulseView {
/** /**
:name: rightButtonsInset :name: rightButtonsInset
*/ */
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) { @IBInspectable public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet { didSet {
reloadView() reloadView()
} }
......
...@@ -47,7 +47,7 @@ public class ControlView : MaterialView { ...@@ -47,7 +47,7 @@ public class ControlView : MaterialView {
} }
/// A wrapper around grid.contentInset. /// A wrapper around grid.contentInset.
public var contentInset: UIEdgeInsets { @IBInspectable public var contentInset: UIEdgeInsets {
get { get {
return grid.contentInset return grid.contentInset
} }
......
...@@ -66,7 +66,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -66,7 +66,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: dividerInset :name: dividerInset
*/ */
public var dividerInset: UIEdgeInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) { @IBInspectable public var dividerInset: UIEdgeInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -177,7 +177,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -177,7 +177,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: contentInset :name: contentInset
*/ */
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -195,7 +195,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -195,7 +195,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: titleLabelInset :name: titleLabelInset
*/ */
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -204,7 +204,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -204,7 +204,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: titleLabel :name: titleLabel
*/ */
public var titleLabel: UILabel? { @IBInspectable public var titleLabel: UILabel? {
didSet { didSet {
titleLabel?.translatesAutoresizingMaskIntoConstraints = false titleLabel?.translatesAutoresizingMaskIntoConstraints = false
reloadView() reloadView()
...@@ -223,7 +223,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -223,7 +223,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: detailViewInset :name: detailViewInset
*/ */
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) { @IBInspectable public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -232,7 +232,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -232,7 +232,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: detailView :name: detailView
*/ */
public var detailView: UIView? { @IBInspectable public var detailView: UIView? {
didSet { didSet {
detailView?.translatesAutoresizingMaskIntoConstraints = false detailView?.translatesAutoresizingMaskIntoConstraints = false
reloadView() reloadView()
...@@ -251,7 +251,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -251,7 +251,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: leftButtonsInset :name: leftButtonsInset
*/ */
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) { @IBInspectable public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet { didSet {
reloadView() reloadView()
} }
...@@ -283,7 +283,7 @@ public class ImageCardView : MaterialPulseView { ...@@ -283,7 +283,7 @@ public class ImageCardView : MaterialPulseView {
/** /**
:name: rightButtonsInset :name: rightButtonsInset
*/ */
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) { @IBInspectable public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet { didSet {
reloadView() reloadView()
} }
......
...@@ -43,9 +43,7 @@ public enum MaterialBorder { ...@@ -43,9 +43,7 @@ public enum MaterialBorder {
case Border9 case Border9
} }
/** /// Converts the MaterialBorder enum to a CGFloat value.
:name: MaterialBorderToValue
*/
public func MaterialBorderToValue(border: MaterialBorder) -> CGFloat { public func MaterialBorderToValue(border: MaterialBorder) -> CGFloat {
switch border { switch border {
case .None: case .None:
......
...@@ -104,7 +104,7 @@ public class MaterialButton : UIButton { ...@@ -104,7 +104,7 @@ public class MaterialButton : UIButton {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -122,7 +122,7 @@ public class MaterialButton : UIButton { ...@@ -122,7 +122,7 @@ public class MaterialButton : UIButton {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
......
...@@ -117,7 +117,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -117,7 +117,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
/// A Preset for the contentsGravity property. /// A Preset for the contentsGravity property.
public var contentsGravityPreset: MaterialGravity { public var contentsGravityPreset: MaterialGravity {
didSet { didSet {
contentsGravity = MaterialGravityToString(contentsGravityPreset) contentsGravity = MaterialGravityToValue(contentsGravityPreset)
} }
} }
...@@ -142,7 +142,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -142,7 +142,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
} }
/// A wrapper around grid.contentInset. /// A wrapper around grid.contentInset.
public var contentInset: UIEdgeInsets { @IBInspectable public var contentInset: UIEdgeInsets {
get { get {
return contentView.grid.contentInset return contentView.grid.contentInset
} }
...@@ -211,7 +211,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -211,7 +211,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -229,7 +229,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell { ...@@ -229,7 +229,7 @@ public class MaterialCollectionViewCell : UICollectionViewCell {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
......
...@@ -41,9 +41,7 @@ public enum MaterialDepth { ...@@ -41,9 +41,7 @@ public enum MaterialDepth {
case Depth5 case Depth5
} }
/** /// Converts the MaterialDepth enum to a MaterialDepthType value.
:name: MaterialDepthToValue
*/
public func MaterialDepthToValue(depth: MaterialDepth) -> MaterialDepthType { public func MaterialDepthToValue(depth: MaterialDepth) -> MaterialDepthType {
switch depth { switch depth {
case .None: case .None:
......
...@@ -45,10 +45,8 @@ public enum MaterialGravity { ...@@ -45,10 +45,8 @@ public enum MaterialGravity {
case ResizeAspectFill case ResizeAspectFill
} }
/** /// Converts the MaterialGravity enum to a String value.
:name: MaterialGravityToString public func MaterialGravityToValue(gravity: MaterialGravity) -> String {
*/
public func MaterialGravityToString(gravity: MaterialGravity) -> String {
switch gravity { switch gravity {
case .Center: case .Center:
return kCAGravityCenter return kCAGravityCenter
......
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public struct MaterialIcon {
private static var internalBundle: NSBundle?
public static var bundle: NSBundle {
if nil == MaterialIcon.internalBundle {
MaterialIcon.internalBundle = NSBundle(forClass: MaterialView.self)
let b: NSBundle? = NSBundle(URL: MaterialIcon.internalBundle!.resourceURL!.URLByAppendingPathComponent("io.cosmicmind.material.icons.bundle"))
if let v: NSBundle = b {
MaterialIcon.internalBundle = v
}
}
return MaterialIcon.internalBundle!
}
/// Default Google icons.
public static let add: UIImage? = UIImage(named: "ic_add_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let arrowBack: UIImage? = UIImage(named: "ic_arrow_back_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let arrowDownward: UIImage? = UIImage(named: "ic_arrow_downward_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let clear: UIImage? = UIImage(named: "ic_close_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let close: UIImage? = UIImage(named: "ic_close_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let menu: UIImage? = UIImage(named: "ic_menu_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let moreHorizontal: UIImage? = UIImage(named: "ic_more_horiz_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let moreVertical: UIImage? = UIImage(named: "ic_more_vert_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let search: UIImage? = UIImage(named: "ic_search_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let share: UIImage? = UIImage(named: "ic_share_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let star: UIImage? = UIImage(named: "ic_star_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let videocam: UIImage? = UIImage(named: "ic_videocam_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
/// Custom CosmicMind icons.
public struct cm {
public static let add: UIImage? = UIImage(named: "cm_add_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let arrowBack: UIImage? = UIImage(named: "cm_arrow_back_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let arrowDownward: UIImage? = UIImage(named: "cm_arrow_downward_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let audio: UIImage? = UIImage(named: "cm_audio_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let bell: UIImage? = UIImage(named: "cm_bell_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let clear: UIImage? = UIImage(named: "cm_close_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let close: UIImage? = UIImage(named: "cm_close_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let image: UIImage? = UIImage(named: "cm_image_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let menu: UIImage? = UIImage(named: "cm_menu_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let moreHorizontal: UIImage? = UIImage(named: "cm_more_horiz_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let moreVertical: UIImage? = UIImage(named: "cm_more_vert_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let pen: UIImage? = UIImage(named: "cm_pen_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let photoCamera: UIImage? = UIImage(named: "cm_photo_camera_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let photoLibrary: UIImage? = UIImage(named: "cm_photo_library_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let search: UIImage? = UIImage(named: "cm_search_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let settings: UIImage? = UIImage(named: "cm_settings_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let share: UIImage? = UIImage(named: "cm_share_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let star: UIImage? = UIImage(named: "cm_star_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let video: UIImage? = UIImage(named: "cm_video_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let videocam: UIImage? = UIImage(named: "cm_videocam_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
}
}
...@@ -64,7 +64,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -64,7 +64,7 @@ public class MaterialLayer : CAShapeLayer {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -82,7 +82,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -82,7 +82,7 @@ public class MaterialLayer : CAShapeLayer {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
...@@ -146,7 +146,7 @@ public class MaterialLayer : CAShapeLayer { ...@@ -146,7 +146,7 @@ public class MaterialLayer : CAShapeLayer {
/// A Preset for the contentsGravity property. /// A Preset for the contentsGravity property.
public var contentsGravityPreset: MaterialGravity { public var contentsGravityPreset: MaterialGravity {
didSet { didSet {
contentsGravity = MaterialGravityToString(contentsGravityPreset) contentsGravity = MaterialGravityToValue(contentsGravityPreset)
} }
} }
......
...@@ -94,7 +94,7 @@ public class MaterialSwitch : UIControl { ...@@ -94,7 +94,7 @@ public class MaterialSwitch : UIControl {
} }
} }
/// A property that accesses the layer.frame.origin.width property. /// A property that accesses the layer.frame.size.width property.
@IBInspectable public var width: CGFloat { @IBInspectable public var width: CGFloat {
get { get {
return layer.frame.size.width return layer.frame.size.width
...@@ -104,7 +104,7 @@ public class MaterialSwitch : UIControl { ...@@ -104,7 +104,7 @@ public class MaterialSwitch : UIControl {
} }
} }
/// A property that accesses the layer.frame.origin.height property. /// A property that accesses the layer.frame.size.height property.
@IBInspectable public var height: CGFloat { @IBInspectable public var height: CGFloat {
get { get {
return layer.frame.size.height return layer.frame.size.height
......
...@@ -103,7 +103,7 @@ public class MaterialTableViewCell : UITableViewCell { ...@@ -103,7 +103,7 @@ public class MaterialTableViewCell : UITableViewCell {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -118,7 +118,7 @@ public class MaterialTableViewCell : UITableViewCell { ...@@ -118,7 +118,7 @@ public class MaterialTableViewCell : UITableViewCell {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
......
...@@ -102,7 +102,7 @@ public class MaterialView : UIView { ...@@ -102,7 +102,7 @@ public class MaterialView : UIView {
/// A Preset for the contentsGravity property. /// A Preset for the contentsGravity property.
@IBInspectable public var contentsGravityPreset: MaterialGravity { @IBInspectable public var contentsGravityPreset: MaterialGravity {
didSet { didSet {
contentsGravity = MaterialGravityToString(contentsGravityPreset) contentsGravity = MaterialGravityToValue(contentsGravityPreset)
} }
} }
...@@ -159,7 +159,7 @@ public class MaterialView : UIView { ...@@ -159,7 +159,7 @@ public class MaterialView : UIView {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -177,7 +177,7 @@ public class MaterialView : UIView { ...@@ -177,7 +177,7 @@ public class MaterialView : UIView {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
......
...@@ -62,7 +62,7 @@ public class NavigationBar : UINavigationBar { ...@@ -62,7 +62,7 @@ public class NavigationBar : UINavigationBar {
return backIndicatorImage return backIndicatorImage
} }
set(value) { set(value) {
let image: UIImage? = nil == value ? MaterialIcon.arrowBack : value let image: UIImage? = nil == value ? MaterialIcon.cm.arrowBack : value
backIndicatorImage = image backIndicatorImage = image
backIndicatorTransitionMaskImage = image backIndicatorTransitionMaskImage = image
backButton.setImage(image, forState: .Normal) backButton.setImage(image, forState: .Normal)
...@@ -127,7 +127,7 @@ public class NavigationBar : UINavigationBar { ...@@ -127,7 +127,7 @@ public class NavigationBar : UINavigationBar {
} }
/** /**
A property that accesses the layer.frame.origin.width property. A property that accesses the layer.frame.size.width property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct value that is not .None, the height will be adjusted to maintain the correct
shape. shape.
...@@ -142,7 +142,7 @@ public class NavigationBar : UINavigationBar { ...@@ -142,7 +142,7 @@ public class NavigationBar : UINavigationBar {
} }
/** /**
A property that accesses the layer.frame.origin.height property. A property that accesses the layer.frame.size.height property.
When setting this property in conjunction with the shape property having a When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct value that is not .None, the width will be adjusted to maintain the correct
shape. shape.
...@@ -401,7 +401,7 @@ public class NavigationBar : UINavigationBar { ...@@ -401,7 +401,7 @@ public class NavigationBar : UINavigationBar {
backButtonImage = nil backButtonImage = nil
backgroundColor = MaterialColor.white backgroundColor = MaterialColor.white
depth = .Depth1 depth = .Depth1
contentInset = UIEdgeInsetsMake(2, 2, 2, 2) contentInsetPreset = .Square1
prepareBackButton() prepareBackButton()
} }
......
...@@ -32,46 +32,57 @@ import UIKit ...@@ -32,46 +32,57 @@ import UIKit
public class SearchBar : StatusBarView { public class SearchBar : StatusBarView {
/// The UITextField for the searchBar. /// The UITextField for the searchBar.
public private(set) lazy var textField: TextField = TextField() public private(set) var textField: UITextField!
/// The UIImage for the clear icon. /// Reference to the clearButton.
public var clearButton: UIButton? { public private(set) var clearButton: FlatButton!
get {
return textField.clearButton /// Handle the clearButton manually.
@IBInspectable public var clearButtonAutoHandleEnabled: Bool = true {
didSet {
clearButton.removeTarget(self, action: #selector(handleClearButton), forControlEvents: .TouchUpInside)
if clearButtonAutoHandleEnabled {
clearButton.addTarget(self, action: #selector(handleClearButton), forControlEvents: .TouchUpInside)
} }
set(value) {
textField.clearButton = value
} }
} }
/// TintColor for searchBar. /// TintColor for searchBar.
@IBInspectable public override var tintColor: UIColor? { @IBInspectable public override var tintColor: UIColor? {
didSet { get {
textField.tintColor = tintColor return textField.tintColor
}
set(value) {
textField.tintColor = value
} }
} }
/// TextColor for searchBar. /// TextColor for searchBar.
@IBInspectable public var textColor: UIColor? { @IBInspectable public var textColor: UIColor? {
didSet { get {
textField.textColor = textColor return textField.textColor
}
set(value) {
textField.textColor = value
} }
} }
/// A wrapper for searchBar.placeholder. /// A wrapper for searchBar.placeholder.
@IBInspectable public var placeholder: String? { @IBInspectable public var placeholder: String? {
didSet { get {
textField.placeholder = placeholder return textField.placeholder
}
set(value) {
textField.placeholder = value
} }
} }
/// Placeholder textColor. /// Placeholder textColor.
@IBInspectable public var placeholderTextColor: UIColor { @IBInspectable public var placeholderTextColor: UIColor = MaterialColor.grey.base {
get { didSet {
return textField.placeholderTextColor if let v: String = textField.placeholder {
textField.attributedPlaceholder = NSAttributedString(string: v, attributes: [NSForegroundColorAttributeName: placeholderTextColor])
} }
set(value) {
textField.placeholderTextColor = value
} }
} }
...@@ -85,23 +96,55 @@ public class SearchBar : StatusBarView { ...@@ -85,23 +96,55 @@ public class SearchBar : StatusBarView {
if willRenderView { if willRenderView {
contentView.grid.views?.append(textField) contentView.grid.views?.append(textField)
contentView.grid.reloadLayout() contentView.grid.reloadLayout()
textField.font = textField.font?.fontWithSize(20) reloadView()
textField.reloadView() }
} }
/// Reloads the view.
public func reloadView() {
/// Align the clearButton.
let h: CGFloat = textField.frame.height
clearButton.frame = CGRectMake(textField.frame.width - h, 0, h, h)
} }
/// Prepares the contentView. /// Prepares the contentView.
public override func prepareContentView() { public override func prepareContentView() {
super.prepareContentView() super.prepareContentView()
prepareTextField() prepareTextField()
prepareClearButton()
} }
/// Clears the textField text.
internal func handleClearButton() {
textField.text = ""
}
/// Prepares the textField. /// Prepares the textField.
private func prepareTextField() { private func prepareTextField() {
textField.placeholder = "Search" textField = UITextField()
textField.font = RobotoFont.regularWithSize(20)
textField.backgroundColor = MaterialColor.clear textField.backgroundColor = MaterialColor.clear
textField.clearButtonMode = .WhileEditing textField.clearButtonMode = .WhileEditing
tintColor = MaterialColor.grey.base
textColor = MaterialColor.grey.darken4
placeholder = "Search"
placeholderTextColor = MaterialColor.grey.base
contentView.addSubview(textField) contentView.addSubview(textField)
} }
/// Prepares the clearButton.
private func prepareClearButton() {
let image: UIImage? = MaterialIcon.cm.close
clearButton = FlatButton()
clearButton.contentEdgeInsets = UIEdgeInsetsZero
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
clearButtonAutoHandleEnabled = true
textField.clearButtonMode = .Never
textField.rightViewMode = .WhileEditing
textField.rightView = clearButton
}
} }
...@@ -110,7 +110,7 @@ public class StatusBarView : ControlView { ...@@ -110,7 +110,7 @@ public class StatusBarView : ControlView {
super.prepareView() super.prepareView()
depth = .Depth1 depth = .Depth1
spacingPreset = .Spacing1 spacingPreset = .Spacing1
contentInset = UIEdgeInsetsMake(2, 2, 2, 2) contentInsetPreset = .Square1
autoresizingMask = .FlexibleWidth autoresizingMask = .FlexibleWidth
shadowPathAutoSizeEnabled = false shadowPathAutoSizeEnabled = false
} }
......
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public enum TabBarLineAlignment {
case Top
case Bottom
}
public class TabBar : MaterialView {
/// A reference to the line UIView.
public private(set) var line: UIView!
/// A value for the line alignment.
public var lineAlignment: TabBarLineAlignment = .Bottom {
didSet {
layoutSubviews()
}
}
/// Will render the view.
public var willRenderView: Bool {
return 0 < width
}
/// Buttons.
public var buttons: Array<UIButton>? {
didSet {
if let v: Array<UIButton> = oldValue {
for b in v {
b.removeFromSuperview()
}
}
if let v: Array<UIButton> = buttons {
for b in v {
addSubview(b)
}
}
layoutSubviews()
}
}
public override func layoutSubviews() {
super.layoutSubviews()
if willRenderView {
if let v: Array<UIButton> = buttons {
if 0 < v.count {
let columns: Int = grid.axis.columns / v.count
for b in v {
b.grid.columns = columns
b.contentEdgeInsets = UIEdgeInsetsZero
b.layer.cornerRadius = 0
b.removeTarget(self, action: #selector(handleButton(_:)), forControlEvents: .TouchUpInside)
b.addTarget(self, action: #selector(handleButton(_:)), forControlEvents: .TouchUpInside)
}
grid.views = v as Array<UIView>
line.frame = CGRectMake(0, .Bottom == lineAlignment ? height - 3 : 0, v.first!.frame.width, 3)
}
}
}
}
/// Handles the button touch event.
internal func handleButton(button: UIButton) {
UIView.animateWithDuration(0.25, animations: { [unowned self] in
self.line.frame.origin.x = button.frame.origin.x
self.line.frame.size.width = button.frame.size.width
})
}
/**
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public override func prepareView() {
super.prepareView()
autoresizingMask = .FlexibleWidth
prepareBottomLayer()
}
// Prepares the bottomLayer.
private func prepareBottomLayer() {
line = UIView()
line.backgroundColor = MaterialColor.yellow.base
addSubview(line)
}
}
\ No newline at end of file
...@@ -34,6 +34,9 @@ public protocol TextFieldDelegate : UITextFieldDelegate {} ...@@ -34,6 +34,9 @@ public protocol TextFieldDelegate : UITextFieldDelegate {}
@IBDesignable @IBDesignable
public class TextField : UITextField { public class TextField : UITextField {
/// A reference to the placeholder value.
private var placeholderText: String?
/** /**
This property is the same as clipsToBounds. It crops any of the view's This property is the same as clipsToBounds. It crops any of the view's
contents from bleeding past the view's frame. contents from bleeding past the view's frame.
...@@ -74,39 +77,23 @@ public class TextField : UITextField { ...@@ -74,39 +77,23 @@ public class TextField : UITextField {
} }
} }
/** /// A property that accesses the layer.frame.size.width property.
A property that accesses the layer.frame.origin.width property.
When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable public var width: CGFloat { @IBInspectable public var width: CGFloat {
get { get {
return layer.frame.size.width return layer.frame.size.width
} }
set(value) { set(value) {
layer.frame.size.width = value layer.frame.size.width = value
if .None != shape {
layer.frame.size.height = value
}
} }
} }
/** /// A property that accesses the layer.frame.size.height property.
A property that accesses the layer.frame.origin.height property.
When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable public var height: CGFloat { @IBInspectable public var height: CGFloat {
get { get {
return layer.frame.size.height return layer.frame.size.height
} }
set(value) { set(value) {
layer.frame.size.height = value layer.frame.size.height = value
if .None != shape {
layer.frame.size.width = value
}
} }
} }
...@@ -183,11 +170,7 @@ public class TextField : UITextField { ...@@ -183,11 +170,7 @@ public class TextField : UITextField {
} }
} }
/** /// A property that sets the cornerRadius of the backing layer.
A property that sets the cornerRadius of the backing layer. If the shape
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadiusPreset: MaterialRadius = .None { public var cornerRadiusPreset: MaterialRadius = .None {
didSet { didSet {
if let v: MaterialRadius = cornerRadiusPreset { if let v: MaterialRadius = cornerRadiusPreset {
...@@ -204,27 +187,6 @@ public class TextField : UITextField { ...@@ -204,27 +187,6 @@ public class TextField : UITextField {
set(value) { set(value) {
layer.cornerRadius = value layer.cornerRadius = value
layoutShadowPath() layoutShadowPath()
if .Circle == shape {
shape = .None
}
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
*/
public var shape: MaterialShape = .None {
didSet {
if .None != shape {
if width < height {
frame.size.width = height
} else {
frame.size.height = width
}
layoutShadowPath()
}
} }
} }
...@@ -275,89 +237,75 @@ public class TextField : UITextField { ...@@ -275,89 +237,75 @@ public class TextField : UITextField {
} }
} }
/// The UIImage for the clear icon. /// Handle the clearButton manually.
public var clearButton: UIButton? { @IBInspectable public var clearButtonAutoHandleEnabled: Bool = true {
didSet { didSet {
if let v: UIButton = clearButton { clearButton.removeTarget(self, action: #selector(handleClearButton), forControlEvents: .TouchUpInside)
clearButtonMode = .Never if clearButtonAutoHandleEnabled {
rightViewMode = .WhileEditing clearButton.addTarget(self, action: #selector(handleClearButton), forControlEvents: .TouchUpInside)
v.contentEdgeInsets = UIEdgeInsetsZero
v.addTarget(self, action: #selector(handleClearButton), forControlEvents: .TouchUpInside)
} else {
clearButtonMode = .WhileEditing
rightViewMode = .Never
} }
rightView = clearButton
reloadView()
} }
} }
/// Reference to the clearButton.
public private(set) var clearButton: FlatButton!
/// The bottom border layer. /// The bottom border layer.
public private(set) lazy var bottomBorderLayer: CAShapeLayer = CAShapeLayer() public private(set) lazy var lineLayer: CAShapeLayer = CAShapeLayer()
/** /**
A property that sets the distance between the textField and A property that sets the distance between the textField and
bottomBorderLayer. lineLayer.
*/ */
@IBInspectable public var bottomBorderLayerDistance: CGFloat = 4 @IBInspectable public var lineLayerDistance: CGFloat = 4
/// The color of the bottomBorderLayer when the textField is not active. /// The lineLayer color when inactive.
@IBInspectable public var bottomBorderColor: UIColor? { @IBInspectable public var lineLayerColor: UIColor? {
didSet { didSet {
MaterialAnimation.animationDisabled { [unowned self] in lineLayer.backgroundColor = lineLayerColor?.CGColor
self.bottomBorderLayer.backgroundColor = self.bottomBorderColor?.CGColor
}
} }
} }
/// The color of the bottomBorderLayer when the textField is active. /// The lineLayer active color.
@IBInspectable public var bottomBorderTitleActiveColor: UIColor? @IBInspectable public var lineLayerActiveColor: UIColor?
/** /// The lineLayer detail color when inactive.
The color of the bottomBorderLayer when the detailLabelHidden property is @IBInspectable public var lineLayerDetailColor: UIColor?
set to false.
*/ /// The lineLayer detail active color.
@IBInspectable public var bottomBorderDetailActiveColor: UIColor? { @IBInspectable public var lineLayerDetailActiveColor: UIColor?
didSet {
if !detailLabelHidden {
MaterialAnimation.animationDisabled { [unowned self] in
self.bottomBorderLayer.backgroundColor = self.bottomBorderDetailActiveColor?.CGColor
}
}
}
}
/** /**
The title UILabel that is displayed when there is text. The The title UILabel that is displayed when there is text. The
titleLabel text value is updated with the placeholder text titleLabel text value is updated with the placeholder text
value before being displayed. value before being displayed.
*/ */
public var titleLabel: UILabel? { @IBInspectable public private(set) var titleLabel: UILabel!
didSet {
prepareTitleLabel()
}
}
/// The color of the titleLabel text when the textField is not active. /// The color of the titleLabel text when the textField is not active.
@IBInspectable public var titleLabelColor: UIColor? { @IBInspectable public var titleLabelColor: UIColor? {
didSet { didSet {
titleLabel?.textColor = titleLabelColor titleLabel.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in if nil == lineLayerColor {
if nil != self.bottomBorderTitleActiveColor { lineLayerColor = titleLabelColor
self.bottomBorderLayer.backgroundColor = self.titleLabelColor?.CGColor
}
} }
} }
} }
/// The color of the titleLabel text when the textField is active. /// The color of the titleLabel text when the textField is active.
@IBInspectable public var titleLabelActiveColor: UIColor? @IBInspectable public var titleLabelActiveColor: UIColor? {
didSet {
if nil == lineLayerActiveColor {
lineLayerActiveColor = titleLabelActiveColor
}
}
}
/** /**
A property that sets the distance between the textField and A property that sets the distance between the textField and
titleLabel. titleLabel.
*/ */
@IBInspectable public var titleLabelAnimationDistance: CGFloat = 8 @IBInspectable public var titleLabelAnimationDistance: CGFloat = 4
/// An override to the text property. /// An override to the text property.
@IBInspectable public override var text: String? { @IBInspectable public override var text: String? {
...@@ -384,10 +332,8 @@ public class TextField : UITextField { ...@@ -384,10 +332,8 @@ public class TextField : UITextField {
didSet { didSet {
if !detailLabelHidden { if !detailLabelHidden {
detailLabel?.textColor = detailLabelActiveColor detailLabel?.textColor = detailLabelActiveColor
MaterialAnimation.animationDisabled { [unowned self] in if nil == lineLayerDetailActiveColor {
if nil != self.bottomBorderDetailActiveColor { lineLayerDetailActiveColor = detailLabelActiveColor
self.bottomBorderLayer.backgroundColor = self.detailLabelActiveColor?.CGColor
}
} }
} }
} }
...@@ -412,32 +358,11 @@ public class TextField : UITextField { ...@@ -412,32 +358,11 @@ public class TextField : UITextField {
didSet { didSet {
if detailLabelHidden { if detailLabelHidden {
detailLabel?.textColor = titleLabelColor detailLabel?.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in lineLayer.backgroundColor = (editing ? lineLayerActiveColor : lineLayerColor)?.CGColor
var activeColor: CGColor? = self.titleLabelActiveColor?.CGColor
var inactiveColor: CGColor? = self.titleLabelColor?.CGColor
if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
activeColor = bottomBorderColor
}
if let bottomBorderColor: CGColor = self.bottomBorderColor?.CGColor {
inactiveColor = bottomBorderColor
}
self.bottomBorderLayer.backgroundColor = self.editing ? activeColor : inactiveColor
}
hideDetailLabel() hideDetailLabel()
} else { } else {
detailLabel?.textColor = detailLabelActiveColor detailLabel?.textColor = detailLabelActiveColor
MaterialAnimation.animationDisabled { [unowned self] in lineLayer.backgroundColor = (nil == lineLayerDetailActiveColor ? detailLabelActiveColor : lineLayerDetailActiveColor)?.CGColor
var activeColor: CGColor? = self.detailLabelActiveColor?.CGColor
if let bottomBorderColor: CGColor = self.bottomBorderDetailActiveColor?.CGColor {
activeColor = bottomBorderColor
}
self.bottomBorderLayer.backgroundColor = activeColor
}
showDetailLabel() showDetailLabel()
} }
} }
...@@ -490,8 +415,7 @@ public class TextField : UITextField { ...@@ -490,8 +415,7 @@ public class TextField : UITextField {
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
super.layoutSublayersOfLayer(layer) super.layoutSublayersOfLayer(layer)
if self.layer == layer { if self.layer == layer {
bottomBorderLayer.frame = CGRectMake(0, bounds.height + bottomBorderLayerDistance, bounds.width, 1) layoutLineLayer()
layoutShape()
layoutShadowPath() layoutShadowPath()
} }
} }
...@@ -560,16 +484,20 @@ public class TextField : UITextField { ...@@ -560,16 +484,20 @@ public class TextField : UITextField {
public func prepareView() { public func prepareView() {
backgroundColor = MaterialColor.white backgroundColor = MaterialColor.white
masksToBounds = false masksToBounds = false
clearButtonMode = .WhileEditing placeholderTextColor = MaterialColor.grey.base
prepareBottomBorderLayer() font = RobotoFont.regularWithSize(16)
textColor = MaterialColor.grey.darken4
borderStyle = .None
prepareClearButton()
prepareTitleLabel()
prepareLineLayer()
reloadView()
} }
/// Reloads the view. /// Reloads the view.
public func reloadView() { public func reloadView() {
/// Prepare the clearButton. /// Align the clearButton.
if let v: UIButton = clearButton { clearButton.frame = CGRectMake(width - height, 0, height, height)
v.frame = CGRectMake(width - height, 0, height, height)
}
} }
...@@ -582,45 +510,20 @@ public class TextField : UITextField { ...@@ -582,45 +510,20 @@ public class TextField : UITextField {
internal func textFieldValueChanged() { internal func textFieldValueChanged() {
if detailLabelAutoHideEnabled && !detailLabelHidden { if detailLabelAutoHideEnabled && !detailLabelHidden {
detailLabelHidden = true detailLabelHidden = true
MaterialAnimation.animationDisabled { [unowned self] in lineLayer.backgroundColor = (nil == lineLayerActiveColor ? titleLabelActiveColor : lineLayerActiveColor)?.CGColor
var activeColor: CGColor? = self.titleLabelActiveColor?.CGColor
if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
activeColor = bottomBorderColor
}
self.bottomBorderLayer.backgroundColor = activeColor
}
} }
} }
/// Handler for text editing began. /// Handler for text editing began.
internal func textFieldDidBegin() { internal func textFieldDidBegin() {
titleLabel?.textColor = titleLabelActiveColor showTitleLabel()
MaterialAnimation.animationDisabled { [unowned self] in titleLabel.textColor = titleLabelActiveColor
var titleActiveColor: CGColor? = self.titleLabelActiveColor?.CGColor lineLayer.frame = CGRectMake(0, bounds.height + lineLayerDistance, bounds.width, 2)
var detailActiveColor: CGColor? = self.detailLabelActiveColor?.CGColor lineLayer.backgroundColor = (detailLabelHidden ? nil == lineLayerActiveColor ? titleLabelActiveColor : lineLayerActiveColor : nil == lineLayerDetailActiveColor ? detailLabelActiveColor : lineLayerDetailActiveColor)?.CGColor
if let bottomBorderColor: CGColor = self.bottomBorderTitleActiveColor?.CGColor {
titleActiveColor = bottomBorderColor
}
if let bottomBorderColor: CGColor = self.bottomBorderDetailActiveColor?.CGColor {
detailActiveColor = bottomBorderColor
}
self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? titleActiveColor : detailActiveColor
}
} }
/// Handler for text changed. /// Handler for text changed.
internal func textFieldDidChange() { internal func textFieldDidChange() {
if 0 < text?.utf16.count {
showTitleLabel()
} else if 0 == text?.utf16.count {
hideTitleLabel()
}
sendActionsForControlEvents(.ValueChanged) sendActionsForControlEvents(.ValueChanged)
} }
...@@ -631,31 +534,9 @@ public class TextField : UITextField { ...@@ -631,31 +534,9 @@ public class TextField : UITextField {
} else if 0 == text?.utf16.count { } else if 0 == text?.utf16.count {
hideTitleLabel() hideTitleLabel()
} }
titleLabel?.textColor = titleLabelColor titleLabel.textColor = titleLabelColor
MaterialAnimation.animationDisabled { [unowned self] in lineLayer.frame = CGRectMake(0, bounds.height + lineLayerDistance, bounds.width, 1)
var borderColor: CGColor? = self.titleLabelColor?.CGColor lineLayer.backgroundColor = (detailLabelHidden ? nil == lineLayerColor ? titleLabelColor : lineLayerColor : nil == lineLayerDetailColor ? detailLabelActiveColor : lineLayerDetailColor)?.CGColor
var detailActiveColor: CGColor? = self.detailLabelActiveColor?.CGColor
if let bottomBorderColor: CGColor = self.bottomBorderColor?.CGColor {
borderColor = bottomBorderColor
}
if let bottomBorderColor: CGColor = self.bottomBorderDetailActiveColor?.CGColor {
detailActiveColor = bottomBorderColor
}
self.bottomBorderLayer.backgroundColor = self.detailLabelHidden ? borderColor : detailActiveColor
}
}
/// Manages the layout for the shape of the view instance.
internal func layoutShape() {
if .Circle == shape {
let w: CGFloat = (width / 2)
if w != cornerRadius {
cornerRadius = w
}
}
} }
/// Sets the shadow path. /// Sets the shadow path.
...@@ -671,23 +552,27 @@ public class TextField : UITextField { ...@@ -671,23 +552,27 @@ public class TextField : UITextField {
} }
} }
/// Prepares the titleLabel property. /// Prepares the titleLabel.
private func prepareTitleLabel() { private func prepareTitleLabel() {
if let v: UILabel = titleLabel { titleLabel = UILabel()
v.hidden = true titleLabel.hidden = true
addSubview(v) titleLabel.font = RobotoFont.mediumWithSize(12)
addSubview(titleLabel)
titleLabelColor = MaterialColor.grey.base
titleLabelActiveColor = MaterialColor.blue.accent3
if 0 < text?.utf16.count { if 0 < text?.utf16.count {
showTitleLabel() showTitleLabel()
} else { } else {
v.alpha = 0 titleLabel.alpha = 0
} }
addTarget(self, action: #selector(textFieldDidBegin), forControlEvents: .EditingDidBegin) addTarget(self, action: #selector(textFieldDidBegin), forControlEvents: .EditingDidBegin)
addTarget(self, action: #selector(textFieldDidChange), forControlEvents: .EditingChanged) addTarget(self, action: #selector(textFieldDidChange), forControlEvents: .EditingChanged)
addTarget(self, action: #selector(textFieldDidEnd), forControlEvents: .EditingDidEnd) addTarget(self, action: #selector(textFieldDidEnd), forControlEvents: .EditingDidEnd)
} }
}
/// Prepares the detailLabel property. /// Prepares the detailLabel.
private func prepareDetailLabel() { private func prepareDetailLabel() {
if let v: UILabel = detailLabel { if let v: UILabel = detailLabel {
v.hidden = true v.hidden = true
...@@ -706,40 +591,62 @@ public class TextField : UITextField { ...@@ -706,40 +591,62 @@ public class TextField : UITextField {
} }
} }
/// Prepares the bottomBorderLayer property. /// Prepares the lineLayer.
private func prepareBottomBorderLayer() { private func prepareLineLayer() {
layer.addSublayer(bottomBorderLayer) layoutLineLayer()
layer.addSublayer(lineLayer)
}
/// Layout the lineLayer.
private func layoutLineLayer() {
let h: CGFloat = 1 < lineLayer.frame.height ? lineLayer.frame.height : 1
lineLayer.frame = CGRectMake(0, bounds.height + lineLayerDistance, bounds.width, h)
}
/// Prepares the clearButton.
private func prepareClearButton() {
let image: UIImage? = MaterialIcon.cm.close
clearButton = FlatButton()
clearButton.contentEdgeInsets = UIEdgeInsetsZero
clearButton.pulseColor = MaterialColor.grey.base
clearButton.pulseScale = false
clearButton.tintColor = MaterialColor.grey.base
clearButton.setImage(image, forState: .Normal)
clearButton.setImage(image, forState: .Highlighted)
clearButtonAutoHandleEnabled = true
clearButtonMode = .Never
rightViewMode = .WhileEditing
rightView = clearButton
} }
/// Shows and animates the titleLabel property. /// Shows and animates the titleLabel property.
private func showTitleLabel() { private func showTitleLabel() {
if let v: UILabel = titleLabel { if titleLabel.hidden {
if v.hidden {
if let s: String = placeholder { if let s: String = placeholder {
if 0 == v.text?.utf16.count || nil == v.text { titleLabel.text = s
v.text = s placeholderText = s
} placeholder = nil
} }
let h: CGFloat = ceil(v.font.lineHeight) let h: CGFloat = ceil(titleLabel.font.lineHeight)
v.frame = CGRectMake(0, -h, bounds.width, h) titleLabel.frame = bounds
v.hidden = false titleLabel.font = font
UIView.animateWithDuration(0.25, animations: { [unowned self] in titleLabel.hidden = false
v.alpha = 1 UIView.animateWithDuration(0.15, animations: { [unowned self] in
v.frame.origin.y -= self.titleLabelAnimationDistance self.titleLabel.alpha = 1
self.titleLabel.transform = CGAffineTransformScale(self.titleLabel.transform, 0.75, 0.75)
self.titleLabel.frame = CGRectMake(0, -(self.titleLabelAnimationDistance + h), self.bounds.width, h)
}) })
} }
} }
}
/// Hides and animates the titleLabel property. /// Hides and animates the titleLabel property.
private func hideTitleLabel() { private func hideTitleLabel() {
if let v: UILabel = titleLabel { UIView.animateWithDuration(0.15, animations: { [unowned self] in
UIView.animateWithDuration(0.25, animations: { [unowned self] in self.titleLabel.transform = CGAffineTransformIdentity
v.alpha = 0 self.titleLabel.frame = self.bounds
v.frame.origin.y += self.titleLabelAnimationDistance }) { [unowned self] _ in
}) { _ in self.placeholder = self.placeholderText
v.hidden = true self.titleLabel.hidden = true
}
} }
} }
...@@ -748,10 +655,10 @@ public class TextField : UITextField { ...@@ -748,10 +655,10 @@ public class TextField : UITextField {
if let v: UILabel = detailLabel { if let v: UILabel = detailLabel {
if v.hidden { if v.hidden {
let h: CGFloat = ceil(v.font.lineHeight) let h: CGFloat = ceil(v.font.lineHeight)
v.frame = CGRectMake(0, bounds.height + bottomBorderLayerDistance, bounds.width, h) v.frame = CGRectMake(0, bounds.height + lineLayerDistance, bounds.width, h)
v.hidden = false v.hidden = false
UIView.animateWithDuration(0.25, animations: { [unowned self] in UIView.animateWithDuration(0.15, animations: { [unowned self] in
v.frame.origin.y = self.frame.height + self.bottomBorderLayerDistance + self.detailLabelAnimationDistance v.frame.origin.y = self.frame.height + self.lineLayerDistance + self.detailLabelAnimationDistance
v.alpha = 1 v.alpha = 1
}) })
} }
...@@ -761,7 +668,7 @@ public class TextField : UITextField { ...@@ -761,7 +668,7 @@ public class TextField : UITextField {
/// Hides and animates the detailLabel property. /// Hides and animates the detailLabel property.
private func hideDetailLabel() { private func hideDetailLabel() {
if let v: UILabel = detailLabel { if let v: UILabel = detailLabel {
UIView.animateWithDuration(0.25, animations: { [unowned self] in UIView.animateWithDuration(0.15, animations: { [unowned self] in
v.alpha = 0 v.alpha = 0
v.frame.origin.y -= self.detailLabelAnimationDistance v.frame.origin.y -= self.detailLabelAnimationDistance
}) { _ in }) { _ in
......
...@@ -76,39 +76,23 @@ public class TextView: UITextView { ...@@ -76,39 +76,23 @@ public class TextView: UITextView {
} }
} }
/** /// A property that accesses the layer.frame.size.width property.
A property that accesses the layer.frame.origin.width property.
When setting this property in conjunction with the shape property having a
value that is not .None, the height will be adjusted to maintain the correct
shape.
*/
@IBInspectable public var width: CGFloat { @IBInspectable public var width: CGFloat {
get { get {
return layer.frame.size.width return layer.frame.size.width
} }
set(value) { set(value) {
layer.frame.size.width = value layer.frame.size.width = value
if .None != shape {
layer.frame.size.height = value
}
} }
} }
/** /// A property that accesses the layer.frame.size.height property.
A property that accesses the layer.frame.origin.height property.
When setting this property in conjunction with the shape property having a
value that is not .None, the width will be adjusted to maintain the correct
shape.
*/
@IBInspectable public var height: CGFloat { @IBInspectable public var height: CGFloat {
get { get {
return layer.frame.size.height return layer.frame.size.height
} }
set(value) { set(value) {
layer.frame.size.height = value layer.frame.size.height = value
if .None != shape {
layer.frame.size.width = value
}
} }
} }
...@@ -185,11 +169,7 @@ public class TextView: UITextView { ...@@ -185,11 +169,7 @@ public class TextView: UITextView {
} }
} }
/** /// A property that sets the cornerRadius of the backing layer.
A property that sets the cornerRadius of the backing layer. If the shape
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadiusPreset: MaterialRadius = .None { public var cornerRadiusPreset: MaterialRadius = .None {
didSet { didSet {
if let v: MaterialRadius = cornerRadiusPreset { if let v: MaterialRadius = cornerRadiusPreset {
...@@ -206,27 +186,6 @@ public class TextView: UITextView { ...@@ -206,27 +186,6 @@ public class TextView: UITextView {
set(value) { set(value) {
layer.cornerRadius = value layer.cornerRadius = value
layoutShadowPath() layoutShadowPath()
if .Circle == shape {
shape = .None
}
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
to maintain the shape of the object.
*/
public var shape: MaterialShape = .None {
didSet {
if .None != shape {
if width < height {
frame.size.width = height
} else {
frame.size.height = width
}
layoutShadowPath()
}
} }
} }
...@@ -389,7 +348,6 @@ public class TextView: UITextView { ...@@ -389,7 +348,6 @@ public class TextView: UITextView {
public override func layoutSublayersOfLayer(layer: CALayer) { public override func layoutSublayersOfLayer(layer: CALayer) {
super.layoutSublayersOfLayer(layer) super.layoutSublayersOfLayer(layer)
if self.layer == layer { if self.layer == layer {
layoutShape()
layoutShadowPath() layoutShadowPath()
} }
} }
...@@ -489,16 +447,6 @@ public class TextView: UITextView { ...@@ -489,16 +447,6 @@ public class TextView: UITextView {
titleLabel?.textColor = titleLabelColor titleLabel?.textColor = titleLabelColor
} }
/// Manages the layout for the shape of the view instance.
internal func layoutShape() {
if .Circle == shape {
let w: CGFloat = (width / 2)
if w != cornerRadius {
cornerRadius = w
}
}
}
/// Sets the shadow path. /// Sets the shadow path.
internal func layoutShadowPath() { internal func layoutShadowPath() {
if shadowPathAutoSizeEnabled { if shadowPathAutoSizeEnabled {
......
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