Commit 33250430 by Daniel Dahan

fixed merge conlicts for release

parents 813b1503 5d94bb37

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

/*
* 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.
*/
/*
The following is an example of using a MenuController to control the
flow of your application.
*/
import UIKit
import Material
class AppBottomNavigationController: BottomNavigationController {
/// NavigationBar menu button.
private var menuButton: IconButton!
/// NavigationBar switch control.
private var switchControl: MaterialSwitch!
/// NavigationBar search button.
private var searchButton: IconButton!
override func prepareView() {
super.prepareView()
prepareMenuButton()
prepareSwitchControl()
prepareSearchButton()
prepareNavigationItem()
prepareViewControllers()
prepareTabBar()
}
/// Handles the menuButton.
internal func handleMenuButton() {
navigationDrawerController?.openLeftView()
}
/// Handles the searchButton.
internal func handleSearchButton() {
let recommended: Array<MaterialDataSourceItem> = Array<MaterialDataSourceItem>()
let vc: AppSearchBarController = AppSearchBarController(rootViewController: RecommendationViewController(dataSourceItems: recommended))
vc.modalTransitionStyle = .CrossDissolve
presentViewController(vc, animated: true, completion: nil)
}
/// Prepares the menuButton.
private func prepareMenuButton() {
let image: UIImage? = MaterialIcon.cm.menu
menuButton = IconButton()
menuButton.pulseColor = MaterialColor.white
menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted)
menuButton.addTarget(self, action: #selector(handleMenuButton), forControlEvents: .TouchUpInside)
}
/// Prepares the switchControl.
private func prepareSwitchControl() {
switchControl = MaterialSwitch(state: .Off, style: .LightContent, size: .Small)
}
/// Prepares the searchButton.
private func prepareSearchButton() {
let image: UIImage? = MaterialIcon.cm.search
searchButton = IconButton()
searchButton.pulseColor = MaterialColor.white
searchButton.setImage(image, forState: .Normal)
searchButton.setImage(image, forState: .Highlighted)
searchButton.addTarget(self, action: #selector(handleSearchButton), forControlEvents: .TouchUpInside)
}
/// Prepares the navigationItem.
private func prepareNavigationItem() {
navigationItem.title = "Recipes"
navigationItem.titleLabel.textAlignment = .Left
navigationItem.titleLabel.textColor = MaterialColor.white
navigationItem.titleLabel.font = RobotoFont.mediumWithSize(20)
navigationItem.leftControls = [menuButton]
navigationItem.rightControls = [switchControl, searchButton]
}
/// Prepares the view controllers.
private func prepareViewControllers() {
viewControllers = [RecipesViewController(), VideoViewController(), PhotoViewController()]
selectedIndex = 0
}
/// Prepares the tabBar.
private func prepareTabBar() {
tabBar.tintColor = MaterialColor.white
tabBar.backgroundColor = MaterialColor.grey.darken4
}
}
/*
* 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.
*/
/*
The following is an example of setting a UITableView as the LeftViewController
within a NavigationDrawerController.
*/
import UIKit
import Material
private struct Item {
var text: String
var imageName: String
}
class AppLeftViewController: UIViewController {
/// A tableView used to display navigation items.
private let tableView: UITableView = UITableView()
/// A list of all the navigation items.
private var items: Array<Item> = Array<Item>()
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareCells()
prepareTableView()
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
/*
The dimensions of the view will not be updated by the side navigation
until the view appears, so loading a dyanimc width is better done here.
The user will not see this, as it is hidden, by the drawer being closed
when launching the app. There are other strategies to mitigate from this.
This is one approach that works nicely here.
*/
prepareProfileView()
}
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.grey.darken4
}
/// Prepares the items that are displayed within the tableView.
private func prepareCells() {
items.append(Item(text: "Feed", imageName: "ic_today"))
items.append(Item(text: "Recipes", imageName: "ic_inbox"))
}
/// Prepares profile view.
private func prepareProfileView() {
let backgroundView: MaterialView = MaterialView()
backgroundView.image = UIImage(named: "MaterialBackground")
let profileView: MaterialView = MaterialView()
profileView.image = UIImage(named: "Profile9")?.resize(toWidth: 72)
profileView.backgroundColor = MaterialColor.clear
profileView.shape = .Circle
profileView.borderColor = MaterialColor.white
profileView.borderWidth = 3
let nameLabel: UILabel = UILabel()
nameLabel.text = "Michael Smith"
nameLabel.textColor = MaterialColor.white
nameLabel.font = RobotoFont.mediumWithSize(18)
view.layout(profileView).width(72).height(72).top(30).centerHorizontally()
view.layout(nameLabel).top(130).left(20).right(20)
}
/// Prepares the tableView.
private func prepareTableView() {
tableView.registerClass(MaterialTableViewCell.self, forCellReuseIdentifier: "MaterialTableViewCell")
tableView.backgroundColor = MaterialColor.clear
tableView.dataSource = self
tableView.delegate = self
tableView.separatorStyle = .None
// Use Layout to easily align the tableView.
view.layout(tableView).edges(top: 170)
}
}
/// TableViewDataSource methods.
extension AppLeftViewController: UITableViewDataSource {
/// Determines the number of rows in the tableView.
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count;
}
/// Prepares the cells within the tableView.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: MaterialTableViewCell = tableView.dequeueReusableCellWithIdentifier("MaterialTableViewCell", forIndexPath: indexPath) as! MaterialTableViewCell
let item: Item = items[indexPath.row]
cell.textLabel!.text = item.text
cell.textLabel!.textColor = MaterialColor.grey.lighten2
cell.textLabel!.font = RobotoFont.medium
cell.imageView!.image = UIImage(named: item.imageName)?.imageWithRenderingMode(.AlwaysTemplate)
cell.imageView!.tintColor = MaterialColor.grey.lighten2
cell.backgroundColor = MaterialColor.clear
return cell
}
}
/// UITableViewDelegate methods.
extension AppLeftViewController: UITableViewDelegate {
/// Sets the tableView cell height.
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 64
}
/// Select item at row in tableView.
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
// print("Selected")
}
}
/*
* 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.
*/
/*
The following is an example of using a MenuController to control the
flow of your application.
*/
import UIKit
import Material
class AppMenuController: MenuController {
/// MenuView diameter.
private let baseSize: CGSize = CGSizeMake(56, 56)
/// MenuView bottom inset.
private let menuViewBottomInset: CGFloat = 65
/// MenuView right inset.
private let menuViewRightInset: CGFloat = 16
/// Reference if the menuView is hidden.
private(set) var isMenuViewHidden: Bool = false
override func viewDidLoad() {
super.viewDidLoad()
prepareMenuView()
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
closeMenu()
}
override func openMenu(completion: (() -> Void)? = nil) {
super.openMenu(completion)
navigationDrawerController?.enabled = false
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 45))
}
override func closeMenu(completion: (() -> Void)? = nil) {
super.closeMenu(completion)
navigationDrawerController?.enabled = true
(menuView.menu.views?.first as? MaterialButton)?.animate(MaterialAnimation.rotate(angle: 0))
}
/// Handler for blue button.
func handleBlueButton() {
closeMenu()
}
/// Handler for green button.
func handleGreenButton() {
closeMenu()
}
/// Handler for yellow button.
func handleYellowButton() {
closeMenu()
}
/// Handle the menuView touch event.
func handleMenu() {
if menuView.menu.opened {
closeMenu()
} else {
openMenu()
}
}
/// Shows the menuView.
func showMenuView() {
if isMenuViewHidden {
isMenuViewHidden = false
menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(0)
]))
}
}
/// Hides the menuView.
func hideMenuView() {
if !isMenuViewHidden {
isMenuViewHidden = true
menuView.animate(MaterialAnimation.animationGroup([
MaterialAnimation.rotate(rotation: 3),
MaterialAnimation.translateY(150)
]))
}
}
/// Prepares the menuView.
private func prepareMenuView() {
var image: UIImage? = MaterialIcon.cm.add
let menuButton: FabButton = FabButton()
menuButton.tintColor = MaterialColor.white
menuButton.setImage(image, forState: .Normal)
menuButton.setImage(image, forState: .Highlighted)
menuButton.addTarget(self, action: #selector(handleMenu), forControlEvents: .TouchUpInside)
menuView.addSubview(menuButton)
image = MaterialIcon.cm.pen
let blueButton: FabButton = FabButton()
blueButton.tintColor = MaterialColor.white
blueButton.backgroundColor = MaterialColor.blue.base
blueButton.setImage(image, forState: .Normal)
blueButton.setImage(image, forState: .Highlighted)
menuView.addSubview(blueButton)
blueButton.addTarget(self, action: #selector(handleBlueButton), forControlEvents: .TouchUpInside)
image = MaterialIcon.cm.photoCamera
let greenButton: FabButton = FabButton()
greenButton.tintColor = MaterialColor.white
greenButton.backgroundColor = MaterialColor.green.base
greenButton.setImage(image, forState: .Normal)
greenButton.setImage(image, forState: .Highlighted)
menuView.addSubview(greenButton)
greenButton.addTarget(self, action: #selector(handleGreenButton), forControlEvents: .TouchUpInside)
image = MaterialIcon.cm.star
let yellowButton: FabButton = FabButton()
yellowButton.tintColor = MaterialColor.white
yellowButton.backgroundColor = MaterialColor.yellow.base
yellowButton.setImage(image, forState: .Normal)
yellowButton.setImage(image, forState: .Highlighted)
menuView.addSubview(yellowButton)
yellowButton.addTarget(self, action: #selector(handleYellowButton), forControlEvents: .TouchUpInside)
// Initialize the menu and setup the configuration options.
menuView.menu.baseSize = baseSize
menuView.menu.views = [menuButton, blueButton, greenButton, yellowButton]
menuView.delegate = self
view.layout(menuView)
.width(baseSize.width)
.height(baseSize.height)
.bottom(menuViewBottomInset)
.right(menuViewRightInset)
}
}
/// MenuViewDelegate.
extension AppMenuController: MenuViewDelegate {
func menuViewDidTapOutside(menuView: MenuView) {
closeMenu()
}
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_book.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_book_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_book_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_contacts.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_contacts_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_contacts_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_inbox.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_inbox_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_inbox_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_settings.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_settings_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_settings_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_today.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_today_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_today_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic_work.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_work_2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_work_3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
/*
* 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 ItemViewController: UIViewController {
/// MaterialDataSourceItem.
private var dataSource: MaterialDataSourceItem!
/// ImageCardView to display item.
private var imageCardView: ImageCardView!
/// NavigationBar title label.
private var titleLabel: UILabel!
/// NavigationBar detail label.
private var detailLabel: UILabel!
/// NavigationBar share button.
private var shareButton: IconButton!
/// MaterialScrollView.
private var scrollView: UIScrollView!
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
convenience init(dataSource: MaterialDataSourceItem) {
self.init(nibName: nil, bundle: nil)
self.dataSource = dataSource
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareShareButton()
prepareNavigationItem()
prepareScrollView()
prepareImageCardView()
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationDrawerController?.enabled = false
(menuController as? AppMenuController)?.hideMenuView()
}
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
scrollView.frame = view.bounds
scrollView.removeConstraints(scrollView.constraints)
scrollView.layout(imageCardView).width(scrollView.bounds.width)
imageCardView.layoutIfNeeded()
scrollView.contentSize = CGSizeMake(view.bounds.width, imageCardView.height)
imageCardView.reloadView()
imageCardView.contentsGravityPreset = .ResizeAspectFill
imageCardView.titleLabelInset.top = imageCardView.imageLayer!.frame.height
}
private func prepareView() {
view.backgroundColor = MaterialColor.white
automaticallyAdjustsScrollViewInsets = false
}
/// Prepares the shareButton.
private func prepareShareButton() {
let image: UIImage? = MaterialIcon.cm.share
shareButton = IconButton()
shareButton.pulseColor = MaterialColor.white
shareButton.setImage(image, forState: .Normal)
shareButton.setImage(image, forState: .Highlighted)
}
/// Prepares the navigationItem.
private func prepareNavigationItem() {
navigationItem.title = "Item"
navigationItem.titleLabel.textAlignment = .Left
navigationItem.titleLabel.textColor = MaterialColor.white
navigationItem.detail = "January 22, 2016"
navigationItem.detailLabel.textAlignment = .Left
navigationItem.detailLabel.textColor = MaterialColor.white
navigationItem.rightControls = [shareButton]
}
/// Prepares the scrollView.
private func prepareScrollView() {
scrollView = UIScrollView(frame: view.bounds)
view.addSubview(scrollView)
}
/// Prepares the imageCardView.
private func prepareImageCardView() {
if let data: Dictionary<String, AnyObject> = dataSource.data as? Dictionary<String, AnyObject> {
imageCardView = ImageCardView()
imageCardView.pulseAnimation = .None
imageCardView.divider = false
imageCardView.depth = .None
imageCardView.contentInsetPreset = .Square3
imageCardView.cornerRadiusPreset = .None
imageCardView.maxImageHeight = 300
imageCardView.titleLabel = UILabel()
imageCardView.titleLabel?.text = data["title"] as? String
imageCardView.titleLabel?.textColor = MaterialColor.grey.darken4
imageCardView.titleLabel?.font = RobotoFont.regularWithSize(20)
let detailLabel: UILabel = UILabel()
detailLabel.text = data["detail"] as? String
detailLabel.textColor = MaterialColor.grey.darken2
detailLabel.font = RobotoFont.regular
detailLabel.numberOfLines = 0
imageCardView.contentView = detailLabel
imageCardView.contentViewInset.top = 52
let image: UIImage? = UIImage(named: data["image"] as! String)
imageCardView.image = image
scrollView.addSubview(imageCardView)
imageCardView.translatesAutoresizingMaskIntoConstraints = 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
import Material
class RecommendationViewController: UIViewController {
/// A list of all the data source items.
private var dataSourceItems: Array<MaterialDataSourceItem>!
/// A tableView used to display Bond entries.
private var tableView: UITableView!
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
convenience init(dataSourceItems: Array<MaterialDataSourceItem>) {
self.init(nibName: nil, bundle: nil)
self.dataSourceItems = dataSourceItems
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareTableView()
}
/// Prepares view.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/// Prepares the tableView.
private func prepareTableView() {
tableView = UITableView()
tableView.registerClass(MaterialTableViewCell.self, forCellReuseIdentifier: "MaterialTableViewCell")
tableView.dataSource = self
tableView.delegate = self
// Use Layout to easily align the tableView.
view.layout(tableView).edges()
}
}
/// TableViewDataSource methods.
extension RecommendationViewController: UITableViewDataSource {
/// Determines the number of rows in the tableView.
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dataSourceItems.count;
}
/// Returns the number of sections.
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
/// Prepares the cells within the tableView.
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: MaterialTableViewCell = MaterialTableViewCell(style: .Subtitle, reuseIdentifier: "MaterialTableViewCell")
let item: MaterialDataSourceItem = dataSourceItems[indexPath.row]
if let data: Dictionary<String, AnyObject> = item.data as? Dictionary<String, AnyObject> {
cell.selectionStyle = .None
cell.textLabel?.text = data["title"] as? String
cell.textLabel?.font = RobotoFont.regular
cell.detailTextLabel?.text = data["detail"] as? String
cell.detailTextLabel?.font = RobotoFont.regular
cell.detailTextLabel?.textColor = MaterialColor.grey.darken1
cell.imageView?.layer.cornerRadius = 32
cell.imageView?.image = UIImage(named: data["image"] as! String)?.crop(toWidth: 64, toHeight: 64)
}
return cell
}
/// Prepares the header within the tableView.
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let header = UIView(frame: CGRectMake(0, 0, view.bounds.width, 48))
header.backgroundColor = MaterialColor.white
let label: UILabel = UILabel()
label.font = RobotoFont.medium
label.textColor = MaterialColor.grey.darken1
label.text = "Recommendations"
header.layout(label).edges(left: 24)
return header
}
}
/// UITableViewDelegate methods.
extension RecommendationViewController: UITableViewDelegate {
/// Sets the tableView cell height.
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return 80
}
/// Sets the tableView header height.
func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 48
}
}
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:App.xcodeproj"> location = "self:Bar.xcodeproj">
</FileRef> </FileRef>
</Workspace> </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 CosmicMind 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 applicationDidFinishLaunching(_ application: UIApplication) {
window = UIWindow(frame: Device.bounds)
window!.rootViewController = ViewController()
window!.makeKeyAndVisible()
}
}
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?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="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
......
/*
* 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 CosmicMind 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 {
/// A reference to the Bar.
private var bar: Bar!
/// Left buttons.
private var menuButton: IconButton!
/// Right buttons.
private var favoriteButton: IconButton!
private var shareButton: IconButton!
/// Title label.
private var titleLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.white
prepareMenuButton()
prepareFavoriteButton()
prepareShareButton()
prepareBar()
}
private func prepareMenuButton() {
menuButton = IconButton(image: Icon.cm.menu, tintColor: Color.white)
menuButton.pulseColor = Color.white
}
private func prepareFavoriteButton() {
favoriteButton = IconButton(image: Icon.favorite, tintColor: Color.white)
favoriteButton.pulseColor = Color.white
}
private func prepareShareButton() {
shareButton = IconButton(image: Icon.cm.share, tintColor: Color.white)
shareButton.pulseColor = Color.white
}
private func prepareBar() {
bar = Bar()
bar.backgroundColor = Color.blue.base
bar.contentView.cornerRadiusPreset = .cornerRadius1
bar.contentView.backgroundColor = Color.blue.lighten3
bar.leftViews = [menuButton]
bar.rightViews = [favoriteButton, shareButton]
view.layout(bar).horizontally().center()
}
}
/*
* 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 CosmicMind 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 AppBottomNavigationController: BottomNavigationController {
open override func prepare() {
super.prepare()
prepareTabBar()
}
private func prepareTabBar() {
tabBar.depthPreset = .none
tabBar.dividerColor = Color.grey.lighten3
}
}
/* /*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>. * Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, this * * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. * list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* * Neither the name of Material nor the names of its * * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from * contributors may be used to endorse or promote products derived from
* this software without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * 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 * 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. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
import UIKit import UIKit
import Material import Material
@UIApplicationMain @UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegate { class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow? var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func applicationDidFinishLaunching(_ application: UIApplication) {
let bottomNavigationController: BottomNavigationController = BottomNavigationController() window = UIWindow(frame: Device.bounds)
bottomNavigationController.viewControllers = [VideoViewController(), PhotoViewController(), LibraryViewController()] window!.rootViewController = AppBottomNavigationController(viewControllers: [PhotoViewController(), VideoViewController(), AudioViewController(), RemindersViewController(), SearchViewController()])
bottomNavigationController.selectedIndex = 0 window!.makeKeyAndVisible()
bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base }
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = bottomNavigationController
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" : [ "images" : [
{ {
"size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-29@2x-1.png", "size" : "29x29",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "29x29",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-29@3x.png", "size" : "29x29",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-40@2x-1.png", "size" : "40x40",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-40@3x.png", "size" : "40x40",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-60@2x.png", "size" : "60x60",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "60x60",
"idiom" : "iphone", "idiom" : "iphone",
"filename" : "MaterialColorsAppIcon_Icon-60@3x.png", "size" : "60x60",
"scale" : "3x" "scale" : "3x"
}, },
{ {
"size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-29.png", "size" : "29x29",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "29x29",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-29@2x.png", "size" : "29x29",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-40.png", "size" : "40x40",
"scale" : "1x" "scale" : "1x"
}, },
{ {
"size" : "40x40",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-40@2x.png", "size" : "40x40",
"scale" : "2x" "scale" : "2x"
}, },
{ {
"size" : "76x76",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76", "size" : "76x76",
"idiom" : "ipad", "scale" : "1x"
"filename" : "MaterialColorsAppIcon_Icon-76@2x.png",
"scale" : "2x"
}, },
{ {
"size" : "83.5x83.5",
"idiom" : "ipad", "idiom" : "ipad",
"filename" : "MaterialColorsAppIcon_Icon-83.5@2x.png", "size" : "76x76",
"scale" : "2x" "scale" : "2x"
} }
], ],
......
/*
* 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 CosmicMind 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 AudioViewController: UIViewController {
convenience init() {
self.init(nibName: nil, bundle: nil)
prepareTabBarItem()
}
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.audioLibrary?.tintWithColor(color: Color.blueGrey.base)?.withRenderingMode(.alwaysOriginal)
tabBarItem.selectedImage = Icon.cm.audioLibrary?.tintWithColor(color: Color.blue.base)?.withRenderingMode(.alwaysOriginal)
}
open override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.blue.base
}
}
<?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="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<scenes> <scenes>
<!--View Controller--> <!--View Controller-->
...@@ -13,10 +14,9 @@ ...@@ -13,10 +14,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view> </view>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
...@@ -33,6 +31,7 @@ ...@@ -33,6 +31,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>
......
/* /*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>. * Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, this * * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. * list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* * Neither the name of Material nor the names of its * * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from * contributors may be used to endorse or promote products derived from
* this software without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * 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 * 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. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
import UIKit import UIKit
import Material import Material
class PhotoViewController: UIViewController { class PhotoViewController: UIViewController {
required init?(coder aDecoder: NSCoder) { convenience init() {
super.init(coder: aDecoder) self.init(nibName: nil, bundle: nil)
} prepareTabBarItem()
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) /// Prepare tabBarItem.
} private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.photoCamera?.tintWithColor(color: Color.blueGrey.base)?.withRenderingMode(.alwaysOriginal)
init() { tabBarItem.selectedImage = Icon.cm.photoCamera?.tintWithColor(color: Color.blue.base)?.withRenderingMode(.alwaysOriginal)
super.init(nibName: nil, bundle: nil) }
prepareTabBarItem()
} open override func viewDidLoad() {
super.viewDidLoad()
override func viewDidLoad() { view.backgroundColor = Color.red.base
super.viewDidLoad() }
prepareView()
}
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.green.base
}
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.title = "Photo"
tabBarItem.image = MaterialIcon.cm.photoCamera
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
}
} }
/*
* 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 CosmicMind 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 RemindersViewController: UIViewController {
convenience init() {
self.init(nibName: nil, bundle: nil)
prepareTabBarItem()
}
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.bell?.tintWithColor(color: Color.blueGrey.base)?.withRenderingMode(.alwaysOriginal)
tabBarItem.selectedImage = Icon.cm.bell?.tintWithColor(color: Color.blue.base)?.withRenderingMode(.alwaysOriginal)
}
open override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.yellow.base
}
}
/*
* 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 CosmicMind 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 SearchViewController: UIViewController {
convenience init() {
self.init(nibName: nil, bundle: nil)
prepareTabBarItem()
}
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.search?.tintWithColor(color: Color.blueGrey.base)?.withRenderingMode(.alwaysOriginal)
tabBarItem.selectedImage = Icon.cm.search?.tintWithColor(color: Color.blue.base)?.withRenderingMode(.alwaysOriginal)
}
open override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.blueGrey.base
}
}
/* /*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>. * Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* * Redistributions of source code must retain the above copyright notice, this * * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer. * list of conditions and the following disclaimer.
* *
* * Redistributions in binary form must reproduce the above copyright notice, * * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* * Neither the name of Material nor the names of its * * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from * contributors may be used to endorse or promote products derived from
* this software without specific prior written permission. * this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * 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 * 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. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
import UIKit import UIKit
import Material import Material
class VideoViewController: UIViewController { class VideoViewController: UIViewController {
required init?(coder aDecoder: NSCoder) { convenience init() {
super.init(coder: aDecoder) self.init(nibName: nil, bundle: nil)
} prepareTabBarItem()
}
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) /// Prepare tabBarItem.
} private func prepareTabBarItem() {
tabBarItem.image = Icon.cm.videocam?.tintWithColor(color: Color.blueGrey.base)?.withRenderingMode(.alwaysOriginal)
init() { tabBarItem.selectedImage = Icon.cm.videocam?.tintWithColor(color: Color.blue.base)?.withRenderingMode(.alwaysOriginal)
super.init(nibName: nil, bundle: nil) }
prepareTabBarItem()
} open override func viewDidLoad() {
super.viewDidLoad()
override func viewDidLoad() { view.backgroundColor = Color.green.base
super.viewDidLoad() }
prepareView()
}
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.yellow.base
}
/// Prepare tabBarItem.
private func prepareTabBarItem() {
tabBarItem.title = "Video"
tabBarItem.image = MaterialIcon.cm.videocam
tabBarItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
tabBarItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
}
} }
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "self:BottomNavigationBar.xcodeproj"> location = "self:Button.xcodeproj">
</FileRef> </FileRef>
</Workspace> </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 CosmicMind 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 applicationDidFinishLaunching(_ application: UIApplication) {
window = UIWindow(frame: Device.bounds)
window!.rootViewController = ViewController()
window!.makeKeyAndVisible()
}
}
This image diff could not be displayed because it is too large. You can view the blob instead.
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