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
1595584f
Unverified
Commit
1595584f
authored
Oct 14, 2017
by
M. Porooshani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provided default values for when user set's nil as color for tab bar items
parent
14a9756e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
Sources/iOS/TabBar.swift
+20
-4
No files found.
Sources/iOS/TabBar.swift
View file @
1595584f
...
@@ -203,10 +203,24 @@ open class TabBar: Bar {
...
@@ -203,10 +203,24 @@ open class TabBar: Bar {
}
}
/// TabBar items normal title color.
/// TabBar items normal title color.
open
var
tabItemsNormalTitleColor
:
UIColor
?
open
var
tabItemsNormalTitleColor
:
UIColor
?
{
didSet
{
let
normalColor
=
tabItemsNormalTitleColor
??
Color
.
blue
.
base
for
v
in
tabItems
{
if
(
nil
==
v
.
titleColor
||
Color
.
blue
.
base
==
v
.
titleColor
)
{
v
.
titleColor
=
normalColor
}
}
}
}
/// TabBar items selected title color.
/// TabBar items selected title color.
open
var
tabItemsSelectedTitleColor
:
UIColor
?
open
var
tabItemsSelectedTitleColor
:
UIColor
?
{
didSet
{
let
selectedColor
=
tabItemsSelectedTitleColor
??
Color
.
blue
.
base
for
v
in
tabItems
{
if
(
nil
==
v
.
selectedTitleColor
||
Color
.
blue
.
base
==
v
.
selectedTitleColor
)
{
v
.
selectedTitleColor
=
selectedColor
}
}
}
}
/// A reference to the line UIView.
/// A reference to the line UIView.
open
let
line
=
UIView
()
open
let
line
=
UIView
()
...
@@ -285,8 +299,10 @@ fileprivate extension TabBar {
...
@@ -285,8 +299,10 @@ fileprivate extension TabBar {
for
v
in
tabItems
{
for
v
in
tabItems
{
v
.
grid
.
columns
=
0
v
.
grid
.
columns
=
0
v
.
contentEdgeInsets
=
.
zero
v
.
contentEdgeInsets
=
.
zero
if
Color
.
blue
.
base
==
v
.
titleColor
{
v
.
titleColor
=
tabItemsNormalTitleColor
}
let
normalColor
=
tabItemsNormalTitleColor
??
Color
.
blue
.
base
if
nil
==
v
.
selectedTitleColor
{
v
.
selectedTitleColor
=
tabItemsSelectedTitleColor
}
if
Color
.
blue
.
base
==
v
.
titleColor
{
v
.
titleColor
=
normalColor
}
let
selectedColor
=
tabItemsSelectedTitleColor
??
Color
.
blue
.
base
if
nil
==
v
.
selectedTitleColor
{
v
.
selectedTitleColor
=
selectedColor
}
prepareLineAnimationHandler
(
tabItem
:
v
)
prepareLineAnimationHandler
(
tabItem
:
v
)
}
}
...
...
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