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
42e6257c
Unverified
Commit
42e6257c
authored
Oct 12, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated remaining example projects for HeightPreset
parent
da92a778
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
121 additions
and
122 deletions
+121
-122
Examples/Programmatic/Layer/Layer/ViewController.swift
+0
-1
Examples/Programmatic/NavigationController/NavigationController.xcodeproj/project.pbxproj
+0
-4
Examples/Programmatic/NavigationController/NavigationController/AppDelegate.swift
+1
-1
Examples/Programmatic/NavigationController/NavigationController/AppStatusBarController.swift
+0
-41
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/AppToolbarController.swift
+8
-0
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
+1
-0
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
+3
-2
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RootViewController.swift
+2
-1
Examples/Programmatic/SearchBarController/SearchBarController/AppSearchBarController.swift
+1
-1
Examples/Programmatic/StatusBarController/StatusBarController/AppStatusBarController.swift
+7
-1
Examples/Programmatic/TabBar/TabBar/ViewController.swift
+11
-3
Examples/Programmatic/TextField/TextField/ViewController.swift
+3
-3
Examples/Programmatic/View/View/ViewController.swift
+2
-3
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AppBottomNavigationController.swift
+1
-1
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AudioViewController.swift
+3
-3
Examples/Storyboards/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
+3
-3
Examples/Storyboards/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
+3
-3
Examples/Storyboards/BottomNavigationController/BottomNavigationController/SearchViewController.swift
+3
-3
Examples/Storyboards/NavigationController/NavigationController/AppNavigationController.swift
+6
-1
Examples/Storyboards/NavigationController/NavigationController/NextViewController.swift
+3
-2
Examples/Storyboards/NavigationController/NavigationController/RootViewController.swift
+2
-1
Examples/Storyboards/SearchBarController/SearchBarController/AppSearchBarController.swift
+27
-1
Examples/Storyboards/SearchBarController/SearchBarController/RootViewController.swift
+5
-24
Examples/Storyboards/SnackbarController/SnackbarController/AppSnackbarController.swift
+8
-8
Examples/Storyboards/SnackbarController/SnackbarController/RootViewController.swift
+5
-4
Examples/Storyboards/StatusBarController/StatusBarController/AppStatusBarController.swift
+7
-1
Sources/iOS/NavigationBar.swift
+1
-1
Sources/iOS/StatusBarController.swift
+1
-1
Sources/iOS/TabBar.swift
+4
-4
No files found.
Examples/Programmatic/Layer/Layer/ViewController.swift
View file @
42e6257c
...
...
@@ -32,7 +32,6 @@ import UIKit
import
Material
class
ViewController
:
UIViewController
{
/// A reference to the Layer.
private
var
layer
:
Layer
!
override
func
viewDidLoad
()
{
...
...
Examples/Programmatic/NavigationController/NavigationController.xcodeproj/project.pbxproj
View file @
42e6257c
...
...
@@ -7,7 +7,6 @@
objects
=
{
/* Begin PBXBuildFile section */
9640ED151DAE115D0085CDA1
/* AppStatusBarController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9640ED141DAE115D0085CDA1
/* AppStatusBarController.swift */
;
};
96CC49CD1D8DD984002CAB55
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96CC49CC1D8DD984002CAB55
/* AppDelegate.swift */
;
};
96CC49CF1D8DD984002CAB55
/* RootViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96CC49CE1D8DD984002CAB55
/* RootViewController.swift */
;
};
96CC49D41D8DD984002CAB55
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96CC49D31D8DD984002CAB55
/* Assets.xcassets */
;
};
...
...
@@ -30,7 +29,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
9640ED141DAE115D0085CDA1
/* AppStatusBarController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppStatusBarController.swift
;
sourceTree
=
"<group>"
;
};
96CC49C91D8DD984002CAB55
/* NavigationController.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
NavigationController.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
96CC49CC1D8DD984002CAB55
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
96CC49CE1D8DD984002CAB55
/* RootViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RootViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -72,7 +70,6 @@
isa
=
PBXGroup
;
children
=
(
96CC49CC1D8DD984002CAB55
/* AppDelegate.swift */
,
9640ED141DAE115D0085CDA1
/* AppStatusBarController.swift */
,
96CC49DE1D8DD9E8002CAB55
/* AppNavigationController.swift */
,
96CC49CE1D8DD984002CAB55
/* RootViewController.swift */
,
96CC49E41D8DDF61002CAB55
/* NextViewController.swift */
,
...
...
@@ -155,7 +152,6 @@
isa
=
PBXSourcesBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
9640ED151DAE115D0085CDA1
/* AppStatusBarController.swift in Sources */
,
96CC49DF1D8DD9E8002CAB55
/* AppNavigationController.swift in Sources */
,
96CC49E51D8DDF61002CAB55
/* NextViewController.swift in Sources */
,
96CC49CF1D8DD984002CAB55
/* RootViewController.swift in Sources */
,
...
...
Examples/Programmatic/NavigationController/NavigationController/AppDelegate.swift
View file @
42e6257c
...
...
@@ -38,7 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func
applicationDidFinishLaunching
(
_
application
:
UIApplication
)
{
window
=
UIWindow
(
frame
:
Device
.
bounds
)
window
!.
rootViewController
=
App
StatusBarController
(
rootViewController
:
AppNavigationController
(
rootViewController
:
RootViewController
()
))
window
!.
rootViewController
=
App
NavigationController
(
rootViewController
:
RootViewController
(
))
window
!.
makeKeyAndVisible
()
}
}
...
...
Examples/Programmatic/NavigationController/NavigationController/AppStatusBarController.swift
deleted
100644 → 0
View file @
da92a778
/*
* 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
AppStatusBarController
:
StatusBarController
{
open
override
func
prepare
()
{
super
.
prepare
()
statusBarStyle
=
.
default
statusBar
.
backgroundColor
=
.
white
}
}
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/AppToolbarController.swift
View file @
42e6257c
...
...
@@ -43,6 +43,7 @@ class AppToolbarController: ToolbarController {
prepareMenuButton
()
prepareSwitch
()
prepareMoreButton
()
prepareStatusBar
()
prepareToolbar
()
}
...
...
@@ -70,6 +71,13 @@ class AppToolbarController: ToolbarController {
moreButton
.
addTarget
(
self
,
action
:
#selector(
handleMoreButton
)
,
for
:
.
touchUpInside
)
}
private
func
prepareStatusBar
()
{
statusBarStyle
=
.
lightContent
// Access the statusBar.
// statusBar.backgroundColor = Color.green.base
}
private
func
prepareToolbar
()
{
toolbar
.
leftViews
=
[
menuButton
]
toolbar
.
rightViews
=
[
switchControl
,
moreButton
]
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/LeftViewController.swift
View file @
42e6257c
...
...
@@ -56,6 +56,7 @@ class LeftViewController: UIViewController {
private
func
prepareTransitionButton
()
{
transitionButton
=
FlatButton
(
title
:
"Transition VC"
,
titleColor
:
.
white
)
transitionButton
.
pulseColor
=
.
white
transitionButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
view
.
layout
(
transitionButton
)
.
horizontally
()
.
center
()
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RightViewController.swift
View file @
42e6257c
...
...
@@ -42,7 +42,7 @@ class RightViewController: UIViewController {
}
@objc
internal
func
handle
Transition
Button
()
{
internal
func
handle
Root
Button
()
{
// Transition the entire NavigationDrawer rootViewController.
// navigationDrawerController?.transition(to: RootViewController(), completion: closeNavigationDrawer)
...
...
@@ -56,7 +56,8 @@ class RightViewController: UIViewController {
private
func
prepareRootButton
()
{
rootButton
=
FlatButton
(
title
:
"Root VC"
,
titleColor
:
.
white
)
rootButton
.
addTarget
(
self
,
action
:
#selector(
handleTransitionButton
)
,
for
:
.
touchUpInside
)
rootButton
.
pulseColor
=
.
white
rootButton
.
addTarget
(
self
,
action
:
#selector(
handleRootButton
)
,
for
:
.
touchUpInside
)
view
.
layout
(
rootButton
)
.
horizontally
()
.
center
()
}
...
...
Examples/Programmatic/NavigationDrawerController/NavigationDrawerController/RootViewController.swift
View file @
42e6257c
...
...
@@ -34,7 +34,8 @@ import Material
class
RootViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
white
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareToolbar
()
}
...
...
Examples/Programmatic/SearchBarController/SearchBarController/AppSearchBarController.swift
View file @
42e6257c
...
...
@@ -55,7 +55,7 @@ class AppSearchBarController: SearchBarController {
statusBarStyle
=
.
lightContent
// Access the statusBar.
// statusBar.backgroundColor =
.green
// statusBar.backgroundColor =
Color.green.base
}
private
func
prepareSearchBar
()
{
...
...
Examples/Programmatic/StatusBarController/StatusBarController/AppStatusBarController.swift
View file @
42e6257c
...
...
@@ -34,7 +34,13 @@ import Material
class
AppStatusBarController
:
StatusBarController
{
open
override
func
prepare
()
{
super
.
prepare
()
statusBarStyle
=
.
default
prepareStatusBar
()
}
private
func
prepareStatusBar
()
{
statusBarStyle
=
.
lightContent
statusBar
.
backgroundColor
=
Color
.
blue
.
base
}
}
Examples/Programmatic/TabBar/TabBar/ViewController.swift
View file @
42e6257c
...
...
@@ -32,10 +32,7 @@ import UIKit
import
Material
class
ViewController
:
UIViewController
{
/// Buttons for the TabBar.
private
lazy
var
buttons
=
[
Button
]()
/// A reference to the TabBar.
private
var
tabBar
:
TabBar
!
override
func
viewDidLoad
()
{
...
...
@@ -62,6 +59,7 @@ class ViewController: UIViewController {
private
func
prepareTabBar
()
{
tabBar
=
TabBar
()
tabBar
.
delegate
=
self
tabBar
.
dividerColor
=
Color
.
grey
.
lighten3
tabBar
.
dividerAlignment
=
.
top
...
...
@@ -76,3 +74,13 @@ class ViewController: UIViewController {
}
}
extension
ViewController
:
TabBarDelegate
{
func
tabBar
(
tabBar
:
TabBar
,
willSelect
button
:
UIButton
)
{
print
(
"will select"
)
}
func
tabBar
(
tabBar
:
TabBar
,
didSelect
button
:
UIButton
)
{
print
(
"did select"
)
}
}
Examples/Programmatic/TextField/TextField/ViewController.swift
View file @
42e6257c
...
...
@@ -87,9 +87,9 @@ class ViewController: UIViewController {
emailField
.
isClearIconButtonEnabled
=
true
emailField
.
delegate
=
self
emailField
.
placeholderNormalColor
=
amber
.
darken4
emailField
.
placeholderActiveColor
=
pink
.
base
emailField
.
dividerNormalColor
=
cyan
.
base
emailField
.
placeholderNormalColor
=
Color
.
amber
.
darken4
emailField
.
placeholderActiveColor
=
Color
.
pink
.
base
emailField
.
dividerNormalColor
=
Color
.
cyan
.
base
view
.
addSubview
(
emailField
)
}
...
...
Examples/Programmatic/View/View/ViewController.swift
View file @
42e6257c
...
...
@@ -32,17 +32,16 @@ import UIKit
import
Material
class
ViewController
:
UIViewController
{
/// A reference to the View.
private
var
logo
:
View
!
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
white
prepare
Logo
()
prepare
View
()
}
private
func
prepare
Logo
()
{
private
func
prepare
View
()
{
let
d
:
CGFloat
=
100
logo
=
View
()
...
...
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AppBottomNavigationController.swift
View file @
42e6257c
...
...
@@ -39,6 +39,6 @@ class AppBottomNavigationController: BottomNavigationController {
private
func
prepareTabBar
()
{
tabBar
.
depthPreset
=
.
none
tabBar
.
dividerColor
=
.
grey
.
lighten3
tabBar
.
dividerColor
=
Color
.
grey
.
lighten3
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/AudioViewController.swift
View file @
42e6257c
...
...
@@ -39,12 +39,12 @@ class AudioViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
blue
.
base
view
.
backgroundColor
=
Color
.
blue
.
base
}
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
.
blue
.
base
)
tabBarItem
.
image
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
audioLibrary
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/PhotoViewController.swift
View file @
42e6257c
...
...
@@ -39,12 +39,12 @@ class PhotoViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
red
.
base
view
.
backgroundColor
=
Color
.
red
.
base
}
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
.
blue
.
base
)
tabBarItem
.
image
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
photoCamera
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/RemindersViewController.swift
View file @
42e6257c
...
...
@@ -39,12 +39,12 @@ class RemindersViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
yellow
.
base
view
.
backgroundColor
=
Color
.
yellow
.
base
}
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
.
blue
.
base
)
tabBarItem
.
image
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
bell
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
Examples/Storyboards/BottomNavigationController/BottomNavigationController/SearchViewController.swift
View file @
42e6257c
...
...
@@ -39,12 +39,12 @@ class SearchViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
blueGrey
.
base
view
.
backgroundColor
=
Color
.
blueGrey
.
base
}
private
func
prepareTabBarItem
()
{
tabBarItem
.
title
=
nil
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
.
blue
.
base
)
tabBarItem
.
image
=
Icon
.
cm
.
search
?
.
tint
(
with
:
Color
.
blueGrey
.
base
)
tabBarItem
.
selectedImage
=
Icon
.
cm
.
search
?
.
tint
(
with
:
Color
.
blue
.
base
)
}
}
Examples/Storyboards/NavigationController/NavigationController/AppNavigationController.swift
View file @
42e6257c
...
...
@@ -34,7 +34,12 @@ import Material
class
AppNavigationController
:
NavigationController
{
open
override
func
prepare
()
{
super
.
prepare
()
statusBarStyle
=
.
default
guard
let
v
=
navigationBar
as?
NavigationBar
else
{
return
}
v
.
depthPreset
=
.
none
v
.
dividerColor
=
Color
.
grey
.
lighten3
}
}
Examples/Storyboards/NavigationController/NavigationController/NextViewController.swift
View file @
42e6257c
...
...
@@ -34,7 +34,7 @@ import Material
class
NextViewController
:
UIViewController
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
Color
.
grey
.
base
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareNavigationItem
()
}
...
...
@@ -43,7 +43,8 @@ class NextViewController: UIViewController {
navigationItem
.
title
=
"Title"
navigationItem
.
detail
=
"Detail Description"
navigationItem
.
backButton
.
tintColor
=
Color
.
blue
.
base
// Access the back button.
// navigationItem.backButton.tintColor = .white
}
}
Examples/Storyboards/NavigationController/NavigationController/RootViewController.swift
View file @
42e6257c
...
...
@@ -42,7 +42,7 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
Color
.
grey
.
lighten
1
view
.
backgroundColor
=
Color
.
grey
.
lighten
5
prepareMenuButton
()
prepareStarButton
()
...
...
@@ -77,6 +77,7 @@ class RootViewController: UIViewController {
private
func
prepareNextButton
()
{
nextButton
=
FlatButton
()
nextButton
.
pulseAnimation
=
.
none
nextButton
.
addTarget
(
self
,
action
:
#selector(
handleNextButton
)
,
for
:
.
touchUpInside
)
view
.
layout
(
nextButton
)
.
edges
()
}
...
...
Examples/Storyboards/SearchBarController/SearchBarController/AppSearchBarController.swift
View file @
42e6257c
...
...
@@ -32,9 +32,35 @@ import UIKit
import
Material
class
AppSearchBarController
:
SearchBarController
{
private
var
menuButton
:
IconButton
!
private
var
moreButton
:
IconButton
!
open
override
func
prepare
()
{
super
.
prepare
()
statusBarStyle
=
.
default
prepareMenuButton
()
prepareMoreButton
()
prepareStatusBar
()
prepareSearchBar
()
}
private
func
prepareMenuButton
()
{
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
)
}
private
func
prepareMoreButton
()
{
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreVertical
)
}
private
func
prepareStatusBar
()
{
statusBarStyle
=
.
lightContent
// Access the statusBar.
// statusBar.backgroundColor = Color.green.base
}
private
func
prepareSearchBar
()
{
searchBar
.
leftViews
=
[
menuButton
]
searchBar
.
rightViews
=
[
moreButton
]
}
}
Examples/Storyboards/SearchBarController/SearchBarController/RootViewController.swift
View file @
42e6257c
...
...
@@ -32,37 +32,18 @@ import UIKit
import
Material
class
RootViewController
:
UIViewController
{
private
var
menuButton
:
IconButton
!
private
var
moreButton
:
IconButton
!
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
Color
.
grey
.
lighten1
}
open
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareMenuButton
()
prepareMoreButton
()
prepareSearchBar
()
}
private
func
prepareMenuButton
()
{
menuButton
=
IconButton
(
image
:
Icon
.
cm
.
menu
)
}
private
func
prepareMoreButton
()
{
moreButton
=
IconButton
(
image
:
Icon
.
cm
.
moreVertical
)
}
private
func
prepareSearchBar
()
{
guard
let
sc
=
searchBarController
else
{
return
}
sc
.
searchBar
.
leftViews
=
[
menuButton
]
sc
.
searchBar
.
rightViews
=
[
moreButton
]
// Access the searchBar.
// guard let searchBar = searchBarController?.searchBar else {
// return
// }
}
}
Examples/Storyboards/SnackbarController/SnackbarController/AppSnackbarController.swift
View file @
42e6257c
...
...
@@ -39,19 +39,19 @@ class AppSnackbarController: SnackbarController {
}
extension
AppSnackbarController
:
SnackbarControllerDelegate
{
func
snackbarController
WillShow
(
snackbarController
:
SnackbarControlle
r
)
{
print
(
"snackbarController
WillS
how"
)
func
snackbarController
(
snackbarController
:
SnackbarController
,
willShow
snackbar
:
Snackba
r
)
{
print
(
"snackbarController
will s
how"
)
}
func
snackbarController
WillHide
(
snackbarController
:
SnackbarControlle
r
)
{
print
(
"snackbarController
WillH
ide"
)
func
snackbarController
(
snackbarController
:
SnackbarController
,
willHide
snackbar
:
Snackba
r
)
{
print
(
"snackbarController
will h
ide"
)
}
func
snackbarController
DidShow
(
snackbarController
:
SnackbarControlle
r
)
{
print
(
"snackbarController
DidS
how"
)
func
snackbarController
(
snackbarController
:
SnackbarController
,
didShow
snackbar
:
Snackba
r
)
{
print
(
"snackbarController
did s
how"
)
}
func
snackbarController
DidHide
(
snackbarController
:
SnackbarControlle
r
)
{
print
(
"snackbarController
DidH
ide"
)
func
snackbarController
(
snackbarController
:
SnackbarController
,
didHide
snackbar
:
Snackba
r
)
{
print
(
"snackbarController
did h
ide"
)
}
}
Examples/Storyboards/SnackbarController/SnackbarController/RootViewController.swift
View file @
42e6257c
...
...
@@ -37,12 +37,13 @@ class RootViewController: UIViewController {
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
Color
.
grey
.
lighten5
prepareUndoButton
()
}
open
override
func
viewDidAppear
(
_
animated
:
Bool
)
{
super
.
viewDidAppear
(
animated
)
prepareUndoButton
()
prepareSnackbar
()
animateSnackbar
()
scheduleAnimation
()
...
...
@@ -55,12 +56,12 @@ class RootViewController: UIViewController {
}
private
func
prepareSnackbar
()
{
guard
let
s
c
=
snackbarControlle
r
else
{
guard
let
s
nackbar
=
snackbarController
?
.
snackba
r
else
{
return
}
s
c
.
s
nackbar
.
text
=
"Reminder saved."
s
c
.
s
nackbar
.
rightViews
=
[
undoButton
]
snackbar
.
text
=
"Reminder saved."
snackbar
.
rightViews
=
[
undoButton
]
}
private
func
scheduleAnimation
()
{
...
...
Examples/Storyboards/StatusBarController/StatusBarController/AppStatusBarController.swift
View file @
42e6257c
...
...
@@ -34,7 +34,13 @@ import Material
class
AppStatusBarController
:
StatusBarController
{
open
override
func
prepare
()
{
super
.
prepare
()
statusBarStyle
=
.
default
prepareStatusBar
()
}
private
func
prepareStatusBar
()
{
statusBarStyle
=
.
lightContent
statusBar
.
backgroundColor
=
Color
.
blue
.
base
}
}
Sources/iOS/NavigationBar.swift
View file @
42e6257c
...
...
@@ -37,7 +37,7 @@ open class NavigationBar: UINavigationBar {
}
open
override
var
intrinsicContentSize
:
CGSize
{
return
CGSize
(
width
:
width
,
height
:
height
)
return
CGSize
(
width
:
Device
.
width
,
height
:
height
)
}
/// A preset wrapper around contentEdgeInsets.
...
...
Sources/iOS/StatusBarController.swift
View file @
42e6257c
...
...
@@ -78,7 +78,7 @@ open class StatusBarController: RootController {
/// Prepares the statusBar.
private
func
prepareStatusBar
()
{
statusBar
.
zPosition
=
3000
statusBar
.
backgroundColor
=
Color
.
grey
.
lighten3
statusBar
.
backgroundColor
=
.
white
view
.
layout
(
statusBar
)
.
top
()
.
horizontally
()
.
height
(
20
)
}
}
Sources/iOS/TabBar.swift
View file @
42e6257c
...
...
@@ -45,7 +45,7 @@ public protocol TabBarDelegate {
- Parameter button: A UIButton.
*/
@objc
optional
func
tabBar
WillSelectButton
(
tabBar
:
TabBar
,
button
:
UIButton
)
optional
func
tabBar
(
tabBar
:
TabBar
,
willSelect
button
:
UIButton
)
/**
A delegation method that is executed when the button did complete the
...
...
@@ -54,7 +54,7 @@ public protocol TabBarDelegate {
- Parameter button: A UIButton.
*/
@objc
optional
func
tabBar
DidSelectButton
(
tabBar
:
TabBar
,
button
:
UIButton
)
optional
func
tabBar
(
tabBar
:
TabBar
,
didSelect
button
:
UIButton
)
}
open
class
TabBar
:
Bar
{
...
...
@@ -174,7 +174,7 @@ open class TabBar: Bar {
- Paramater completion: An optional completion block.
*/
open
func
animate
(
to
button
:
UIButton
,
completion
:
((
UIButton
)
->
Void
)?
=
nil
)
{
delegate
?
.
tabBar
WillSelectButton
?(
tabBar
:
self
,
button
:
button
)
delegate
?
.
tabBar
?(
tabBar
:
self
,
willSelect
:
button
)
selected
=
button
isAnimating
=
true
UIView
.
animate
(
withDuration
:
0.25
,
animations
:
{
[
weak
self
,
button
=
button
]
in
...
...
@@ -188,7 +188,7 @@ open class TabBar: Bar {
return
}
s
.
isAnimating
=
false
s
.
delegate
?
.
tabBar
DidSelectButton
?(
tabBar
:
s
,
button
:
button
)
s
.
delegate
?
.
tabBar
?(
tabBar
:
s
,
didSelect
:
button
)
completion
?(
button
)
}
}
...
...
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