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
4dbaa51d
Commit
4dbaa51d
authored
May 10, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted sizing for NavigationBar
parent
beff5c45
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
135 additions
and
118 deletions
+135
-118
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
+6
-6
Examples/Programmatic/App/App/ItemViewController.swift
+10
-21
Examples/Programmatic/App/App/RecipesViewController.swift
+4
-10
Examples/Programmatic/CardView/CardView/ViewController.swift
+3
-3
Examples/Programmatic/ImageCardView/ImageCardView/ViewController.swift
+1
-1
Examples/Programmatic/MaterialIcon/MaterialIcon/ViewController.swift
+1
-1
Examples/Programmatic/TableCardView/TableCardView/ViewController.swift
+3
-3
Examples/Storyboards/CardView/CardView/ViewController.swift
+2
-2
Sources/iOS/CardView.swift
+23
-23
Sources/iOS/ControlView.swift
+6
-6
Sources/iOS/ImageCardView.swift
+26
-26
Sources/iOS/MaterialButton.swift
+4
-0
Sources/iOS/NavigationBar.swift
+0
-0
Sources/iOS/NavigationController.swift
+1
-1
Sources/iOS/NavigationItem.swift
+26
-8
Sources/iOS/SearchBar.swift
+9
-3
Sources/iOS/StatusBarView.swift
+1
-1
Sources/iOS/Toolbar.swift
+9
-3
No files found.
Examples/Programmatic/App/App.xcodeproj/project.pbxproj
View file @
4dbaa51d
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
/* Begin PBXBuildFile section */
/* Begin PBXBuildFile section */
96162C6C1CA71C8700E3A235
/* VideoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
;
};
96162C6C1CA71C8700E3A235
/* VideoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
;
};
96162C6E1CA7274E00E3A235
/* PhotoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
;
};
96162C6E1CA7274E00E3A235
/* PhotoViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
;
};
961F19
2F1CE14C3E008927C5
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961F192E1CE14C3E
008927C5
/* Material.framework */
;
};
961F19
321CE2579D008927C5
/* Material.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961F19311CE2579D
008927C5
/* Material.framework */
;
};
961F193
01CE14C3E008927C5
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961F192E1CE14C3E
008927C5
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
961F193
31CE2579D008927C5
/* Material.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
961F19311CE2579D
008927C5
/* Material.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
9663F9321C7A744600AF0965
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9311C7A744600AF0965
/* AppDelegate.swift */
;
};
9663F9321C7A744600AF0965
/* AppDelegate.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9311C7A744600AF0965
/* AppDelegate.swift */
;
};
9663F9341C7A744600AF0965
/* RecommendationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9331C7A744600AF0965
/* RecommendationViewController.swift */
;
};
9663F9341C7A744600AF0965
/* RecommendationViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9331C7A744600AF0965
/* RecommendationViewController.swift */
;
};
9663F9391C7A744600AF0965
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9381C7A744600AF0965
/* Assets.xcassets */
;
};
9663F9391C7A744600AF0965
/* Assets.xcassets in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9663F9381C7A744600AF0965
/* Assets.xcassets */
;
};
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
dstPath
=
""
;
dstPath
=
""
;
dstSubfolderSpec
=
10
;
dstSubfolderSpec
=
10
;
files
=
(
files
=
(
961F193
01CE14C3E
008927C5
/* Material.framework in Embed Frameworks */
,
961F193
31CE2579D
008927C5
/* Material.framework in Embed Frameworks */
,
);
);
name
=
"Embed Frameworks"
;
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
VideoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6B1CA71C8700E3A235
/* VideoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
VideoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PhotoViewController.swift
;
sourceTree
=
"<group>"
;
};
96162C6D1CA7274E00E3A235
/* PhotoViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
PhotoViewController.swift
;
sourceTree
=
"<group>"
;
};
961F19
2E1CE14C3E008927C5
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-bshwisidfobstlbomegqyybbrygh
/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
961F19
311CE2579D008927C5
/* Material.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
name
=
Material.framework
;
path
=
"/Users/danieldahan/Library/Developer/Xcode/DerivedData/CosmicMind-hgvxkqfizbxkrsfcxbtlafgqkbve
/Build/Products/Debug-iphoneos/Material.framework"
;
sourceTree
=
"<absolute>"
;
};
9663F92E1C7A744600AF0965
/* App.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
App.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9663F92E1C7A744600AF0965
/* App.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
App.app
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9663F9311C7A744600AF0965
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
9663F9311C7A744600AF0965
/* AppDelegate.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
AppDelegate.swift
;
sourceTree
=
"<group>"
;
};
9663F9331C7A744600AF0965
/* RecommendationViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RecommendationViewController.swift
;
sourceTree
=
"<group>"
;
};
9663F9331C7A744600AF0965
/* RecommendationViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RecommendationViewController.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
isa
=
PBXFrameworksBuildPhase
;
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
961F19
2F1CE14C3E
008927C5
/* Material.framework in Frameworks */
,
961F19
321CE2579D
008927C5
/* Material.framework in Frameworks */
,
);
);
runOnlyForDeploymentPostprocessing
=
0
;
runOnlyForDeploymentPostprocessing
=
0
;
};
};
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
9663F9251C7A744500AF0965
=
{
9663F9251C7A744500AF0965
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
961F19
2E1CE14C3E
008927C5
/* Material.framework */
,
961F19
311CE2579D
008927C5
/* Material.framework */
,
9663F9301C7A744600AF0965
/* App */
,
9663F9301C7A744600AF0965
/* App */
,
9663F92F1C7A744600AF0965
/* Products */
,
9663F92F1C7A744600AF0965
/* Products */
,
);
);
...
...
Examples/Programmatic/App/App/ItemViewController.swift
View file @
4dbaa51d
...
@@ -66,7 +66,6 @@ class ItemViewController: UIViewController {
...
@@ -66,7 +66,6 @@ class ItemViewController: UIViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
prepareTitleLabel
()
prepareShareButton
()
prepareShareButton
()
prepareNavigationItem
()
prepareNavigationItem
()
prepareScrollView
()
prepareScrollView
()
...
@@ -101,22 +100,6 @@ class ItemViewController: UIViewController {
...
@@ -101,22 +100,6 @@ class ItemViewController: UIViewController {
automaticallyAdjustsScrollViewInsets
=
false
automaticallyAdjustsScrollViewInsets
=
false
}
}
/// Prepares the titleLabel.
private
func
prepareTitleLabel
()
{
titleLabel
=
UILabel
()
titleLabel
.
text
=
"Item"
titleLabel
.
textAlignment
=
.
Left
titleLabel
.
textColor
=
MaterialColor
.
white
}
/// Prepares the detailLabel.
private
func
prepareDetailLabel
()
{
detailLabel
=
UILabel
()
detailLabel
.
text
=
"January 22, 2016"
detailLabel
.
textAlignment
=
.
Left
detailLabel
.
textColor
=
MaterialColor
.
white
}
/// Prepares the shareButton.
/// Prepares the shareButton.
private
func
prepareShareButton
()
{
private
func
prepareShareButton
()
{
let
image
:
UIImage
?
=
MaterialIcon
.
cm
.
share
let
image
:
UIImage
?
=
MaterialIcon
.
cm
.
share
...
@@ -128,8 +111,14 @@ class ItemViewController: UIViewController {
...
@@ -128,8 +111,14 @@ class ItemViewController: UIViewController {
/// Prepares the navigationItem.
/// Prepares the navigationItem.
private
func
prepareNavigationItem
()
{
private
func
prepareNavigationItem
()
{
navigationItem
.
titleLabel
=
titleLabel
navigationItem
.
title
=
"Item"
navigationItem
.
detailLabel
=
detailLabel
navigationItem
.
titleLabel
.
textAlignment
=
.
Left
navigationItem
.
titleLabel
.
textColor
=
MaterialColor
.
white
navigationItem
.
detail
=
"January 22, 2016"
navigationItem
.
detailLabel
.
textAlignment
=
.
Left
navigationItem
.
detailLabel
.
textColor
=
MaterialColor
.
white
navigationItem
.
rightControls
=
[
shareButton
]
navigationItem
.
rightControls
=
[
shareButton
]
}
}
...
@@ -163,8 +152,8 @@ class ItemViewController: UIViewController {
...
@@ -163,8 +152,8 @@ class ItemViewController: UIViewController {
detailLabel
.
font
=
RobotoFont
.
regular
detailLabel
.
font
=
RobotoFont
.
regular
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
imageCardView
.
detail
View
=
detailLabel
imageCardView
.
content
View
=
detailLabel
imageCardView
.
detail
ViewInset
.
top
=
52
imageCardView
.
content
ViewInset
.
top
=
52
let
image
:
UIImage
?
=
UIImage
(
named
:
data
[
"image"
]
as!
String
)
let
image
:
UIImage
?
=
UIImage
(
named
:
data
[
"image"
]
as!
String
)
imageCardView
.
image
=
image
imageCardView
.
image
=
image
...
...
Examples/Programmatic/App/App/RecipesViewController.swift
View file @
4dbaa51d
...
@@ -54,7 +54,6 @@ class RecipesViewController: UIViewController {
...
@@ -54,7 +54,6 @@ class RecipesViewController: UIViewController {
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepareView
()
prepareView
()
prepareItems
()
prepareItems
()
prepareTitleLabel
()
prepareMenuButton
()
prepareMenuButton
()
prepareSwitchControl
()
prepareSwitchControl
()
prepareSearchButton
()
prepareSearchButton
()
...
@@ -218,14 +217,6 @@ class RecipesViewController: UIViewController {
...
@@ -218,14 +217,6 @@ class RecipesViewController: UIViewController {
view
.
backgroundColor
=
MaterialColor
.
white
view
.
backgroundColor
=
MaterialColor
.
white
}
}
/// Prepares the titleLabel.
private
func
prepareTitleLabel
()
{
titleLabel
=
UILabel
()
titleLabel
.
text
=
"Recipes"
titleLabel
.
textAlignment
=
.
Left
titleLabel
.
textColor
=
MaterialColor
.
white
}
/// Prepares the menuButton.
/// Prepares the menuButton.
private
func
prepareMenuButton
()
{
private
func
prepareMenuButton
()
{
let
image
:
UIImage
?
=
MaterialIcon
.
cm
.
menu
let
image
:
UIImage
?
=
MaterialIcon
.
cm
.
menu
...
@@ -253,7 +244,10 @@ class RecipesViewController: UIViewController {
...
@@ -253,7 +244,10 @@ class RecipesViewController: UIViewController {
/// Prepares the navigationItem.
/// Prepares the navigationItem.
private
func
prepareNavigationItem
()
{
private
func
prepareNavigationItem
()
{
navigationItem
.
titleLabel
=
titleLabel
navigationItem
.
title
=
"Recipes"
navigationItem
.
titleLabel
.
textAlignment
=
.
Left
navigationItem
.
titleLabel
.
textColor
=
MaterialColor
.
white
navigationItem
.
leftControls
=
[
menuButton
]
navigationItem
.
leftControls
=
[
menuButton
]
navigationItem
.
rightControls
=
[
switchControl
,
searchButton
]
navigationItem
.
rightControls
=
[
switchControl
,
searchButton
]
}
}
...
...
Examples/Programmatic/CardView/CardView/ViewController.swift
View file @
4dbaa51d
...
@@ -61,7 +61,7 @@ class ViewController: UIViewController {
...
@@ -61,7 +61,7 @@ class ViewController: UIViewController {
let
detailLabel
:
UILabel
=
UILabel
()
let
detailLabel
:
UILabel
=
UILabel
()
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
cardView
.
detail
View
=
detailLabel
cardView
.
content
View
=
detailLabel
// Yes button.
// Yes button.
let
btn1
:
FlatButton
=
FlatButton
()
let
btn1
:
FlatButton
=
FlatButton
()
...
@@ -106,7 +106,7 @@ class ViewController: UIViewController {
...
@@ -106,7 +106,7 @@ class ViewController: UIViewController {
detailLabel
.
text
=
"Beautiful Material Design"
detailLabel
.
text
=
"Beautiful Material Design"
detailLabel
.
textColor
=
MaterialColor
.
white
detailLabel
.
textColor
=
MaterialColor
.
white
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
cardView
.
detail
View
=
detailLabel
cardView
.
content
View
=
detailLabel
// Share button.
// Share button.
let
img1
:
UIImage
?
=
MaterialIcon
.
cm
.
share
let
img1
:
UIImage
?
=
MaterialIcon
.
cm
.
share
...
@@ -147,7 +147,7 @@ class ViewController: UIViewController {
...
@@ -147,7 +147,7 @@ class ViewController: UIViewController {
detailLabel
.
text
=
"Data-Driven Framework"
detailLabel
.
text
=
"Data-Driven Framework"
detailLabel
.
textColor
=
MaterialColor
.
white
detailLabel
.
textColor
=
MaterialColor
.
white
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
cardView
.
detail
View
=
detailLabel
cardView
.
content
View
=
detailLabel
// Share button.
// Share button.
let
img1
:
UIImage
?
=
MaterialIcon
.
cm
.
share
let
img1
:
UIImage
?
=
MaterialIcon
.
cm
.
share
...
...
Examples/Programmatic/ImageCardView/ImageCardView/ViewController.swift
View file @
4dbaa51d
...
@@ -65,7 +65,7 @@ class ViewController: UIViewController {
...
@@ -65,7 +65,7 @@ class ViewController: UIViewController {
let
detailLabel
:
UILabel
=
UILabel
()
let
detailLabel
:
UILabel
=
UILabel
()
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
imageCardView
.
detail
View
=
detailLabel
imageCardView
.
content
View
=
detailLabel
// Yes button.
// Yes button.
let
btn1
:
FlatButton
=
FlatButton
()
let
btn1
:
FlatButton
=
FlatButton
()
...
...
Examples/Programmatic/MaterialIcon/MaterialIcon/ViewController.swift
View file @
4dbaa51d
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
*/
*/
/*
/*
The following is an example of setting a UITableView as the
detail
View for a
The following is an example of setting a UITableView as the
content
View for a
CardView.
CardView.
*/
*/
...
...
Examples/Programmatic/TableCardView/TableCardView/ViewController.swift
View file @
4dbaa51d
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
*/
*/
/*
/*
The following is an example of setting a UITableView as the
detail
View for a
The following is an example of setting a UITableView as the
content
View for a
CardView.
CardView.
*/
*/
...
@@ -91,7 +91,7 @@ class ViewController: UIViewController {
...
@@ -91,7 +91,7 @@ class ViewController: UIViewController {
cardView
.
contentInsetPreset
=
.
None
cardView
.
contentInsetPreset
=
.
None
cardView
.
leftButtonsInsetPreset
=
.
Square2
cardView
.
leftButtonsInsetPreset
=
.
Square2
cardView
.
rightButtonsInsetPreset
=
.
Square2
cardView
.
rightButtonsInsetPreset
=
.
Square2
cardView
.
detail
ViewInsetPreset
=
.
None
cardView
.
content
ViewInsetPreset
=
.
None
let
titleLabel
:
UILabel
=
UILabel
()
let
titleLabel
:
UILabel
=
UILabel
()
titleLabel
.
font
=
RobotoFont
.
mediumWithSize
(
20
)
titleLabel
.
font
=
RobotoFont
.
mediumWithSize
(
20
)
...
@@ -113,7 +113,7 @@ class ViewController: UIViewController {
...
@@ -113,7 +113,7 @@ class ViewController: UIViewController {
// Use MaterialLayout to easily align the tableView.
// Use MaterialLayout to easily align the tableView.
cardView
.
titleLabel
=
titleLabel
cardView
.
titleLabel
=
titleLabel
cardView
.
detail
View
=
tableView
cardView
.
content
View
=
tableView
cardView
.
leftButtons
=
[
closeButton
]
cardView
.
leftButtons
=
[
closeButton
]
cardView
.
rightButtons
=
[
settingButton
]
cardView
.
rightButtons
=
[
settingButton
]
...
...
Examples/Storyboards/CardView/CardView/ViewController.swift
View file @
4dbaa51d
...
@@ -60,7 +60,7 @@ class ViewController: UIViewController {
...
@@ -60,7 +60,7 @@ class ViewController: UIViewController {
let
detailLabel
:
UILabel
=
UILabel
()
let
detailLabel
:
UILabel
=
UILabel
()
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
topCardView
.
detail
View
=
detailLabel
topCardView
.
content
View
=
detailLabel
// Yes button.
// Yes button.
let
btn1
:
FlatButton
=
FlatButton
()
let
btn1
:
FlatButton
=
FlatButton
()
...
@@ -91,7 +91,7 @@ class ViewController: UIViewController {
...
@@ -91,7 +91,7 @@ class ViewController: UIViewController {
let
detailLabel
:
UILabel
=
UILabel
()
let
detailLabel
:
UILabel
=
UILabel
()
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
text
=
"It’s been a while, have you read any new books lately?"
detailLabel
.
numberOfLines
=
0
detailLabel
.
numberOfLines
=
0
bottomCardView
.
detail
View
=
detailLabel
bottomCardView
.
content
View
=
detailLabel
// Yes button.
// Yes button.
let
btn1
:
FlatButton
=
FlatButton
()
let
btn1
:
FlatButton
=
FlatButton
()
...
...
Sources/iOS/CardView.swift
View file @
4dbaa51d
...
@@ -119,29 +119,29 @@ public class CardView : MaterialPulseView {
...
@@ -119,29 +119,29 @@ public class CardView : MaterialPulseView {
}
}
/**
/**
:name:
detail
ViewInsets
:name:
content
ViewInsets
*/
*/
public
var
detail
ViewInsetPreset
:
MaterialEdgeInset
=
.
Square2
{
public
var
content
ViewInsetPreset
:
MaterialEdgeInset
=
.
Square2
{
didSet
{
didSet
{
detailViewInset
=
MaterialEdgeInsetToValue
(
detail
ViewInsetPreset
)
contentViewInset
=
MaterialEdgeInsetToValue
(
content
ViewInsetPreset
)
}
}
}
}
/**
/**
:name:
detail
ViewInset
:name:
content
ViewInset
*/
*/
@IBInspectable
public
var
detail
ViewInset
:
UIEdgeInsets
=
MaterialEdgeInsetToValue
(
.
Square2
)
{
@IBInspectable
public
var
content
ViewInset
:
UIEdgeInsets
=
MaterialEdgeInsetToValue
(
.
Square2
)
{
didSet
{
didSet
{
reloadView
()
reloadView
()
}
}
}
}
/**
/**
:name:
detail
View
:name:
content
View
*/
*/
@IBInspectable
public
var
detail
View
:
UIView
?
{
@IBInspectable
public
var
content
View
:
UIView
?
{
didSet
{
didSet
{
detail
View
?
.
translatesAutoresizingMaskIntoConstraints
=
false
content
View
?
.
translatesAutoresizingMaskIntoConstraints
=
false
reloadView
()
reloadView
()
}
}
}
}
...
@@ -234,9 +234,9 @@ public class CardView : MaterialPulseView {
...
@@ -234,9 +234,9 @@ public class CardView : MaterialPulseView {
/**
/**
:name: init
:name: init
*/
*/
public
convenience
init
?(
image
:
UIImage
?
=
nil
,
titleLabel
:
UILabel
?
=
nil
,
detail
View
:
UIView
?
=
nil
,
leftButtons
:
Array
<
UIButton
>
?
=
nil
,
rightButtons
:
Array
<
UIButton
>
?
=
nil
)
{
public
convenience
init
?(
image
:
UIImage
?
=
nil
,
titleLabel
:
UILabel
?
=
nil
,
content
View
:
UIView
?
=
nil
,
leftButtons
:
Array
<
UIButton
>
?
=
nil
,
rightButtons
:
Array
<
UIButton
>
?
=
nil
)
{
self
.
init
(
frame
:
CGRectZero
)
self
.
init
(
frame
:
CGRectZero
)
prepareProperties
(
image
,
titleLabel
:
titleLabel
,
detailView
:
detail
View
,
leftButtons
:
leftButtons
,
rightButtons
:
rightButtons
)
prepareProperties
(
image
,
titleLabel
:
titleLabel
,
contentView
:
content
View
,
leftButtons
:
leftButtons
,
rightButtons
:
rightButtons
)
}
}
/**
/**
...
@@ -279,9 +279,9 @@ public class CardView : MaterialPulseView {
...
@@ -279,9 +279,9 @@ public class CardView : MaterialPulseView {
if
nil
!=
titleLabel
{
if
nil
!=
titleLabel
{
verticalFormat
+=
"-(insetTop)"
verticalFormat
+=
"-(insetTop)"
metrics
[
"insetTop"
]
=
contentInset
.
top
+
titleLabelInset
.
top
metrics
[
"insetTop"
]
=
contentInset
.
top
+
titleLabelInset
.
top
}
else
if
nil
!=
detail
View
{
}
else
if
nil
!=
content
View
{
verticalFormat
+=
"-(insetTop)"
verticalFormat
+=
"-(insetTop)"
metrics
[
"insetTop"
]
=
contentInset
.
top
+
detail
ViewInset
.
top
metrics
[
"insetTop"
]
=
contentInset
.
top
+
content
ViewInset
.
top
}
}
// title
// title
...
@@ -295,20 +295,20 @@ public class CardView : MaterialPulseView {
...
@@ -295,20 +295,20 @@ public class CardView : MaterialPulseView {
}
}
// detail
// detail
if
let
v
:
UIView
=
detail
View
{
if
let
v
:
UIView
=
content
View
{
addSubview
(
v
)
addSubview
(
v
)
if
nil
==
titleLabel
{
if
nil
==
titleLabel
{
metrics
[
"insetTop"
]
=
(
metrics
[
"insetTop"
]
as!
CGFloat
)
+
detail
ViewInset
.
top
metrics
[
"insetTop"
]
=
(
metrics
[
"insetTop"
]
as!
CGFloat
)
+
content
ViewInset
.
top
}
else
{
}
else
{
verticalFormat
+=
"-(insetB)"
verticalFormat
+=
"-(insetB)"
metrics
[
"insetB"
]
=
titleLabelInset
.
bottom
+
detail
ViewInset
.
top
metrics
[
"insetB"
]
=
titleLabelInset
.
bottom
+
content
ViewInset
.
top
}
}
verticalFormat
+=
"-[
detail
View]"
verticalFormat
+=
"-[
content
View]"
views
[
"
detail
View"
]
=
v
views
[
"
content
View"
]
=
v
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
v
,
left
:
contentInset
.
left
+
detailViewInset
.
left
,
right
:
contentInset
.
right
+
detail
ViewInset
.
right
)
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
v
,
left
:
contentInset
.
left
+
contentViewInset
.
left
,
right
:
contentInset
.
right
+
content
ViewInset
.
right
)
}
}
// leftButtons
// leftButtons
...
@@ -382,11 +382,11 @@ public class CardView : MaterialPulseView {
...
@@ -382,11 +382,11 @@ public class CardView : MaterialPulseView {
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
rightButtonsInset
.
bottom
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
rightButtonsInset
.
bottom
}
}
if
nil
!=
detail
View
{
if
nil
!=
content
View
{
if
nil
==
metrics
[
"insetC"
]
{
if
nil
==
metrics
[
"insetC"
]
{
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
else
{
}
else
{
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
}
}
else
if
nil
!=
titleLabel
{
}
else
if
nil
!=
titleLabel
{
if
nil
==
metrics
[
"insetC"
]
{
if
nil
==
metrics
[
"insetC"
]
{
...
@@ -430,10 +430,10 @@ public class CardView : MaterialPulseView {
...
@@ -430,10 +430,10 @@ public class CardView : MaterialPulseView {
/**
/**
:name: prepareProperties
:name: prepareProperties
*/
*/
internal
func
prepareProperties
(
image
:
UIImage
?,
titleLabel
:
UILabel
?,
detail
View
:
UIView
?,
leftButtons
:
Array
<
UIButton
>
?,
rightButtons
:
Array
<
UIButton
>
?)
{
internal
func
prepareProperties
(
image
:
UIImage
?,
titleLabel
:
UILabel
?,
content
View
:
UIView
?,
leftButtons
:
Array
<
UIButton
>
?,
rightButtons
:
Array
<
UIButton
>
?)
{
self
.
image
=
image
self
.
image
=
image
self
.
titleLabel
=
titleLabel
self
.
titleLabel
=
titleLabel
self
.
detailView
=
detail
View
self
.
contentView
=
content
View
self
.
leftButtons
=
leftButtons
self
.
leftButtons
=
leftButtons
self
.
rightButtons
=
rightButtons
self
.
rightButtons
=
rightButtons
}
}
...
...
Sources/iOS/ControlView.swift
View file @
4dbaa51d
...
@@ -196,12 +196,6 @@ public class ControlView : MaterialView {
...
@@ -196,12 +196,6 @@ public class ControlView : MaterialView {
prepareContentView
()
prepareContentView
()
}
}
/// Prepares the contentView.
public
func
prepareContentView
()
{
contentView
.
backgroundColor
=
nil
addSubview
(
contentView
)
}
/**
/**
Used to trigger property changes that initializers avoid.
Used to trigger property changes that initializers avoid.
- Parameter leftControls: An Array of UIControls that go on the left side.
- Parameter leftControls: An Array of UIControls that go on the left side.
...
@@ -211,4 +205,10 @@ public class ControlView : MaterialView {
...
@@ -211,4 +205,10 @@ public class ControlView : MaterialView {
self
.
leftControls
=
leftControls
self
.
leftControls
=
leftControls
self
.
rightControls
=
rightControls
self
.
rightControls
=
rightControls
}
}
/// Prepares the contentView.
private
func
prepareContentView
()
{
contentView
.
backgroundColor
=
nil
addSubview
(
contentView
)
}
}
}
Sources/iOS/ImageCardView.swift
View file @
4dbaa51d
...
@@ -212,29 +212,29 @@ public class ImageCardView : MaterialPulseView {
...
@@ -212,29 +212,29 @@ public class ImageCardView : MaterialPulseView {
}
}
/**
/**
:name:
detail
ViewInsets
:name:
content
ViewInsets
*/
*/
public
var
detail
ViewInsetPreset
:
MaterialEdgeInset
=
.
Square2
{
public
var
content
ViewInsetPreset
:
MaterialEdgeInset
=
.
Square2
{
didSet
{
didSet
{
detailViewInset
=
MaterialEdgeInsetToValue
(
detail
ViewInsetPreset
)
contentViewInset
=
MaterialEdgeInsetToValue
(
content
ViewInsetPreset
)
}
}
}
}
/**
/**
:name:
detail
ViewInset
:name:
content
ViewInset
*/
*/
@IBInspectable
public
var
detail
ViewInset
:
UIEdgeInsets
=
MaterialEdgeInsetToValue
(
.
Square2
)
{
@IBInspectable
public
var
content
ViewInset
:
UIEdgeInsets
=
MaterialEdgeInsetToValue
(
.
Square2
)
{
didSet
{
didSet
{
reloadView
()
reloadView
()
}
}
}
}
/**
/**
:name:
detail
View
:name:
content
View
*/
*/
@IBInspectable
public
var
detail
View
:
UIView
?
{
@IBInspectable
public
var
content
View
:
UIView
?
{
didSet
{
didSet
{
detail
View
?
.
translatesAutoresizingMaskIntoConstraints
=
false
content
View
?
.
translatesAutoresizingMaskIntoConstraints
=
false
reloadView
()
reloadView
()
}
}
}
}
...
@@ -327,9 +327,9 @@ public class ImageCardView : MaterialPulseView {
...
@@ -327,9 +327,9 @@ public class ImageCardView : MaterialPulseView {
/**
/**
:name: init
:name: init
*/
*/
public
convenience
init
?(
image
:
UIImage
?
=
nil
,
titleLabel
:
UILabel
?
=
nil
,
detail
View
:
UIView
?
=
nil
,
leftButtons
:
Array
<
UIButton
>
?
=
nil
,
rightButtons
:
Array
<
UIButton
>
?
=
nil
)
{
public
convenience
init
?(
image
:
UIImage
?
=
nil
,
titleLabel
:
UILabel
?
=
nil
,
content
View
:
UIView
?
=
nil
,
leftButtons
:
Array
<
UIButton
>
?
=
nil
,
rightButtons
:
Array
<
UIButton
>
?
=
nil
)
{
self
.
init
(
frame
:
CGRectZero
)
self
.
init
(
frame
:
CGRectZero
)
prepareProperties
(
image
,
titleLabel
:
titleLabel
,
detailView
:
detail
View
,
leftButtons
:
leftButtons
,
rightButtons
:
rightButtons
)
prepareProperties
(
image
,
titleLabel
:
titleLabel
,
contentView
:
content
View
,
leftButtons
:
leftButtons
,
rightButtons
:
rightButtons
)
}
}
/**
/**
...
@@ -379,9 +379,9 @@ public class ImageCardView : MaterialPulseView {
...
@@ -379,9 +379,9 @@ public class ImageCardView : MaterialPulseView {
}
else
if
nil
!=
titleLabel
{
}
else
if
nil
!=
titleLabel
{
verticalFormat
+=
"-(insetTop)"
verticalFormat
+=
"-(insetTop)"
metrics
[
"insetTop"
]
=
contentInset
.
top
+
titleLabelInset
.
top
metrics
[
"insetTop"
]
=
contentInset
.
top
+
titleLabelInset
.
top
}
else
if
nil
!=
detail
View
{
}
else
if
nil
!=
content
View
{
verticalFormat
+=
"-(insetTop)"
verticalFormat
+=
"-(insetTop)"
metrics
[
"insetTop"
]
=
contentInset
.
top
+
detail
ViewInset
.
top
metrics
[
"insetTop"
]
=
contentInset
.
top
+
content
ViewInset
.
top
}
}
// title
// title
...
@@ -398,20 +398,20 @@ public class ImageCardView : MaterialPulseView {
...
@@ -398,20 +398,20 @@ public class ImageCardView : MaterialPulseView {
}
}
// detail
// detail
if
let
v
:
UIView
=
detail
View
{
if
let
v
:
UIView
=
content
View
{
addSubview
(
v
)
addSubview
(
v
)
if
nil
==
imageLayer
?
.
contents
&&
nil
!=
titleLabel
{
if
nil
==
imageLayer
?
.
contents
&&
nil
!=
titleLabel
{
verticalFormat
+=
"-(insetB)"
verticalFormat
+=
"-(insetB)"
metrics
[
"insetB"
]
=
titleLabelInset
.
bottom
+
detail
ViewInset
.
top
metrics
[
"insetB"
]
=
titleLabelInset
.
bottom
+
content
ViewInset
.
top
}
else
{
}
else
{
metrics
[
"insetTop"
]
=
(
metrics
[
"insetTop"
]
as!
CGFloat
)
+
detail
ViewInset
.
top
metrics
[
"insetTop"
]
=
(
metrics
[
"insetTop"
]
as!
CGFloat
)
+
content
ViewInset
.
top
}
}
verticalFormat
+=
"-[
detail
View]"
verticalFormat
+=
"-[
content
View]"
views
[
"
detail
View"
]
=
v
views
[
"
content
View"
]
=
v
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
v
,
left
:
contentInset
.
left
+
detailViewInset
.
left
,
right
:
contentInset
.
right
+
detail
ViewInset
.
right
)
MaterialLayout
.
alignToParentHorizontally
(
self
,
child
:
v
,
left
:
contentInset
.
left
+
contentViewInset
.
left
,
right
:
contentInset
.
right
+
content
ViewInset
.
right
)
}
}
// leftButtons
// leftButtons
...
@@ -486,11 +486,11 @@ public class ImageCardView : MaterialPulseView {
...
@@ -486,11 +486,11 @@ public class ImageCardView : MaterialPulseView {
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
rightButtonsInset
.
bottom
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
rightButtonsInset
.
bottom
}
}
if
nil
!=
detail
View
{
if
nil
!=
content
View
{
if
nil
==
metrics
[
"insetC"
]
{
if
nil
==
metrics
[
"insetC"
]
{
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
else
{
}
else
{
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
}
}
else
if
nil
!=
titleLabel
{
}
else
if
nil
!=
titleLabel
{
if
nil
==
metrics
[
"insetC"
]
{
if
nil
==
metrics
[
"insetC"
]
{
...
@@ -501,7 +501,7 @@ public class ImageCardView : MaterialPulseView {
...
@@ -501,7 +501,7 @@ public class ImageCardView : MaterialPulseView {
}
else
if
nil
!=
metrics
[
"insetC"
]
{
}
else
if
nil
!=
metrics
[
"insetC"
]
{
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
contentInset
.
top
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
contentInset
.
top
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
}
}
else
if
nil
!=
detail
View
{
}
else
if
nil
!=
content
View
{
if
0
<
leftButtons
?
.
count
{
if
0
<
leftButtons
?
.
count
{
verticalFormat
+=
"-(insetC)-[button]"
verticalFormat
+=
"-(insetC)-[button]"
views
[
"button"
]
=
leftButtons
!
[
0
]
views
[
"button"
]
=
leftButtons
!
[
0
]
...
@@ -515,9 +515,9 @@ public class ImageCardView : MaterialPulseView {
...
@@ -515,9 +515,9 @@ public class ImageCardView : MaterialPulseView {
}
}
if
nil
==
metrics
[
"insetC"
]
{
if
nil
==
metrics
[
"insetC"
]
{
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetBottom"
]
=
contentInset
.
bottom
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
else
{
}
else
{
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
detail
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
metrics
[
"insetC"
]
=
(
metrics
[
"insetC"
]
as!
CGFloat
)
+
content
ViewInset
.
bottom
+
(
divider
?
dividerInset
.
top
+
dividerInset
.
bottom
:
0
)
}
}
}
else
{
}
else
{
if
0
<
leftButtons
?
.
count
{
if
0
<
leftButtons
?
.
count
{
...
@@ -583,10 +583,10 @@ public class ImageCardView : MaterialPulseView {
...
@@ -583,10 +583,10 @@ public class ImageCardView : MaterialPulseView {
/**
/**
:name: prepareProperties
:name: prepareProperties
*/
*/
internal
func
prepareProperties
(
image
:
UIImage
?,
titleLabel
:
UILabel
?,
detail
View
:
UIView
?,
leftButtons
:
Array
<
UIButton
>
?,
rightButtons
:
Array
<
UIButton
>
?)
{
internal
func
prepareProperties
(
image
:
UIImage
?,
titleLabel
:
UILabel
?,
content
View
:
UIView
?,
leftButtons
:
Array
<
UIButton
>
?,
rightButtons
:
Array
<
UIButton
>
?)
{
self
.
image
=
image
self
.
image
=
image
self
.
titleLabel
=
titleLabel
self
.
titleLabel
=
titleLabel
self
.
detailView
=
detail
View
self
.
contentView
=
content
View
self
.
leftButtons
=
leftButtons
self
.
leftButtons
=
leftButtons
self
.
rightButtons
=
rightButtons
self
.
rightButtons
=
rightButtons
}
}
...
...
Sources/iOS/MaterialButton.swift
View file @
4dbaa51d
...
@@ -349,6 +349,10 @@ public class MaterialButton : UIButton {
...
@@ -349,6 +349,10 @@ public class MaterialButton : UIButton {
}
}
}
}
public
override
func
alignmentRectInsets
()
->
UIEdgeInsets
{
return
UIEdgeInsetsZero
}
/**
/**
A method that accepts CAAnimation objects and executes them on the
A method that accepts CAAnimation objects and executes them on the
view's backing layer.
view's backing layer.
...
...
Sources/iOS/NavigationBar.swift
View file @
4dbaa51d
This diff is collapsed.
Click to expand it.
Sources/iOS/NavigationController.swift
View file @
4dbaa51d
...
@@ -114,7 +114,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
...
@@ -114,7 +114,7 @@ public class NavigationController : UINavigationController, UIGestureRecognizerD
*/
*/
public
func
navigationBar
(
navigationBar
:
UINavigationBar
,
shouldPushItem
item
:
UINavigationItem
)
->
Bool
{
public
func
navigationBar
(
navigationBar
:
UINavigationBar
,
shouldPushItem
item
:
UINavigationItem
)
->
Bool
{
if
let
v
:
NavigationBar
=
navigationBar
as?
NavigationBar
{
if
let
v
:
NavigationBar
=
navigationBar
as?
NavigationBar
{
item
.
setHidesBackButton
(
true
,
animated
:
false
)
item
.
hidesBackButton
=
true
if
var
c
:
Array
<
UIControl
>
=
item
.
leftControls
{
if
var
c
:
Array
<
UIControl
>
=
item
.
leftControls
{
c
.
append
(
v
.
backButton
)
c
.
append
(
v
.
backButton
)
item
.
leftControls
=
c
item
.
leftControls
=
c
...
...
Sources/iOS/NavigationItem.swift
View file @
4dbaa51d
...
@@ -35,19 +35,27 @@ private var MaterialAssociatedObjectNavigationItemKey: UInt8 = 0
...
@@ -35,19 +35,27 @@ private var MaterialAssociatedObjectNavigationItemKey: UInt8 = 0
public
class
MaterialAssociatedObjectNavigationItem
{
public
class
MaterialAssociatedObjectNavigationItem
{
/// Detail View.
/// Detail View.
public
var
detail
View
:
UIView
?
public
var
content
View
:
UIView
?
/// Title label.
/// Title label.
public
var
titleLabel
:
UILabel
?
public
var
titleLabel
:
UILabel
/// Detail text.
public
var
detail
:
String
?
/// Detail label.
/// Detail label.
public
var
detailLabel
:
UILabel
?
public
var
detailLabel
:
UILabel
/// Left controls.
/// Left controls.
public
var
leftControls
:
Array
<
UIControl
>
?
public
var
leftControls
:
Array
<
UIControl
>
?
/// Right controls.
/// Right controls.
public
var
rightControls
:
Array
<
UIControl
>
?
public
var
rightControls
:
Array
<
UIControl
>
?
public
init
()
{
titleLabel
=
UILabel
()
detailLabel
=
UILabel
()
}
}
}
public
extension
UINavigationItem
{
public
extension
UINavigationItem
{
...
@@ -64,17 +72,17 @@ public extension UINavigationItem {
...
@@ -64,17 +72,17 @@ public extension UINavigationItem {
}
}
/// Detail View.
/// Detail View.
public
var
detail
View
:
UIView
?
{
public
internal(set)
var
content
View
:
UIView
?
{
get
{
get
{
return
item
.
detail
View
return
item
.
content
View
}
}
set
(
value
)
{
set
(
value
)
{
item
.
detail
View
=
value
item
.
content
View
=
value
}
}
}
}
/// Title Label.
/// Title Label.
public
var
titleLabel
:
UILabel
?
{
public
internal(set)
var
titleLabel
:
UILabel
{
get
{
get
{
return
item
.
titleLabel
return
item
.
titleLabel
}
}
...
@@ -83,8 +91,18 @@ public extension UINavigationItem {
...
@@ -83,8 +91,18 @@ public extension UINavigationItem {
}
}
}
}
/// Detail text.
public
var
detail
:
String
?
{
get
{
return
item
.
detail
}
set
(
value
)
{
item
.
detail
=
value
}
}
/// Detail Label.
/// Detail Label.
public
var
detailLabel
:
UILabel
?
{
public
internal(set)
var
detailLabel
:
UILabel
{
get
{
get
{
return
item
.
detailLabel
return
item
.
detailLabel
}
}
...
...
Sources/iOS/SearchBar.swift
View file @
4dbaa51d
...
@@ -99,9 +99,15 @@ public class SearchBar : StatusBarView {
...
@@ -99,9 +99,15 @@ public class SearchBar : StatusBarView {
}
}
}
}
/// Prepares the contentView.
/**
public
override
func
prepareContentView
()
{
Prepares the view instance when intialized. When subclassing,
super
.
prepareContentView
()
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public
override
func
prepareView
()
{
super
.
prepareView
()
prepareTextField
()
prepareTextField
()
prepareClearButton
()
prepareClearButton
()
}
}
...
...
Sources/iOS/StatusBarView.swift
View file @
4dbaa51d
...
@@ -74,7 +74,7 @@ public class StatusBarView : ControlView {
...
@@ -74,7 +74,7 @@ public class StatusBarView : ControlView {
width
=
MaterialDevice
.
width
width
=
MaterialDevice
.
width
}
}
grid
.
axis
.
columns
=
Int
(
width
/
56
)
grid
.
axis
.
columns
=
Int
(
width
/
48
)
// General alignment.
// General alignment.
if
.
iPhone
==
MaterialDevice
.
type
&&
MaterialDevice
.
isLandscape
{
if
.
iPhone
==
MaterialDevice
.
type
&&
MaterialDevice
.
isLandscape
{
...
...
Sources/iOS/Toolbar.swift
View file @
4dbaa51d
...
@@ -101,9 +101,15 @@ public class Toolbar : StatusBarView {
...
@@ -101,9 +101,15 @@ public class Toolbar : StatusBarView {
}
}
}
}
/// Prepares the contentView.
/**
public
override
func
prepareContentView
()
{
Prepares the view instance when intialized. When subclassing,
super
.
prepareContentView
()
it is recommended to override the prepareView method
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
when subclassing.
*/
public
override
func
prepareView
()
{
super
.
prepareView
()
contentView
.
grid
.
axis
.
direction
=
.
Vertical
contentView
.
grid
.
axis
.
direction
=
.
Vertical
}
}
...
...
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