Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
63ce6b94
Unverified
Commit
63ce6b94
authored
Oct 11, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: progression commit for HeightPreset and Bar height updates
parent
5c2d849d
Show whitespace changes
Inline
Side-by-side
Showing
77 changed files
with
305 additions
and
217 deletions
+305
-217
Examples/Programmatic/Bar/Bar/ViewController.swift
+5
-2
Examples/Programmatic/BottomNavigationController/BottomNavigationController/AppBottomNavigationController.swift
+1
-1
Examples/Programmatic/BottomNavigationController/BottomNavigationController/AudioViewController.swift
+3
-3
Examples/Programmatic/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
+3
-3
Examples/Programmatic/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
+3
-3
Examples/Programmatic/BottomNavigationController/BottomNavigationController/SearchViewController.swift
+3
-3
Examples/Programmatic/BottomNavigationController/BottomNavigationController/VideoViewController.swift
+3
-3
Examples/Programmatic/Button/Button/ViewController.swift
+5
-4
Examples/Programmatic/CaptureController/CaptureController/AppCaptureController.swift
+2
-2
Examples/Programmatic/CaptureController/CaptureController/ViewController.swift
+1
-1
Examples/Programmatic/Card/Card/ViewController.swift
+5
-5
Examples/Programmatic/ImageCard/ImageCard/ViewController.swift
+7
-7
Examples/Programmatic/Layer/Layer/ViewController.swift
+2
-2
Examples/Programmatic/MenuController/MenuController/AppMenuController.swift
+1
-1
Examples/Programmatic/MenuController/MenuController/RootViewController.swift
+4
-4
Examples/Programmatic/NavigationController/NavigationController/AppNavigationController.swift
+5
-1
Examples/Programmatic/NavigationController/NavigationController/NextViewController.swift
+4
-4
Examples/Programmatic/NavigationController/NavigationController/RootViewController.swift
+9
-6
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
+2
-2
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
+2
-2
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RootViewController.swift
+1
-1
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/TransitionedViewController.swift
+1
-1
Examples/Programmatic/PageTabBarController/PageTabBarController/AppPageTabBarController.swift
+2
-2
Examples/Programmatic/PageTabBarController/PageTabBarController/BlueViewController.swift
+2
-2
Examples/Programmatic/PageTabBarController/PageTabBarController/GreenViewController.swift
+2
-2
Examples/Programmatic/PageTabBarController/PageTabBarController/RedViewController.swift
+2
-2
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/AppToolbarController.swift
+1
-1
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/PhotoLibraryCollectionViewCell.swift
+1
-1
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/PhotoLibraryViewController.swift
+1
-1
Examples/Programmatic/PresenterCard/PresenterCard/ViewController.swift
+6
-6
Examples/Programmatic/SearchBarController/SearchBarController/RootViewController.swift
+1
-1
Examples/Programmatic/SnackbarController/SnackbarController/RootViewController.swift
+2
-2
Examples/Programmatic/StatusBarController/StatusBarController/RootViewController.swift
+1
-1
Examples/Programmatic/Switch/Switch/ViewController.swift
+1
-1
Examples/Programmatic/TabBar/TabBar/ViewController.swift
+7
-7
Examples/Programmatic/TextField/TextField/ViewController.swift
+3
-3
Examples/Programmatic/ToolbarController/ToolbarController/AppToolbarController.swift
+2
-0
Examples/Programmatic/ToolbarController/ToolbarController/RootViewController.swift
+1
-1
Examples/Programmatic/View/View/ViewController.swift
+2
-2
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AudioViewController.swift
+2
-2
Examples/Storyboards/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
+2
-2
Examples/Storyboards/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
+2
-2
Examples/Storyboards/BottomNavigationController/BottomNavigationController/SearchViewController.swift
+2
-2
Examples/Storyboards/BottomNavigationController/BottomNavigationController/VideoViewController.swift
+3
-3
Examples/Storyboards/Button/Button/ViewController.swift
+1
-1
Examples/Storyboards/NavigationController/NavigationController/NextViewController.swift
+2
-2
Examples/Storyboards/NavigationController/NavigationController/RootViewController.swift
+1
-1
Examples/Storyboards/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
+1
-1
Examples/Storyboards/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
+1
-1
Examples/Storyboards/PageTabBarController/PageTabBarController/AppPageTabBarController.swift
+1
-1
Examples/Storyboards/PageTabBarController/PageTabBarController/BlueViewController.swift
+2
-2
Examples/Storyboards/PageTabBarController/PageTabBarController/GreenViewController.swift
+2
-2
Examples/Storyboards/PageTabBarController/PageTabBarController/RedViewController.swift
+2
-2
Examples/Storyboards/SearchBarController/SearchBarController/RootViewController.swift
+1
-1
Examples/Storyboards/SnackbarController/SnackbarController/RootViewController.swift
+2
-2
Examples/Storyboards/StatusBarController/StatusBarController/RootViewController.swift
+1
-1
Material.xcodeproj/project.pbxproj
+12
-0
Sources/iOS/Bar.swift
+13
-9
Sources/iOS/BottomNavigationController.swift
+1
-0
Sources/iOS/BottomTabBar.swift
+5
-0
Sources/iOS/Button.swift
+2
-2
Sources/iOS/Color.swift
+8
-8
Sources/iOS/Divider.swift
+1
-1
Sources/iOS/Grid.swift
+21
-0
Sources/iOS/HeightPreset.swift
+43
-0
Sources/iOS/Material+CALayer.swift
+19
-10
Sources/iOS/Material+UIImage.swift
+3
-3
Sources/iOS/Material+UIView.swift
+10
-0
Sources/iOS/NavigationBar.swift
+5
-24
Sources/iOS/NavigationItem.swift
+3
-0
Sources/iOS/PageTabBarController.swift
+2
-2
Sources/iOS/Pulse.swift
+2
-2
Sources/iOS/SearchBarController.swift
+3
-3
Sources/iOS/SnackbarController.swift
+1
-1
Sources/iOS/TabBar.swift
+1
-4
Sources/iOS/ToolbarController.swift
+4
-6
Sources/macOS/Color.swift
+9
-18
No files found.
Examples/Programmatic/Bar/Bar/ViewController.swift
View file @
63ce6b94
...
@@ -57,22 +57,25 @@ class ViewController: UIViewController {
...
@@ -57,22 +57,25 @@ class ViewController: UIViewController {
private
func
prepareMenuButton
()
{
private
func
prepareMenuButton
()
{
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
,
tintColor
:
.
white
)
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
,
tintColor
:
.
white
)
menuButton
.
pulseColor
=
.
white
}
}
private
func
prepareFavoriteButton
()
{
private
func
prepareFavoriteButton
()
{
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
.
white
)
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
.
white
)
favoriteButton
.
pulseColor
=
.
white
}
}
private
func
prepareShareButton
()
{
private
func
prepareShareButton
()
{
shareButton
=
IconButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
.
white
)
shareButton
=
IconButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
.
white
)
shareButton
.
pulseColor
=
.
white
}
}
private
func
prepareBar
()
{
private
func
prepareBar
()
{
bar
=
Bar
(
leftViews
:
[
menuButton
],
rightViews
:
[
favoriteButton
,
shareButton
])
bar
=
Bar
(
leftViews
:
[
menuButton
],
rightViews
:
[
favoriteButton
,
shareButton
])
bar
.
backgroundColor
=
.
blue
.
base
bar
.
backgroundColor
=
Color
.
blue
.
base
bar
.
contentView
.
cornerRadiusPreset
=
.
cornerRadius1
bar
.
contentView
.
cornerRadiusPreset
=
.
cornerRadius1
bar
.
contentView
.
backgroundColor
=
.
blue
.
lighten3
bar
.
contentView
.
backgroundColor
=
Color
.
blue
.
lighten3
view
.
layout
(
bar
)
.
horizontally
()
.
center
()
view
.
layout
(
bar
)
.
horizontally
()
.
center
()
}
}
...
...
Examples/Programmatic/BottomNavigationController/BottomNavigationController/AppBottomNavigationController.swift
View file @
63ce6b94
...
@@ -39,6 +39,6 @@ class AppBottomNavigationController: BottomNavigationController {
...
@@ -39,6 +39,6 @@ class AppBottomNavigationController: BottomNavigationController {
private
func
prepareTabBar
()
{
private
func
prepareTabBar
()
{
tabBar
.
depthPreset
=
.
none
tabBar
.
depthPreset
=
.
none
tabBar
.
dividerColor
=
.
grey
.
lighten3
tabBar
.
dividerColor
=
Color
.
grey
.
lighten3
}
}
}
}
Examples/Programmatic/BottomNavigationController/BottomNavigationController/AudioViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class AudioViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class AudioViewController: UIViewController {
/// Prepare tabBarItem.
/// Prepare tabBarItem.
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
}
}
}
Examples/Programmatic/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class PhotoViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class PhotoViewController: UIViewController {
/// Prepare tabBarItem.
/// Prepare tabBarItem.
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
red
.
base
view
.
backgroundColor
=
Color
.
red
.
base
}
}
}
}
Examples/Programmatic/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class RemindersViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class RemindersViewController: UIViewController {
/// Prepare tabBarItem.
/// Prepare tabBarItem.
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
yellow
.
base
view
.
backgroundColor
=
Color
.
yellow
.
base
}
}
}
}
Examples/Programmatic/BottomNavigationController/BottomNavigationController/SearchViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class SearchViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class SearchViewController: UIViewController {
/// Prepare tabBarItem.
/// Prepare tabBarItem.
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
blueGrey
.
base
view
.
backgroundColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Programmatic/BottomNavigationController/BottomNavigationController/VideoViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
/// Prepare tabBarItem.
/// Prepare tabBarItem.
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
image
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
green
.
base
view
.
backgroundColor
=
Color
.
green
.
base
}
}
}
}
Examples/Programmatic/Button/Button/ViewController.swift
View file @
63ce6b94
...
@@ -58,7 +58,7 @@ struct ButtonLayout {
...
@@ -58,7 +58,7 @@ struct ButtonLayout {
class
ViewController
:
UIViewController
{
class
ViewController
:
UIViewController
{
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareFlatButton
()
prepareFlatButton
()
prepareRaisedButton
()
prepareRaisedButton
()
...
@@ -76,8 +76,9 @@ class ViewController: UIViewController {
...
@@ -76,8 +76,9 @@ class ViewController: UIViewController {
}
}
private
func
prepareRaisedButton
()
{
private
func
prepareRaisedButton
()
{
let
button
=
RaisedButton
(
title
:
"Raised Button"
,
titleColor
:
white
)
let
button
=
RaisedButton
(
title
:
"Raised Button"
,
titleColor
:
.
white
)
button
.
backgroundColor
=
blue
.
base
button
.
pulseColor
=
.
white
button
.
backgroundColor
=
Color
.
blue
.
base
view
.
layout
(
button
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Raised
.
width
)
.
width
(
ButtonLayout
.
Raised
.
width
)
...
@@ -86,7 +87,7 @@ class ViewController: UIViewController {
...
@@ -86,7 +87,7 @@ class ViewController: UIViewController {
}
}
private
func
prepareFabButton
()
{
private
func
prepareFabButton
()
{
let
button
=
FabButton
(
image
:
Icon
.
cm
.
add
,
tintColor
:
white
)
let
button
=
FabButton
(
image
:
Icon
.
cm
.
add
,
tintColor
:
.
white
)
view
.
layout
(
button
)
view
.
layout
(
button
)
.
width
(
ButtonLayout
.
Fab
.
diameter
)
.
width
(
ButtonLayout
.
Fab
.
diameter
)
...
...
Examples/Programmatic/CaptureController/CaptureController/AppCaptureController.swift
View file @
63ce6b94
...
@@ -42,7 +42,7 @@ class AppCaptureController: CaptureController {
...
@@ -42,7 +42,7 @@ class AppCaptureController: CaptureController {
private
func
prepareToolbar
()
{
private
func
prepareToolbar
()
{
toolbar
.
titleLabel
.
isHidden
=
true
toolbar
.
titleLabel
.
isHidden
=
true
toolbar
.
titleLabel
.
textColor
=
white
toolbar
.
titleLabel
.
textColor
=
.
white
toolbar
.
detailLabel
.
isHidden
=
true
toolbar
.
detailLabel
.
isHidden
=
true
toolbar
.
detail
=
"Recording"
toolbar
.
detail
=
"Recording"
...
@@ -56,7 +56,7 @@ class AppCaptureController: CaptureController {
...
@@ -56,7 +56,7 @@ class AppCaptureController: CaptureController {
captureButton
.
width
=
72
captureButton
.
width
=
72
captureButton
.
height
=
72
captureButton
.
height
=
72
captureButton
.
backgroundColor
=
red
.
darken1
.
withAlphaComponent
(
0.3
)
captureButton
.
backgroundColor
=
red
.
darken1
.
withAlphaComponent
(
0.3
)
captureButton
.
borderColor
=
white
captureButton
.
borderColor
=
.
white
captureButton
.
borderWidthPreset
=
.
border3
captureButton
.
borderWidthPreset
=
.
border3
captureButton
.
depthPreset
=
.
none
captureButton
.
depthPreset
=
.
none
}
}
...
...
Examples/Programmatic/CaptureController/CaptureController/ViewController.swift
View file @
63ce6b94
...
@@ -136,7 +136,7 @@ extension ViewController: CaptureDelegate {
...
@@ -136,7 +136,7 @@ extension ViewController: CaptureDelegate {
}
}
public
func
captureDidPressCameraButton
(
capture
:
Capture
,
button
:
UIButton
)
{
public
func
captureDidPressCameraButton
(
capture
:
Capture
,
button
:
UIButton
)
{
// captureButton.backgroundColor = blue.darken1.withAlphaComponent(0.3)
// captureButton.backgroundColor =
Color.
blue.darken1.withAlphaComponent(0.3)
}
}
public
func
captureDidPressVideoButton
(
capture
:
Capture
,
button
:
UIButton
)
{
public
func
captureDidPressVideoButton
(
capture
:
Capture
,
button
:
UIButton
)
{
...
...
Examples/Programmatic/Card/Card/ViewController.swift
View file @
63ce6b94
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareDateFormatter
()
prepareDateFormatter
()
prepareDateLabel
()
prepareDateLabel
()
...
@@ -71,16 +71,16 @@ class ViewController: UIViewController {
...
@@ -71,16 +71,16 @@ class ViewController: UIViewController {
private
func
prepareDateLabel
()
{
private
func
prepareDateLabel
()
{
dateLabel
=
UILabel
()
dateLabel
=
UILabel
()
dateLabel
.
font
=
RobotoFont
.
regular
(
with
:
12
)
dateLabel
.
font
=
RobotoFont
.
regular
(
with
:
12
)
dateLabel
.
textColor
=
blueGrey
.
base
dateLabel
.
textColor
=
Color
.
blueGrey
.
base
dateLabel
.
text
=
dateFormatter
.
string
(
from
:
Date
.
distantFuture
)
dateLabel
.
text
=
dateFormatter
.
string
(
from
:
Date
.
distantFuture
)
}
}
private
func
prepareFavoriteButton
()
{
private
func
prepareFavoriteButton
()
{
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
red
.
base
)
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
Color
.
red
.
base
)
}
}
private
func
prepareMoreButton
()
{
private
func
prepareMoreButton
()
{
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreVertical
,
tintColor
:
blueGrey
.
base
)
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreVertical
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareAuthorView
()
{
private
func
prepareAuthorView
()
{
...
@@ -97,7 +97,7 @@ class ViewController: UIViewController {
...
@@ -97,7 +97,7 @@ class ViewController: UIViewController {
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detailLabel
.
textAlignment
=
.
left
toolbar
.
detailLabel
.
textAlignment
=
.
left
toolbar
.
detailLabel
.
textColor
=
blueGrey
.
base
toolbar
.
detailLabel
.
textColor
=
Color
.
blueGrey
.
base
}
}
private
func
prepareContentView
()
{
private
func
prepareContentView
()
{
...
...
Examples/Programmatic/ImageCard/ImageCard/ViewController.swift
View file @
63ce6b94
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareImageView
()
prepareImageView
()
prepareFavoriteButton
()
prepareFavoriteButton
()
...
@@ -70,19 +70,19 @@ class ViewController: UIViewController {
...
@@ -70,19 +70,19 @@ class ViewController: UIViewController {
}
}
private
func
prepareFavoriteButton
()
{
private
func
prepareFavoriteButton
()
{
favoriteButton
=
FlatButton
(
image
:
Icon
.
favorite
,
tintColor
:
blueGrey
.
base
)
favoriteButton
=
FlatButton
(
image
:
Icon
.
favorite
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareShareButton
()
{
private
func
prepareShareButton
()
{
shareButton
=
FlatButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
blueGrey
.
base
)
shareButton
=
FlatButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareStarButton
()
{
private
func
prepareStarButton
()
{
starButton
=
FlatButton
(
image
:
Icon
.
cm
.
star
,
tintColor
:
blueGrey
.
base
)
starButton
=
FlatButton
(
image
:
Icon
.
cm
.
star
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareMoreButton
()
{
private
func
prepareMoreButton
()
{
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreHorizontal
,
tintColor
:
white
)
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreHorizontal
,
tintColor
:
.
white
)
}
}
private
func
prepareToolbar
()
{
private
func
prepareToolbar
()
{
...
@@ -90,10 +90,10 @@ class ViewController: UIViewController {
...
@@ -90,10 +90,10 @@ class ViewController: UIViewController {
toolbar
.
backgroundColor
=
nil
toolbar
.
backgroundColor
=
nil
toolbar
.
title
=
"CosmicMind"
toolbar
.
title
=
"CosmicMind"
toolbar
.
titleLabel
.
textColor
=
white
toolbar
.
titleLabel
.
textColor
=
.
white
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detailLabel
.
textColor
=
white
toolbar
.
detailLabel
.
textColor
=
.
white
}
}
private
func
prepareContentView
()
{
private
func
prepareContentView
()
{
...
...
Examples/Programmatic/Layer/Layer/ViewController.swift
View file @
63ce6b94
...
@@ -37,7 +37,7 @@ class ViewController: UIViewController {
...
@@ -37,7 +37,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareLayer
()
prepareLayer
()
}
}
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
...
@@ -50,7 +50,7 @@ class ViewController: UIViewController {
layer
=
Layer
(
frame
:
CGRect
(
x
:
(
w
-
d
)
/
2
,
y
:
(
h
-
d
)
/
2
,
width
:
d
,
height
:
d
))
layer
=
Layer
(
frame
:
CGRect
(
x
:
(
w
-
d
)
/
2
,
y
:
(
h
-
d
)
/
2
,
width
:
d
,
height
:
d
))
layer
.
depthPreset
=
.
depth3
layer
.
depthPreset
=
.
depth3
layer
.
shapePreset
=
.
circle
layer
.
shapePreset
=
.
circle
layer
.
backgroundColor
=
white
.
cgColor
layer
.
backgroundColor
=
Color
.
white
.
cgColor
layer
.
image
=
UIImage
(
named
:
"CosmicMind"
)
layer
.
image
=
UIImage
(
named
:
"CosmicMind"
)
view
.
layer
.
addSublayer
(
layer
)
view
.
layer
.
addSublayer
(
layer
)
...
...
Examples/Programmatic/MenuController/MenuController/AppMenuController.swift
View file @
63ce6b94
...
@@ -38,7 +38,7 @@ class AppMenuController: MenuController {
...
@@ -38,7 +38,7 @@ class AppMenuController: MenuController {
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareMenu
()
prepareMenu
()
}
}
...
...
Examples/Programmatic/MenuController/MenuController/RootViewController.swift
View file @
63ce6b94
...
@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
...
@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareAddButton
()
prepareAddButton
()
prepareAudioLibraryButton
()
prepareAudioLibraryButton
()
...
@@ -69,14 +69,14 @@ class RootViewController: UIViewController {
...
@@ -69,14 +69,14 @@ class RootViewController: UIViewController {
}
}
private
func
prepareAddButton
()
{
private
func
prepareAddButton
()
{
addButton
=
FabButton
(
image
:
Icon
.
cm
.
add
,
tintColor
:
white
)
addButton
=
FabButton
(
image
:
Icon
.
cm
.
add
)
addButton
.
addTarget
(
self
,
action
:
#selector(
handleToggleMenu
)
,
for
:
.
touchUpInside
)
addButton
.
addTarget
(
self
,
action
:
#selector(
handleToggleMenu
)
,
for
:
.
touchUpInside
)
}
}
private
func
prepareAudioLibraryButton
()
{
private
func
prepareAudioLibraryButton
()
{
audioLibraryMenuItem
=
MenuItem
()
audioLibraryMenuItem
=
MenuItem
()
audioLibraryMenuItem
.
button
.
image
=
Icon
.
cm
.
audioLibrary
audioLibraryMenuItem
.
button
.
image
=
Icon
.
cm
.
audioLibrary
audioLibraryMenuItem
.
button
.
backgroundColor
=
green
.
base
audioLibraryMenuItem
.
button
.
backgroundColor
=
Color
.
green
.
base
audioLibraryMenuItem
.
button
.
depthPreset
=
.
depth1
audioLibraryMenuItem
.
button
.
depthPreset
=
.
depth1
audioLibraryMenuItem
.
title
=
"Audio Library"
audioLibraryMenuItem
.
title
=
"Audio Library"
}
}
...
@@ -84,7 +84,7 @@ class RootViewController: UIViewController {
...
@@ -84,7 +84,7 @@ class RootViewController: UIViewController {
private
func
prepareBellButton
()
{
private
func
prepareBellButton
()
{
reminderMenuItem
=
MenuItem
()
reminderMenuItem
=
MenuItem
()
reminderMenuItem
.
button
.
image
=
Icon
.
cm
.
bell
reminderMenuItem
.
button
.
image
=
Icon
.
cm
.
bell
reminderMenuItem
.
button
.
backgroundColor
=
blue
.
base
reminderMenuItem
.
button
.
backgroundColor
=
Color
.
blue
.
base
reminderMenuItem
.
title
=
"Reminders"
reminderMenuItem
.
title
=
"Reminders"
}
}
...
...
Examples/Programmatic/NavigationController/NavigationController/AppNavigationController.swift
View file @
63ce6b94
...
@@ -34,8 +34,12 @@ import Material
...
@@ -34,8 +34,12 @@ import Material
class
AppNavigationController
:
NavigationController
{
class
AppNavigationController
:
NavigationController
{
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
guard
let
v
=
navigationBar
as?
NavigationBar
else
{
return
}
statusBarStyle
=
.
lightContent
statusBarStyle
=
.
lightContent
(
navigationBar
as?
NavigationBar
)?
.
backgroundColor
=
blue
.
base
v
.
backgroundColor
=
Color
.
blue
.
base
}
}
}
}
Examples/Programmatic/NavigationController/NavigationController/NextViewController.swift
View file @
63ce6b94
...
@@ -34,19 +34,19 @@ import Material
...
@@ -34,19 +34,19 @@ import Material
class
NextViewController
:
UIViewController
{
class
NextViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareNavigationItem
()
prepareNavigationItem
()
}
}
private
func
prepareNavigationItem
()
{
private
func
prepareNavigationItem
()
{
navigationItem
.
title
=
"Title"
navigationItem
.
title
=
"Title"
navigationItem
.
titleLabel
.
textColor
=
white
navigationItem
.
titleLabel
.
textColor
=
.
white
navigationItem
.
detail
=
"Detail Description"
navigationItem
.
detail
=
"Detail Description"
navigationItem
.
detailLabel
.
textColor
=
lightBlue
.
lighten5
navigationItem
.
detailLabel
.
textColor
=
Color
.
lightBlue
.
lighten5
navigationItem
.
backButton
.
tintColor
=
white
navigationItem
.
backButton
.
tintColor
=
.
white
}
}
}
}
Examples/Programmatic/NavigationController/NavigationController/RootViewController.swift
View file @
63ce6b94
...
@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
...
@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareMenuButton
()
prepareMenuButton
()
prepareStarButton
()
prepareStarButton
()
...
@@ -56,23 +56,26 @@ class RootViewController: UIViewController {
...
@@ -56,23 +56,26 @@ class RootViewController: UIViewController {
}
}
private
func
prepareMenuButton
()
{
private
func
prepareMenuButton
()
{
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
,
tintColor
:
white
)
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
,
tintColor
:
.
white
)
menuButton
.
pulseColor
=
.
white
}
}
private
func
prepareStarButton
()
{
private
func
prepareStarButton
()
{
starButton
=
IconButton
(
image
:
Icon
.
cm
.
star
,
tintColor
:
white
)
starButton
=
IconButton
(
image
:
Icon
.
cm
.
star
,
tintColor
:
.
white
)
starButton
.
pulseColor
=
.
white
}
}
private
func
prepareSearchButton
()
{
private
func
prepareSearchButton
()
{
searchButton
=
IconButton
(
image
:
Icon
.
cm
.
search
,
tintColor
:
white
)
searchButton
=
IconButton
(
image
:
Icon
.
cm
.
search
,
tintColor
:
.
white
)
searchButton
.
pulseColor
=
.
white
}
}
private
func
prepareNavigationItem
()
{
private
func
prepareNavigationItem
()
{
navigationItem
.
title
=
"Material"
navigationItem
.
title
=
"Material"
navigationItem
.
titleLabel
.
textColor
=
white
navigationItem
.
titleLabel
.
textColor
=
.
white
navigationItem
.
detail
=
"Build Beautiful Software"
navigationItem
.
detail
=
"Build Beautiful Software"
navigationItem
.
detailLabel
.
textColor
=
lightBlue
.
lighten5
navigationItem
.
detailLabel
.
textColor
=
Color
.
lightBlue
.
lighten5
navigationItem
.
leftViews
=
[
menuButton
]
navigationItem
.
leftViews
=
[
menuButton
]
navigationItem
.
rightViews
=
[
starButton
,
searchButton
]
navigationItem
.
rightViews
=
[
starButton
,
searchButton
]
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
View file @
63ce6b94
...
@@ -36,7 +36,7 @@ class LeftViewController: UIViewController {
...
@@ -36,7 +36,7 @@ class LeftViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
prepareTransitionButton
()
prepareTransitionButton
()
}
}
...
@@ -55,7 +55,7 @@ class LeftViewController: UIViewController {
...
@@ -55,7 +55,7 @@ class LeftViewController: UIViewController {
}
}
private
func
prepareTransitionButton
()
{
private
func
prepareTransitionButton
()
{
transitionButton
=
FlatButton
(
title
:
"Transition VC"
,
titleColor
:
white
)
transitionButton
=
FlatButton
(
title
:
"Transition VC"
,
titleColor
:
.
white
)
transitionButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
transitionButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
view
.
layout
(
transitionButton
)
.
horizontally
()
.
center
()
view
.
layout
(
transitionButton
)
.
horizontally
()
.
center
()
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
View file @
63ce6b94
...
@@ -36,7 +36,7 @@ class RightViewController: UIViewController {
...
@@ -36,7 +36,7 @@ class RightViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
prepareRootButton
()
prepareRootButton
()
}
}
...
@@ -55,7 +55,7 @@ class RightViewController: UIViewController {
...
@@ -55,7 +55,7 @@ class RightViewController: UIViewController {
}
}
private
func
prepareRootButton
()
{
private
func
prepareRootButton
()
{
rootButton
=
FlatButton
(
title
:
"Root VC"
,
titleColor
:
white
)
rootButton
=
FlatButton
(
title
:
"Root VC"
,
titleColor
:
.
white
)
rootButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
rootButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
view
.
layout
(
rootButton
)
.
horizontally
()
.
center
()
view
.
layout
(
rootButton
)
.
horizontally
()
.
center
()
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RootViewController.swift
View file @
63ce6b94
...
@@ -34,7 +34,7 @@ import Material
...
@@ -34,7 +34,7 @@ import Material
class
RootViewController
:
UIViewController
{
class
RootViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareToolbar
()
prepareToolbar
()
}
}
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/TransitionedViewController.swift
View file @
63ce6b94
...
@@ -34,7 +34,7 @@ import Material
...
@@ -34,7 +34,7 @@ import Material
class
TransitionedViewController
:
UIViewController
{
class
TransitionedViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
purple
.
base
view
.
backgroundColor
=
Color
.
purple
.
base
prepareToolbar
()
prepareToolbar
()
}
}
...
...
Examples/Programmatic/PageTabBarController/PageTabBarController/AppPageTabBarController.swift
View file @
63ce6b94
...
@@ -40,8 +40,8 @@ class AppPageTabBarController: PageTabBarController {
...
@@ -40,8 +40,8 @@ class AppPageTabBarController: PageTabBarController {
}
}
private
func
preparePageTabBar
()
{
private
func
preparePageTabBar
()
{
pageTabBar
.
lineColor
=
blueGrey
.
base
pageTabBar
.
lineColor
=
Color
.
blueGrey
.
base
pageTabBar
.
dividerColor
=
blueGrey
.
lighten5
pageTabBar
.
dividerColor
=
Color
.
blueGrey
.
lighten5
}
}
}
}
...
...
Examples/Programmatic/PageTabBarController/PageTabBarController/BlueViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Blue"
pageTabBarItem
.
title
=
"Blue"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Programmatic/PageTabBarController/PageTabBarController/GreenViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
green
.
base
view
.
backgroundColor
=
Color
.
green
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Green"
pageTabBarItem
.
title
=
"Green"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Programmatic/PageTabBarController/PageTabBarController/RedViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
red
.
base
view
.
backgroundColor
=
Color
.
red
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Red"
pageTabBarItem
.
title
=
"Red"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/AppToolbarController.swift
View file @
63ce6b94
...
@@ -42,6 +42,6 @@ class AppToolbarController: ToolbarController {
...
@@ -42,6 +42,6 @@ class AppToolbarController: ToolbarController {
private
func
prepareToolbar
()
{
private
func
prepareToolbar
()
{
toolbar
.
title
=
"Photo Library"
toolbar
.
title
=
"Photo Library"
toolbar
.
depthPreset
=
.
none
toolbar
.
depthPreset
=
.
none
toolbar
.
dividerColor
=
grey
.
lighten3
toolbar
.
dividerColor
=
Color
.
grey
.
lighten3
}
}
}
}
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/PhotoLibraryCollectionViewCell.swift
View file @
63ce6b94
...
@@ -50,7 +50,7 @@ class PhotoLibraryCollectionReusableView: CollectionReusableView {
...
@@ -50,7 +50,7 @@ class PhotoLibraryCollectionReusableView: CollectionReusableView {
toolbar
.
contentEdgeInsets
.
left
=
16
toolbar
.
contentEdgeInsets
.
left
=
16
toolbar
.
contentEdgeInsets
.
right
=
16
toolbar
.
contentEdgeInsets
.
right
=
16
toolbar
.
depthPreset
=
.
none
toolbar
.
depthPreset
=
.
none
toolbar
.
dividerColor
=
grey
.
lighten3
toolbar
.
dividerColor
=
Color
.
grey
.
lighten3
layout
(
toolbar
)
.
edges
()
layout
(
toolbar
)
.
edges
()
}
}
}
}
Examples/Programmatic/PhotoLibraryController/PhotoLibraryController/PhotoLibraryViewController.swift
View file @
63ce6b94
...
@@ -73,7 +73,7 @@ class PhotoLibraryViewController: PhotoLibraryController {
...
@@ -73,7 +73,7 @@ class PhotoLibraryViewController: PhotoLibraryController {
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareCollectionView
()
prepareCollectionView
()
...
...
Examples/Programmatic/PresenterCard/PresenterCard/ViewController.swift
View file @
63ce6b94
...
@@ -51,7 +51,7 @@ class ViewController: UIViewController {
...
@@ -51,7 +51,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
preparePresenterView
()
preparePresenterView
()
prepareDateFormatter
()
prepareDateFormatter
()
...
@@ -79,21 +79,21 @@ class ViewController: UIViewController {
...
@@ -79,21 +79,21 @@ class ViewController: UIViewController {
private
func
prepareDateLabel
()
{
private
func
prepareDateLabel
()
{
dateLabel
=
UILabel
()
dateLabel
=
UILabel
()
dateLabel
.
font
=
RobotoFont
.
regular
(
with
:
12
)
dateLabel
.
font
=
RobotoFont
.
regular
(
with
:
12
)
dateLabel
.
textColor
=
blueGrey
.
base
dateLabel
.
textColor
=
Color
.
blueGrey
.
base
dateLabel
.
textAlignment
=
.
center
dateLabel
.
textAlignment
=
.
center
dateLabel
.
text
=
dateFormatter
.
string
(
from
:
Date
.
distantFuture
)
dateLabel
.
text
=
dateFormatter
.
string
(
from
:
Date
.
distantFuture
)
}
}
private
func
prepareFavoriteButton
()
{
private
func
prepareFavoriteButton
()
{
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
red
.
base
)
favoriteButton
=
IconButton
(
image
:
Icon
.
favorite
,
tintColor
:
Color
.
red
.
base
)
}
}
private
func
prepareShareButton
()
{
private
func
prepareShareButton
()
{
shareButton
=
IconButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
blueGrey
.
base
)
shareButton
=
IconButton
(
image
:
Icon
.
cm
.
share
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareMoreButton
()
{
private
func
prepareMoreButton
()
{
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreHorizontal
,
tintColor
:
blueGrey
.
base
)
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreHorizontal
,
tintColor
:
Color
.
blueGrey
.
base
)
}
}
private
func
prepareToolbar
()
{
private
func
prepareToolbar
()
{
...
@@ -104,7 +104,7 @@ class ViewController: UIViewController {
...
@@ -104,7 +104,7 @@ class ViewController: UIViewController {
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detail
=
"Build Beautiful Software"
toolbar
.
detailLabel
.
textAlignment
=
.
left
toolbar
.
detailLabel
.
textAlignment
=
.
left
toolbar
.
detailLabel
.
textColor
=
blueGrey
.
base
toolbar
.
detailLabel
.
textColor
=
Color
.
blueGrey
.
base
}
}
private
func
prepareContentView
()
{
private
func
prepareContentView
()
{
...
...
Examples/Programmatic/SearchBarController/SearchBarController/RootViewController.swift
View file @
63ce6b94
...
@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
...
@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten1
view
.
backgroundColor
=
Color
.
grey
.
lighten1
}
}
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
Examples/Programmatic/SnackbarController/SnackbarController/RootViewController.swift
View file @
63ce6b94
...
@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
...
@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
}
}
open
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
open
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
...
@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
...
@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
}
}
private
func
prepareUndoButton
()
{
private
func
prepareUndoButton
()
{
undoButton
=
FlatButton
(
title
:
"Undo"
,
titleColor
:
yellow
.
base
)
undoButton
=
FlatButton
(
title
:
"Undo"
,
titleColor
:
Color
.
yellow
.
base
)
undoButton
.
pulseAnimation
=
.
backing
undoButton
.
pulseAnimation
=
.
backing
undoButton
.
titleLabel
?
.
font
=
snackbarController
?
.
snackbar
.
textLabel
.
font
undoButton
.
titleLabel
?
.
font
=
snackbarController
?
.
snackbar
.
textLabel
.
font
}
}
...
...
Examples/Programmatic/StatusBarController/StatusBarController/RootViewController.swift
View file @
63ce6b94
...
@@ -34,7 +34,7 @@ import Material
...
@@ -34,7 +34,7 @@ import Material
class
RootViewController
:
UIViewController
{
class
RootViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten1
view
.
backgroundColor
=
Color
.
grey
.
lighten1
}
}
}
}
Examples/Programmatic/Switch/Switch/ViewController.swift
View file @
63ce6b94
...
@@ -35,7 +35,7 @@ class ViewController: UIViewController {
...
@@ -35,7 +35,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareSwitch
()
prepareSwitch
()
}
}
...
...
Examples/Programmatic/TabBar/TabBar/ViewController.swift
View file @
63ce6b94
...
@@ -40,22 +40,22 @@ class ViewController: UIViewController {
...
@@ -40,22 +40,22 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareButtons
()
prepareButtons
()
prepareTabBar
()
prepareTabBar
()
}
}
private
func
prepareButtons
()
{
private
func
prepareButtons
()
{
let
btn1
=
FlatButton
(
title
:
"Library"
,
titleColor
:
blueGrey
.
base
)
let
btn1
=
FlatButton
(
title
:
"Library"
,
titleColor
:
Color
.
blueGrey
.
base
)
btn1
.
pulseAnimation
=
.
none
btn1
.
pulseAnimation
=
.
none
buttons
.
append
(
btn1
)
buttons
.
append
(
btn1
)
let
btn2
=
FlatButton
(
title
:
"Photo"
,
titleColor
:
blueGrey
.
base
)
let
btn2
=
FlatButton
(
title
:
"Photo"
,
titleColor
:
Color
.
blueGrey
.
base
)
btn2
.
pulseAnimation
=
.
none
btn2
.
pulseAnimation
=
.
none
buttons
.
append
(
btn2
)
buttons
.
append
(
btn2
)
let
btn3
=
FlatButton
(
title
:
"Video"
,
titleColor
:
blueGrey
.
base
)
let
btn3
=
FlatButton
(
title
:
"Video"
,
titleColor
:
Color
.
blueGrey
.
base
)
btn3
.
pulseAnimation
=
.
none
btn3
.
pulseAnimation
=
.
none
buttons
.
append
(
btn3
)
buttons
.
append
(
btn3
)
}
}
...
@@ -63,13 +63,13 @@ class ViewController: UIViewController {
...
@@ -63,13 +63,13 @@ class ViewController: UIViewController {
private
func
prepareTabBar
()
{
private
func
prepareTabBar
()
{
tabBar
=
TabBar
()
tabBar
=
TabBar
()
tabBar
.
dividerColor
=
grey
.
lighten3
tabBar
.
dividerColor
=
Color
.
grey
.
lighten3
tabBar
.
dividerAlignment
=
.
top
tabBar
.
dividerAlignment
=
.
top
tabBar
.
lineColor
=
blue
.
base
tabBar
.
lineColor
=
Color
.
blue
.
base
tabBar
.
lineAlignment
=
.
top
tabBar
.
lineAlignment
=
.
top
tabBar
.
backgroundColor
=
grey
.
lighten5
tabBar
.
backgroundColor
=
Color
.
grey
.
lighten5
tabBar
.
buttons
=
buttons
tabBar
.
buttons
=
buttons
view
.
layout
(
tabBar
)
.
horizontally
()
.
bottom
()
view
.
layout
(
tabBar
)
.
horizontally
()
.
bottom
()
...
...
Examples/Programmatic/TextField/TextField/ViewController.swift
View file @
63ce6b94
...
@@ -38,7 +38,7 @@ class ViewController: UIViewController {
...
@@ -38,7 +38,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareNameField
()
prepareNameField
()
prepareEmailField
()
prepareEmailField
()
...
@@ -53,7 +53,7 @@ class ViewController: UIViewController {
...
@@ -53,7 +53,7 @@ class ViewController: UIViewController {
/// Prepares the resign responder button.
/// Prepares the resign responder button.
private
func
prepareResignResponderButton
()
{
private
func
prepareResignResponderButton
()
{
let
btn
=
RaisedButton
(
title
:
"Resign"
,
titleColor
:
blue
.
base
)
let
btn
=
RaisedButton
(
title
:
"Resign"
,
titleColor
:
Color
.
blue
.
base
)
btn
.
addTarget
(
self
,
action
:
#selector(
handleResignResponderButton(button:)
)
,
for
:
.
touchUpInside
)
btn
.
addTarget
(
self
,
action
:
#selector(
handleResignResponderButton(button:)
)
,
for
:
.
touchUpInside
)
view
.
layout
(
btn
)
.
width
(
100
)
.
height
(
50
)
.
bottom
(
24
)
.
right
(
24
)
view
.
layout
(
btn
)
.
width
(
100
)
.
height
(
50
)
.
bottom
(
24
)
.
right
(
24
)
...
@@ -102,7 +102,7 @@ class ViewController: UIViewController {
...
@@ -102,7 +102,7 @@ class ViewController: UIViewController {
passwordField
.
isVisibilityIconButtonEnabled
=
true
passwordField
.
isVisibilityIconButtonEnabled
=
true
// Setting the visibilityIconButton color.
// Setting the visibilityIconButton color.
passwordField
.
visibilityIconButton
?
.
tintColor
=
green
.
base
.
withAlphaComponent
(
passwordField
.
isSecureTextEntry
?
0.38
:
0.54
)
passwordField
.
visibilityIconButton
?
.
tintColor
=
Color
.
green
.
base
.
withAlphaComponent
(
passwordField
.
isSecureTextEntry
?
0.38
:
0.54
)
// Size the TextField to the maximum width, less 40 pixels on either side
// Size the TextField to the maximum width, less 40 pixels on either side
// with a top margin of 200 pixels.
// with a top margin of 200 pixels.
...
...
Examples/Programmatic/ToolbarController/ToolbarController/AppToolbarController.swift
View file @
63ce6b94
...
@@ -35,6 +35,8 @@ class AppToolbarController: ToolbarController {
...
@@ -35,6 +35,8 @@ class AppToolbarController: ToolbarController {
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
statusBarStyle
=
.
default
statusBarStyle
=
.
default
// toolbar.heightPreset = .large
toolbar
.
height
=
100
}
}
}
}
Examples/Programmatic/ToolbarController/ToolbarController/RootViewController.swift
View file @
63ce6b94
...
@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
...
@@ -38,7 +38,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
}
}
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
Examples/Programmatic/View/View/ViewController.swift
View file @
63ce6b94
...
@@ -37,7 +37,7 @@ class ViewController: UIViewController {
...
@@ -37,7 +37,7 @@ class ViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
white
view
.
backgroundColor
=
.
white
prepareLogo
()
prepareLogo
()
}
}
...
@@ -48,7 +48,7 @@ class ViewController: UIViewController {
...
@@ -48,7 +48,7 @@ class ViewController: UIViewController {
logo
=
View
()
logo
=
View
()
logo
.
depthPreset
=
.
depth3
logo
.
depthPreset
=
.
depth3
logo
.
shapePreset
=
.
circle
logo
.
shapePreset
=
.
circle
logo
.
backgroundColor
=
white
logo
.
backgroundColor
=
.
white
logo
.
image
=
UIImage
(
named
:
"CosmicMind"
)
logo
.
image
=
UIImage
(
named
:
"CosmicMind"
)
view
.
layout
(
logo
)
.
width
(
d
)
.
height
(
d
)
.
center
()
view
.
layout
(
logo
)
.
width
(
d
)
.
height
(
d
)
.
center
()
...
...
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AudioViewController.swift
View file @
63ce6b94
...
@@ -44,7 +44,7 @@ class AudioViewController: UIViewController {
...
@@ -44,7 +44,7 @@ class AudioViewController: UIViewController {
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blueGrey
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blue
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blue
.
base
)
}
}
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
View file @
63ce6b94
...
@@ -44,7 +44,7 @@ class PhotoViewController: UIViewController {
...
@@ -44,7 +44,7 @@ class PhotoViewController: UIViewController {
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blueGrey
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blue
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blue
.
base
)
}
}
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
View file @
63ce6b94
...
@@ -44,7 +44,7 @@ class RemindersViewController: UIViewController {
...
@@ -44,7 +44,7 @@ class RemindersViewController: UIViewController {
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blueGrey
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blue
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blue
.
base
)
}
}
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/SearchViewController.swift
View file @
63ce6b94
...
@@ -44,7 +44,7 @@ class SearchViewController: UIViewController {
...
@@ -44,7 +44,7 @@ class SearchViewController: UIViewController {
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blueGrey
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blue
.
base
)
?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blue
.
base
)
}
}
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/VideoViewController.swift
View file @
63ce6b94
...
@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
...
@@ -39,12 +39,12 @@ class VideoViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
green
.
base
view
.
backgroundColor
=
Color
.
green
.
base
}
}
private
func
prepareTabBarItem
()
{
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
blueGrey
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
image
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
blue
.
base
)?
.
withRenderingMode
(
.
alwaysOriginal
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
videocam
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
}
}
Examples/Storyboards/Button/Button/ViewController.swift
View file @
63ce6b94
...
@@ -47,7 +47,7 @@ class ViewController: UIViewController {
...
@@ -47,7 +47,7 @@ class ViewController: UIViewController {
private
func
prepareIconButton
()
{
private
func
prepareIconButton
()
{
iconButton
.
image
=
Icon
.
search
iconButton
.
image
=
Icon
.
search
iconButton
.
pulseColor
=
blue
.
base
iconButton
.
pulseColor
=
Color
.
blue
.
base
}
}
}
}
...
...
Examples/Storyboards/NavigationController/NavigationController/NextViewController.swift
View file @
63ce6b94
...
@@ -34,7 +34,7 @@ import Material
...
@@ -34,7 +34,7 @@ import Material
class
NextViewController
:
UIViewController
{
class
NextViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
base
view
.
backgroundColor
=
Color
.
grey
.
base
prepareNavigationItem
()
prepareNavigationItem
()
}
}
...
@@ -43,7 +43,7 @@ class NextViewController: UIViewController {
...
@@ -43,7 +43,7 @@ class NextViewController: UIViewController {
navigationItem
.
title
=
"Title"
navigationItem
.
title
=
"Title"
navigationItem
.
detail
=
"Detail Description"
navigationItem
.
detail
=
"Detail Description"
navigationItem
.
backButton
.
tintColor
=
blue
.
base
navigationItem
.
backButton
.
tintColor
=
Color
.
blue
.
base
}
}
}
}
Examples/Storyboards/NavigationController/NavigationController/RootViewController.swift
View file @
63ce6b94
...
@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
...
@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten1
view
.
backgroundColor
=
Color
.
grey
.
lighten1
prepareMenuButton
()
prepareMenuButton
()
prepareStarButton
()
prepareStarButton
()
...
...
Examples/Storyboards/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
View file @
63ce6b94
...
@@ -34,6 +34,6 @@ import Material
...
@@ -34,6 +34,6 @@ import Material
class
LeftViewController
:
UIViewController
{
class
LeftViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
}
}
}
Examples/Storyboards/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
View file @
63ce6b94
...
@@ -34,6 +34,6 @@ import Material
...
@@ -34,6 +34,6 @@ import Material
class
RightViewController
:
UIViewController
{
class
RightViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
}
}
}
Examples/Storyboards/PageTabBarController/PageTabBarController/AppPageTabBarController.swift
View file @
63ce6b94
...
@@ -40,7 +40,7 @@ class AppPageTabBarController: PageTabBarController {
...
@@ -40,7 +40,7 @@ class AppPageTabBarController: PageTabBarController {
}
}
private
func
preparePageTabBar
()
{
private
func
preparePageTabBar
()
{
pageTabBar
.
lineColor
=
grey
.
darken1
pageTabBar
.
lineColor
=
Color
.
grey
.
darken1
}
}
}
}
...
...
Examples/Storyboards/PageTabBarController/PageTabBarController/BlueViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class BlueViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Blue"
pageTabBarItem
.
title
=
"Blue"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Storyboards/PageTabBarController/PageTabBarController/GreenViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class GreenViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
green
.
base
view
.
backgroundColor
=
Color
.
green
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Green"
pageTabBarItem
.
title
=
"Green"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Storyboards/PageTabBarController/PageTabBarController/RedViewController.swift
View file @
63ce6b94
...
@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
...
@@ -44,12 +44,12 @@ class RedViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
red
.
base
view
.
backgroundColor
=
Color
.
red
.
base
}
}
private
func
preparePageTabBarItem
()
{
private
func
preparePageTabBarItem
()
{
pageTabBarItem
.
title
=
"Red"
pageTabBarItem
.
title
=
"Red"
pageTabBarItem
.
titleColor
=
blueGrey
.
base
pageTabBarItem
.
titleColor
=
Color
.
blueGrey
.
base
}
}
}
}
Examples/Storyboards/SearchBarController/SearchBarController/RootViewController.swift
View file @
63ce6b94
...
@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
...
@@ -37,7 +37,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten1
view
.
backgroundColor
=
Color
.
grey
.
lighten1
}
}
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
Examples/Storyboards/SnackbarController/SnackbarController/RootViewController.swift
View file @
63ce6b94
...
@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
...
@@ -36,7 +36,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
}
}
open
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
open
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
...
@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
...
@@ -49,7 +49,7 @@ class RootViewController: UIViewController {
}
}
private
func
prepareUndoButton
()
{
private
func
prepareUndoButton
()
{
undoButton
=
FlatButton
(
title
:
"Undo"
,
titleColor
:
yellow
.
base
)
undoButton
=
FlatButton
(
title
:
"Undo"
,
titleColor
:
Color
.
yellow
.
base
)
undoButton
.
pulseAnimation
=
.
backing
undoButton
.
pulseAnimation
=
.
backing
undoButton
.
titleLabel
?
.
font
=
snackbarController
?
.
snackbar
.
textLabel
.
font
undoButton
.
titleLabel
?
.
font
=
snackbarController
?
.
snackbar
.
textLabel
.
font
}
}
...
...
Examples/Storyboards/StatusBarController/StatusBarController/RootViewController.swift
View file @
63ce6b94
...
@@ -34,7 +34,7 @@ import Material
...
@@ -34,7 +34,7 @@ import Material
class
RootViewController
:
UIViewController
{
class
RootViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
view
.
backgroundColor
=
grey
.
lighten5
view
.
backgroundColor
=
Color
.
grey
.
lighten5
}
}
}
}
Material.xcodeproj/project.pbxproj
View file @
63ce6b94
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
96230AB81D6A520C00AF47DC
/* Divider.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96230AB71D6A520C00AF47DC
/* Divider.swift */
;
};
96230AB81D6A520C00AF47DC
/* Divider.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96230AB71D6A520C00AF47DC
/* Divider.swift */
;
};
9626CA971DAB53A8003E2611
/* Display.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CA961DAB53A8003E2611
/* Display.swift */
;
};
9626CA971DAB53A8003E2611
/* Display.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CA961DAB53A8003E2611
/* Display.swift */
;
};
9626CA9E1DAB55B8003E2611
/* CaptureController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CA9D1DAB55B8003E2611
/* CaptureController.swift */
;
};
9626CA9E1DAB55B8003E2611
/* CaptureController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CA9D1DAB55B8003E2611
/* CaptureController.swift */
;
};
9626CB9B1DAD3D1D003E2611
/* HeightPreset.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9626CB9A1DAD3D1D003E2611
/* HeightPreset.swift */
;
};
9628645A1D53FE3E00690B69
/* Material+UIWindow.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
962864591D53FE3E00690B69
/* Material+UIWindow.swift */
;
};
9628645A1D53FE3E00690B69
/* Material+UIWindow.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
962864591D53FE3E00690B69
/* Material+UIWindow.swift */
;
};
9628645F1D540AF300690B69
/* DynamicFontType.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9628645E1D540AF300690B69
/* DynamicFontType.swift */
;
};
9628645F1D540AF300690B69
/* DynamicFontType.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9628645E1D540AF300690B69
/* DynamicFontType.swift */
;
};
9631A7C11D95E3AC00CFB109
/* PresenterCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9631A7C01D95E3AC00CFB109
/* PresenterCard.swift */
;
};
9631A7C11D95E3AC00CFB109
/* PresenterCard.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9631A7C01D95E3AC00CFB109
/* PresenterCard.swift */
;
};
...
@@ -213,6 +214,7 @@
...
@@ -213,6 +214,7 @@
96230AB71D6A520C00AF47DC
/* Divider.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Divider.swift
;
sourceTree
=
"<group>"
;
};
96230AB71D6A520C00AF47DC
/* Divider.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Divider.swift
;
sourceTree
=
"<group>"
;
};
9626CA961DAB53A8003E2611
/* Display.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Display.swift
;
sourceTree
=
"<group>"
;
};
9626CA961DAB53A8003E2611
/* Display.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Display.swift
;
sourceTree
=
"<group>"
;
};
9626CA9D1DAB55B8003E2611
/* CaptureController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CaptureController.swift
;
sourceTree
=
"<group>"
;
};
9626CA9D1DAB55B8003E2611
/* CaptureController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
CaptureController.swift
;
sourceTree
=
"<group>"
;
};
9626CB9A1DAD3D1D003E2611
/* HeightPreset.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
HeightPreset.swift
;
sourceTree
=
"<group>"
;
};
962864591D53FE3E00690B69
/* Material+UIWindow.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIWindow.swift"
;
sourceTree
=
"<group>"
;
};
962864591D53FE3E00690B69
/* Material+UIWindow.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UIWindow.swift"
;
sourceTree
=
"<group>"
;
};
9628645E1D540AF300690B69
/* DynamicFontType.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DynamicFontType.swift
;
sourceTree
=
"<group>"
;
};
9628645E1D540AF300690B69
/* DynamicFontType.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DynamicFontType.swift
;
sourceTree
=
"<group>"
;
};
9631A7C01D95E3AC00CFB109
/* PresenterCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PresenterCard.swift
;
sourceTree
=
"<group>"
;
};
9631A7C01D95E3AC00CFB109
/* PresenterCard.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PresenterCard.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -385,6 +387,14 @@
...
@@ -385,6 +387,14 @@
name
=
Root
;
name
=
Root
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
};
};
9626CBCC1DADA5F1003E2611
/* Height */
=
{
isa
=
PBXGroup
;
children
=
(
9626CB9A1DAD3D1D003E2611
/* HeightPreset.swift */
,
);
name
=
Height
;
sourceTree
=
"<group>"
;
};
962DDD071D6FBBB7001C307C
/* Page */
=
{
962DDD071D6FBBB7001C307C
/* Page */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
...
@@ -542,6 +552,7 @@
...
@@ -542,6 +552,7 @@
96BCB80A1CB410A100C806FE
/* Extension */
,
96BCB80A1CB410A100C806FE
/* Extension */
,
96BCB8071CB4101C00C806FE
/* Font */
,
96BCB8071CB4101C00C806FE
/* Font */
,
9602F00C1DA1163000F3FB79
/* Grid */
,
9602F00C1DA1163000F3FB79
/* Grid */
,
9626CBCC1DADA5F1003E2611
/* Height */
,
96BCB8081CB4105E00C806FE
/* Icon */
,
96BCB8081CB4105E00C806FE
/* Icon */
,
96BCB80D1CB410FD00C806FE
/* Layer */
,
96BCB80D1CB410FD00C806FE
/* Layer */
,
96BCB8041CB40F6C00C806FE
/* Layout */
,
96BCB8041CB40F6C00C806FE
/* Layout */
,
...
@@ -1074,6 +1085,7 @@
...
@@ -1074,6 +1085,7 @@
96BCB7C71CB40DC500C806FE
/* KeyframeAnimation.swift in Sources */
,
96BCB7C71CB40DC500C806FE
/* KeyframeAnimation.swift in Sources */
,
96BCB7BE1CB40DC500C806FE
/* CollectionViewLayout.swift in Sources */
,
96BCB7BE1CB40DC500C806FE
/* CollectionViewLayout.swift in Sources */
,
96BCB7BF1CB40DC500C806FE
/* Color.swift in Sources */
,
96BCB7BF1CB40DC500C806FE
/* Color.swift in Sources */
,
9626CB9B1DAD3D1D003E2611
/* HeightPreset.swift in Sources */
,
96EA9A431D4E68F80052C74D
/* PhotoLibrary.swift in Sources */
,
96EA9A431D4E68F80052C74D
/* PhotoLibrary.swift in Sources */
,
96BCB7C61CB40DC500C806FE
/* Icon.swift in Sources */
,
96BCB7C61CB40DC500C806FE
/* Icon.swift in Sources */
,
96BCB7E91CB40DC500C806FE
/* ToolbarController.swift in Sources */
,
96BCB7E91CB40DC500C806FE
/* ToolbarController.swift in Sources */
,
...
...
Sources/iOS/Bar.swift
View file @
63ce6b94
...
@@ -37,6 +37,15 @@ public enum ContentViewAlignment: Int {
...
@@ -37,6 +37,15 @@ public enum ContentViewAlignment: Int {
}
}
open
class
Bar
:
View
{
open
class
Bar
:
View
{
/// Will render the view.
open
var
willLayout
:
Bool
{
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
}
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
height
)
}
/// Should center the contentView.
/// Should center the contentView.
open
var
contentViewAlignment
=
ContentViewAlignment
.
any
{
open
var
contentViewAlignment
=
ContentViewAlignment
.
any
{
didSet
{
didSet
{
...
@@ -44,11 +53,6 @@ open class Bar: View {
...
@@ -44,11 +53,6 @@ open class Bar: View {
}
}
}
}
/// Will render the view.
open
var
willLayout
:
Bool
{
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
}
/// A preset wrapper around contentEdgeInsets.
/// A preset wrapper around contentEdgeInsets.
open
var
contentEdgeInsetsPreset
:
EdgeInsetsPreset
{
open
var
contentEdgeInsetsPreset
:
EdgeInsetsPreset
{
get
{
get
{
...
@@ -88,10 +92,6 @@ open class Bar: View {
...
@@ -88,10 +92,6 @@ open class Bar: View {
}
}
}
}
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
44
)
}
/// Grid cell factor.
/// Grid cell factor.
@IBInspectable
@IBInspectable
open
var
gridFactor
:
CGFloat
=
12
{
open
var
gridFactor
:
CGFloat
=
12
{
...
@@ -130,6 +130,9 @@ open class Bar: View {
...
@@ -130,6 +130,9 @@ open class Bar: View {
return
contentView
.
grid
.
views
return
contentView
.
grid
.
views
}
}
set
(
value
)
{
set
(
value
)
{
for
v
in
contentView
.
grid
.
views
{
v
.
removeFromSuperview
()
}
contentView
.
grid
.
views
=
value
contentView
.
grid
.
views
=
value
}
}
}
}
...
@@ -250,6 +253,7 @@ open class Bar: View {
...
@@ -250,6 +253,7 @@ open class Bar: View {
*/
*/
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
heightPreset
=
.
default
autoresizingMask
=
.
flexibleWidth
autoresizingMask
=
.
flexibleWidth
interimSpacePreset
=
.
interimSpace3
interimSpacePreset
=
.
interimSpace3
contentEdgeInsetsPreset
=
.
square1
contentEdgeInsetsPreset
=
.
square1
...
...
Sources/iOS/BottomNavigationController.swift
View file @
63ce6b94
...
@@ -158,6 +158,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
...
@@ -158,6 +158,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
/// Prepares the tabBar.
/// Prepares the tabBar.
private
func
prepareTabBar
()
{
private
func
prepareTabBar
()
{
tabBar
.
heightPreset
=
.
normal
tabBar
.
depthPreset
=
.
depth1
tabBar
.
depthPreset
=
.
depth1
tabBar
.
dividerAlignment
=
.
top
tabBar
.
dividerAlignment
=
.
top
let
image
=
UIImage
.
image
(
with
:
Color
.
clear
,
size
:
CGSize
(
width
:
1
,
height
:
1
))
let
image
=
UIImage
.
image
(
with
:
Color
.
clear
,
size
:
CGSize
(
width
:
1
,
height
:
1
))
...
...
Sources/iOS/BottomTabBar.swift
View file @
63ce6b94
...
@@ -38,6 +38,10 @@ extension UITabBarItem {
...
@@ -38,6 +38,10 @@ extension UITabBarItem {
}
}
open
class
BottomTabBar
:
UITabBar
{
open
class
BottomTabBar
:
UITabBar
{
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
height
)
}
/// Automatically aligns the BottomNavigationBar to the superview.
/// Automatically aligns the BottomNavigationBar to the superview.
open
var
isAlignedToParentAutomatically
=
true
open
var
isAlignedToParentAutomatically
=
true
...
@@ -124,6 +128,7 @@ open class BottomTabBar: UITabBar {
...
@@ -124,6 +128,7 @@ open class BottomTabBar: UITabBar {
when subclassing.
when subclassing.
*/
*/
public
func
prepare
()
{
public
func
prepare
()
{
heightPreset
=
.
normal
depthPreset
=
.
depth1
depthPreset
=
.
depth1
dividerAlignment
=
.
top
dividerAlignment
=
.
top
contentScaleFactor
=
Device
.
scale
contentScaleFactor
=
Device
.
scale
...
...
Sources/iOS/Button.swift
View file @
63ce6b94
...
@@ -150,6 +150,7 @@ open class Button: UIButton {
...
@@ -150,6 +150,7 @@ open class Button: UIButton {
public
convenience
init
(
image
:
UIImage
?,
tintColor
:
UIColor
=
Color
.
blue
.
base
)
{
public
convenience
init
(
image
:
UIImage
?,
tintColor
:
UIColor
=
Color
.
blue
.
base
)
{
self
.
init
()
self
.
init
()
prepare
(
with
:
image
,
tintColor
:
tintColor
)
prepare
(
with
:
image
,
tintColor
:
tintColor
)
prepare
()
}
}
/**
/**
...
@@ -160,6 +161,7 @@ open class Button: UIButton {
...
@@ -160,6 +161,7 @@ open class Button: UIButton {
public
convenience
init
(
title
:
String
?,
titleColor
:
UIColor
=
Color
.
blue
.
base
)
{
public
convenience
init
(
title
:
String
?,
titleColor
:
UIColor
=
Color
.
blue
.
base
)
{
self
.
init
()
self
.
init
()
prepare
(
with
:
title
,
titleColor
:
titleColor
)
prepare
(
with
:
title
,
titleColor
:
titleColor
)
prepare
()
}
}
open
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
open
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
...
@@ -259,7 +261,6 @@ open class Button: UIButton {
...
@@ -259,7 +261,6 @@ open class Button: UIButton {
private
func
prepare
(
with
image
:
UIImage
?,
tintColor
:
UIColor
)
{
private
func
prepare
(
with
image
:
UIImage
?,
tintColor
:
UIColor
)
{
self
.
image
=
image
self
.
image
=
image
self
.
tintColor
=
tintColor
self
.
tintColor
=
tintColor
pulseColor
=
tintColor
}
}
/**
/**
...
@@ -270,6 +271,5 @@ open class Button: UIButton {
...
@@ -270,6 +271,5 @@ open class Button: UIButton {
private
func
prepare
(
with
title
:
String
?,
titleColor
:
UIColor
)
{
private
func
prepare
(
with
title
:
String
?,
titleColor
:
UIColor
)
{
self
.
title
=
title
self
.
title
=
title
self
.
titleColor
=
titleColor
self
.
titleColor
=
titleColor
pulseColor
=
titleColor
}
}
}
}
Sources/iOS/Color.swift
View file @
63ce6b94
...
@@ -59,18 +59,18 @@ public protocol ColorPalette {
...
@@ -59,18 +59,18 @@ public protocol ColorPalette {
open
class
Color
:
UIColor
{
open
class
Color
:
UIColor
{
// dark text
// dark text
open
class
darkText
{
open
class
darkText
{
open
static
let
primary
=
black
.
withAlphaComponent
(
0.87
)
open
static
let
primary
=
Color
.
black
.
withAlphaComponent
(
0.87
)
open
static
let
secondary
=
black
.
withAlphaComponent
(
0.54
)
open
static
let
secondary
=
Color
.
black
.
withAlphaComponent
(
0.54
)
open
static
let
others
=
black
.
withAlphaComponent
(
0.38
)
open
static
let
others
=
Color
.
black
.
withAlphaComponent
(
0.38
)
open
static
let
dividers
=
black
.
withAlphaComponent
(
0.12
)
open
static
let
dividers
=
Color
.
black
.
withAlphaComponent
(
0.12
)
}
}
// light text
// light text
open
class
lightText
{
open
class
lightText
{
open
static
let
primary
=
white
open
static
let
primary
=
Color
.
white
open
static
let
secondary
=
white
.
withAlphaComponent
(
0.7
)
open
static
let
secondary
=
Color
.
white
.
withAlphaComponent
(
0.7
)
open
static
let
others
=
white
.
withAlphaComponent
(
0.5
)
open
static
let
others
=
Color
.
white
.
withAlphaComponent
(
0.5
)
open
static
let
dividers
=
white
.
withAlphaComponent
(
0.12
)
open
static
let
dividers
=
Color
.
white
.
withAlphaComponent
(
0.12
)
}
}
// red
// red
...
...
Sources/iOS/Divider.swift
View file @
63ce6b94
...
@@ -48,7 +48,7 @@ open class Divider {
...
@@ -48,7 +48,7 @@ open class Divider {
/// A reference to the height.
/// A reference to the height.
public
var
height
:
CGFloat
public
var
height
:
CGFloat
/// A UI
/// A UI
Color.
open
var
color
:
UIColor
?
{
open
var
color
:
UIColor
?
{
get
{
get
{
return
line
?
.
backgroundColor
return
line
?
.
backgroundColor
...
...
Sources/iOS/Grid.swift
View file @
63ce6b94
...
@@ -293,4 +293,25 @@ extension UIView {
...
@@ -293,4 +293,25 @@ extension UIView {
AssociateObject
(
base
:
self
,
key
:
&
GridKey
,
value
:
value
)
AssociateObject
(
base
:
self
,
key
:
&
GridKey
,
value
:
value
)
}
}
}
}
/// A reference to grid's layoutEdgeInsetsPreset.
open
var
layoutEdgeInsetsPreset
:
EdgeInsetsPreset
{
get
{
return
grid
.
layoutEdgeInsetsPreset
}
set
(
value
)
{
grid
.
layoutEdgeInsetsPreset
=
value
}
}
/// A reference to grid's layoutEdgeInsets.
@IBInspectable
open
var
layoutEdgeInsets
:
EdgeInsets
{
get
{
return
grid
.
layoutEdgeInsets
}
set
(
value
)
{
grid
.
layoutEdgeInsets
=
value
}
}
}
}
Sources/iOS/HeightPreset.swift
0 → 100644
View file @
63ce6b94
/*
* 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
@objc(HeightPreset)
public
enum
HeightPreset
:
Int
{
case
tiny
=
20
case
xsmall
=
28
case
small
=
36
case
`
default
`
=
44
case
normal
=
49
case
medium
=
52
case
large
=
60
case
xlarge
=
68
}
Sources/iOS/Material+CALayer.swift
View file @
63ce6b94
...
@@ -34,25 +34,24 @@ internal class MaterialLayer {
...
@@ -34,25 +34,24 @@ internal class MaterialLayer {
/// A reference to the CALayer.
/// A reference to the CALayer.
internal
weak
var
layer
:
CALayer
?
internal
weak
var
layer
:
CALayer
?
/// A property that sets the
cornerRadius of the backing layer
.
/// A property that sets the
height of the layer's frame
.
internal
var
cornerRadiusPreset
=
CornerRadiusPreset
.
none
{
internal
var
heightPreset
=
HeightPreset
.
default
{
didSet
{
didSet
{
guard
let
v
=
layer
else
{
layer
?
.
height
=
CGFloat
(
heightPreset
.
rawValue
)
return
}
}
}
v
.
cornerRadius
=
CornerRadiusPresetToValue
(
preset
:
cornerRadiusPreset
)
/// A property that sets the cornerRadius of the backing layer.
internal
var
cornerRadiusPreset
=
CornerRadiusPreset
.
none
{
didSet
{
layer
?
.
cornerRadius
=
CornerRadiusPresetToValue
(
preset
:
cornerRadiusPreset
)
}
}
}
}
/// A preset property to set the borderWidth.
/// A preset property to set the borderWidth.
internal
var
borderWidthPreset
=
BorderWidthPreset
.
none
{
internal
var
borderWidthPreset
=
BorderWidthPreset
.
none
{
didSet
{
didSet
{
guard
let
v
=
layer
else
{
layer
?
.
borderWidth
=
BorderWidthPresetToValue
(
preset
:
borderWidthPreset
)
return
}
v
.
borderWidth
=
BorderWidthPresetToValue
(
preset
:
borderWidthPreset
)
}
}
}
}
...
@@ -174,6 +173,16 @@ extension CALayer {
...
@@ -174,6 +173,16 @@ extension CALayer {
}
}
}
}
/// HeightPreset value.
open
var
heightPreset
:
HeightPreset
{
get
{
return
materialLayer
.
heightPreset
}
set
(
value
)
{
materialLayer
.
heightPreset
=
value
}
}
/**
/**
A property that manages the overall shape for the object. If either the
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
width or height property is set, the other will be automatically adjusted
...
...
Sources/iOS/Material+UIImage.swift
View file @
63ce6b94
...
@@ -116,9 +116,9 @@ extension UIImage {
...
@@ -116,9 +116,9 @@ extension UIImage {
color
.
setFill
()
color
.
setFill
()
context
.
fill
(
rect
)
context
.
fill
(
rect
)
let
image
:
UIImage
=
UIGraphicsGetImageFromCurrentImageContext
()
!
let
image
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
UIGraphicsEndImageContext
()
return
image
return
image
?
.
withRenderingMode
(
.
alwaysOriginal
)
}
}
}
}
...
@@ -136,7 +136,7 @@ extension UIImage {
...
@@ -136,7 +136,7 @@ extension UIImage {
UIRectFill
(
rect
)
UIRectFill
(
rect
)
let
image
=
UIGraphicsGetImageFromCurrentImageContext
()
let
image
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
UIGraphicsEndImageContext
()
return
image
return
image
?
.
withRenderingMode
(
.
alwaysOriginal
)
}
}
}
}
...
...
Sources/iOS/Material+UIView.swift
View file @
63ce6b94
...
@@ -76,6 +76,16 @@ extension UIView {
...
@@ -76,6 +76,16 @@ extension UIView {
}
}
}
}
/// HeightPreset value.
open
var
heightPreset
:
HeightPreset
{
get
{
return
layer
.
heightPreset
}
set
(
value
)
{
layer
.
heightPreset
=
value
}
}
/**
/**
A property that manages the overall shape for the object. If either the
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
width or height property is set, the other will be automatically adjusted
...
...
Sources/iOS/NavigationBar.swift
View file @
63ce6b94
...
@@ -30,36 +30,16 @@
...
@@ -30,36 +30,16 @@
import
UIKit
import
UIKit
/// NavigationBar styles.
@objc(NavigationBarStyle)
public
enum
NavigationBarStyle
:
Int
{
case
small
case
medium
case
large
}
open
class
NavigationBar
:
UINavigationBar
{
open
class
NavigationBar
:
UINavigationBar
{
open
override
var
intrinsicContentSize
:
CGSize
{
switch
navigationBarStyle
{
case
.
small
:
return
CGSize
(
width
:
Device
.
width
,
height
:
32
)
case
.
medium
:
return
CGSize
(
width
:
Device
.
width
,
height
:
44
)
case
.
large
:
return
CGSize
(
width
:
Device
.
width
,
height
:
56
)
}
}
/// NavigationBarStyle value.
open
var
navigationBarStyle
=
NavigationBarStyle
.
medium
internal
var
animating
=
false
/// Will render the view.
/// Will render the view.
open
var
willLayout
:
Bool
{
open
var
willLayout
:
Bool
{
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
return
0
<
width
&&
0
<
height
&&
nil
!=
superview
}
}
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
height
)
}
/// A preset wrapper around contentEdgeInsets.
/// A preset wrapper around contentEdgeInsets.
open
var
contentEdgeInsetsPreset
=
EdgeInsetsPreset
.
none
{
open
var
contentEdgeInsetsPreset
=
EdgeInsetsPreset
.
none
{
didSet
{
didSet
{
...
@@ -301,6 +281,7 @@ open class NavigationBar: UINavigationBar {
...
@@ -301,6 +281,7 @@ open class NavigationBar: UINavigationBar {
when subclassing.
when subclassing.
*/
*/
open
func
prepare
()
{
open
func
prepare
()
{
heightPreset
=
.
default
barStyle
=
.
black
barStyle
=
.
black
isTranslucent
=
false
isTranslucent
=
false
depthPreset
=
.
depth1
depthPreset
=
.
depth1
...
...
Sources/iOS/NavigationItem.swift
View file @
63ce6b94
...
@@ -208,6 +208,9 @@ extension UINavigationItem {
...
@@ -208,6 +208,9 @@ extension UINavigationItem {
return
navigationItem
.
contentView
.
grid
.
views
return
navigationItem
.
contentView
.
grid
.
views
}
}
set
(
value
)
{
set
(
value
)
{
for
v
in
navigationItem
.
contentView
.
grid
.
views
{
v
.
removeFromSuperview
()
}
navigationItem
.
contentView
.
grid
.
views
=
value
navigationItem
.
contentView
.
grid
.
views
=
value
}
}
}
}
...
...
Sources/iOS/PageTabBarController.swift
View file @
63ce6b94
...
@@ -146,11 +146,11 @@ open class PageTabBarController: RootController {
...
@@ -146,11 +146,11 @@ open class PageTabBarController: RootController {
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
let
p
=
pageTabBar
.
intrinsicContentSize
.
height
+
pageTabBar
.
grid
.
layoutEdgeInsets
.
top
+
pageTabBar
.
grid
.
layoutEdgeInsets
.
bottom
let
p
=
pageTabBar
.
intrinsicContentSize
.
height
+
pageTabBar
.
layoutEdgeInsets
.
top
+
pageTabBar
.
layoutEdgeInsets
.
bottom
let
y
=
view
.
height
-
p
let
y
=
view
.
height
-
p
pageTabBar
.
height
=
p
pageTabBar
.
height
=
p
pageTabBar
.
width
=
view
.
width
+
pageTabBar
.
grid
.
layoutEdgeInsets
.
left
+
pageTabBar
.
grid
.
layoutEdgeInsets
.
right
pageTabBar
.
width
=
view
.
width
+
pageTabBar
.
layoutEdgeInsets
.
left
+
pageTabBar
.
layoutEdgeInsets
.
right
rootViewController
.
view
.
height
=
y
rootViewController
.
view
.
height
=
y
...
...
Sources/iOS/Pulse.swift
View file @
63ce6b94
...
@@ -34,8 +34,8 @@ internal struct Pulse {
...
@@ -34,8 +34,8 @@ internal struct Pulse {
/// An Array of layers.
/// An Array of layers.
internal
lazy
var
layers
=
[
CAShapeLayer
]()
internal
lazy
var
layers
=
[
CAShapeLayer
]()
/// A UI
/// A UI
Color.
internal
var
color
=
Color
.
blueG
rey
.
base
internal
var
color
=
Color
.
g
rey
.
base
/// A reference to the PulseAnimation.
/// A reference to the PulseAnimation.
internal
var
animation
=
PulseAnimation
.
pointWithBacking
internal
var
animation
=
PulseAnimation
.
pointWithBacking
...
...
Sources/iOS/SearchBarController.swift
View file @
63ce6b94
...
@@ -56,11 +56,11 @@ open class SearchBarController: RootController {
...
@@ -56,11 +56,11 @@ open class SearchBarController: RootController {
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
searchBar
.
grid
.
layoutEdgeInsets
.
top
=
.
phone
==
Device
.
userInterfaceIdiom
&&
Device
.
isLandscape
?
0
:
20
searchBar
.
layoutEdgeInsets
.
top
=
.
phone
==
Device
.
userInterfaceIdiom
&&
Device
.
isLandscape
?
0
:
20
let
p
=
searchBar
.
intrinsicContentSize
.
height
+
searchBar
.
grid
.
layoutEdgeInsets
.
top
+
searchBar
.
grid
.
layoutEdgeInsets
.
bottom
let
p
=
searchBar
.
intrinsicContentSize
.
height
+
searchBar
.
layoutEdgeInsets
.
top
+
searchBar
.
layoutEdgeInsets
.
bottom
searchBar
.
width
=
view
.
width
+
searchBar
.
grid
.
layoutEdgeInsets
.
left
+
searchBar
.
grid
.
layoutEdgeInsets
.
right
searchBar
.
width
=
view
.
width
+
searchBar
.
layoutEdgeInsets
.
left
+
searchBar
.
layoutEdgeInsets
.
right
searchBar
.
height
=
p
searchBar
.
height
=
p
rootViewController
.
view
.
y
=
p
rootViewController
.
view
.
y
=
p
...
...
Sources/iOS/SnackbarController.swift
View file @
63ce6b94
...
@@ -163,7 +163,7 @@ open class SnackbarController: RootController {
...
@@ -163,7 +163,7 @@ open class SnackbarController: RootController {
/// Reloads the view.
/// Reloads the view.
open
func
reload
()
{
open
func
reload
()
{
snackbar
.
width
=
view
.
width
snackbar
.
width
=
view
.
width
snackbar
.
height
=
snackbar
.
intrinsicContentSize
.
height
+
snackbar
.
grid
.
layoutEdgeInsets
.
top
+
snackbar
.
grid
.
layoutEdgeInsets
.
bottom
snackbar
.
height
=
snackbar
.
intrinsicContentSize
.
height
+
snackbar
.
layoutEdgeInsets
.
top
+
snackbar
.
layoutEdgeInsets
.
bottom
layoutSnackbar
(
status
:
snackbar
.
status
)
layoutSnackbar
(
status
:
snackbar
.
status
)
}
}
...
...
Sources/iOS/TabBar.swift
View file @
63ce6b94
...
@@ -64,10 +64,6 @@ open class TabBar: Bar {
...
@@ -64,10 +64,6 @@ open class TabBar: Bar {
/// A delegation reference.
/// A delegation reference.
open
weak
var
delegate
:
TabBarDelegate
?
open
weak
var
delegate
:
TabBarDelegate
?
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
49
)
}
/// The currently selected button.
/// The currently selected button.
open
internal(set)
var
selected
:
UIButton
?
open
internal(set)
var
selected
:
UIButton
?
...
@@ -206,6 +202,7 @@ open class TabBar: Bar {
...
@@ -206,6 +202,7 @@ open class TabBar: Bar {
*/
*/
open
override
func
prepare
()
{
open
override
func
prepare
()
{
super
.
prepare
()
super
.
prepare
()
heightPreset
=
.
normal
contentEdgeInsetsPreset
=
.
none
contentEdgeInsetsPreset
=
.
none
interimSpacePreset
=
.
none
interimSpacePreset
=
.
none
prepareLine
()
prepareLine
()
...
...
Sources/iOS/ToolbarController.swift
View file @
63ce6b94
...
@@ -68,7 +68,7 @@ public protocol ToolbarControllerDelegate {
...
@@ -68,7 +68,7 @@ public protocol ToolbarControllerDelegate {
}
}
@objc(ToolbarController)
@objc(ToolbarController)
open
class
ToolbarController
:
Root
Controller
{
open
class
ToolbarController
:
StatusBar
Controller
{
open
var
display
=
Display
.
partial
{
open
var
display
=
Display
.
partial
{
didSet
{
didSet
{
layoutSubviews
()
layoutSubviews
()
...
@@ -167,12 +167,10 @@ open class ToolbarController: RootController {
...
@@ -167,12 +167,10 @@ open class ToolbarController: RootController {
open
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
toolbar
.
grid
.
layoutEdgeInsets
.
top
=
.
phone
==
Device
.
userInterfaceIdiom
&&
Device
.
isLandscape
?
0
:
20
toolbar
.
y
=
.
phone
==
Device
.
userInterfaceIdiom
&&
Device
.
isLandscape
?
0
:
20
toolbar
.
width
=
view
.
width
let
p
=
toolbar
.
intrinsicContentSize
.
height
+
toolbar
.
grid
.
layoutEdgeInsets
.
top
+
toolbar
.
grid
.
layoutEdgeInsets
.
bottom
let
p
=
toolbar
.
y
+
toolbar
.
height
toolbar
.
width
=
view
.
width
+
toolbar
.
grid
.
layoutEdgeInsets
.
left
+
toolbar
.
grid
.
layoutEdgeInsets
.
right
toolbar
.
height
=
p
switch
display
{
switch
display
{
case
.
partial
:
case
.
partial
:
...
...
Sources/macOS/Color.swift
View file @
63ce6b94
...
@@ -56,30 +56,21 @@ public protocol ColorPalette {
...
@@ -56,30 +56,21 @@ public protocol ColorPalette {
optional
static
var
accent4
:
NSColor
{
get
}
optional
static
var
accent4
:
NSColor
{
get
}
}
}
open
class
Color
{
open
class
Color
:
NSColor
{
// clear
open
static
let
clear
=
NSclear
// white
open
static
let
white
=
NSwhite
// black
open
static
let
black
=
NSblack
// dark text
// dark text
open
class
darkText
{
open
class
darkText
{
open
static
let
primary
=
black
.
withAlphaComponent
(
0.87
)
open
static
let
primary
=
Color
.
black
.
withAlphaComponent
(
0.87
)
open
static
let
secondary
=
black
.
withAlphaComponent
(
0.54
)
open
static
let
secondary
=
Color
.
black
.
withAlphaComponent
(
0.54
)
open
static
let
others
=
black
.
withAlphaComponent
(
0.38
)
open
static
let
others
=
Color
.
black
.
withAlphaComponent
(
0.38
)
open
static
let
dividers
=
black
.
withAlphaComponent
(
0.12
)
open
static
let
dividers
=
Color
.
black
.
withAlphaComponent
(
0.12
)
}
}
// light text
// light text
open
class
lightText
{
open
class
lightText
{
open
static
let
primary
=
white
open
static
let
primary
=
Color
.
white
open
static
let
secondary
=
white
.
withAlphaComponent
(
0.7
)
open
static
let
secondary
=
Color
.
white
.
withAlphaComponent
(
0.7
)
open
static
let
others
=
white
.
withAlphaComponent
(
0.5
)
open
static
let
others
=
Color
.
white
.
withAlphaComponent
(
0.5
)
open
static
let
dividers
=
white
.
withAlphaComponent
(
0.12
)
open
static
let
dividers
=
Color
.
white
.
withAlphaComponent
(
0.12
)
}
}
// red
// red
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment