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
0eb7acf7
Commit
0eb7acf7
authored
Feb 25, 2018
by
intoxicated
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed indentation to 2 for consistency
parent
9ab21516
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
87 deletions
+87
-87
Sources/iOS/Bar.swift
+0
-0
Sources/iOS/NavigationController.swift
+0
-0
Sources/iOS/NavigationItem.swift
+87
-87
No files found.
Sources/iOS/Bar.swift
View file @
0eb7acf7
This diff is collapsed.
Click to expand it.
Sources/iOS/NavigationController.swift
View file @
0eb7acf7
This diff is collapsed.
Click to expand it.
Sources/iOS/NavigationItem.swift
View file @
0eb7acf7
...
...
@@ -36,105 +36,105 @@ fileprivate var NavigationItemKey: UInt8 = 0
fileprivate
var
NavigationItemContext
:
UInt8
=
0
fileprivate
class
NavigationItem
:
NSObject
{
/// A reference to the toolbar.
@objc
let
toolbar
=
Toolbar
()
/// Back Button.
lazy
var
backButton
=
IconButton
()
/// An optional reference to the NavigationBar.
var
navigationBar
:
NavigationBar
?
{
var
v
=
toolbar
.
contentView
.
superview
while
nil
!=
v
{
if
let
navigationBar
=
v
as?
NavigationBar
{
return
navigationBar
}
v
=
v
?
.
superview
}
return
nil
/// A reference to the toolbar.
@objc
let
toolbar
=
Toolbar
()
/// Back Button.
lazy
var
backButton
=
IconButton
()
/// An optional reference to the NavigationBar.
var
navigationBar
:
NavigationBar
?
{
var
v
=
toolbar
.
contentView
.
superview
while
nil
!=
v
{
if
let
navigationBar
=
v
as?
NavigationBar
{
return
navigationBar
}
v
=
v
?
.
superview
}
return
nil
}
}
fileprivate
extension
UINavigationItem
{
/// NavigationItem reference.
var
navigationItem
:
NavigationItem
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
NavigationItemKey
)
{
return
NavigationItem
()
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
NavigationItemKey
,
value
:
value
)
}
/// NavigationItem reference.
var
navigationItem
:
NavigationItem
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
NavigationItemKey
)
{
return
NavigationItem
()
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
NavigationItemKey
,
value
:
value
)
}
}
}
internal
extension
UINavigationItem
{
/// A reference to the NavigationItem Toolbar.
var
toolbar
:
Toolbar
{
return
navigationItem
.
toolbar
}
/// A reference to the NavigationItem Toolbar.
var
toolbar
:
Toolbar
{
return
navigationItem
.
toolbar
}
}
extension
UINavigationItem
{
/// Should center the contentView.
open
var
contentViewAlignment
:
ContentViewAlignment
{
get
{
return
toolbar
.
contentViewAlignment
}
set
(
value
)
{
toolbar
.
contentViewAlignment
=
value
}
/// Should center the contentView.
open
var
contentViewAlignment
:
ContentViewAlignment
{
get
{
return
toolbar
.
contentViewAlignment
}
set
(
value
)
{
toolbar
.
contentViewAlignment
=
value
}
}
/// Content View.
open
var
contentView
:
UIView
{
return
toolbar
.
contentView
}
/// Back Button.
open
var
backButton
:
IconButton
{
return
navigationItem
.
backButton
}
/// Title Label.
open
var
titleLabel
:
UILabel
{
return
toolbar
.
titleLabel
}
/// Detail Label.
open
var
detailLabel
:
UILabel
{
return
toolbar
.
detailLabel
}
/// Left side UIViews.
open
var
leftViews
:
[
UIView
]
{
get
{
return
toolbar
.
leftViews
}
set
(
value
)
{
toolbar
.
leftViews
=
value
}
}
/// Right side UIViews.
open
var
rightViews
:
[
UIView
]
{
get
{
return
toolbar
.
rightViews
}
set
(
value
)
{
toolbar
.
rightViews
=
value
}
/// Content View.
open
var
contentView
:
UIView
{
return
toolbar
.
contentView
}
/// Center UIViews.
open
var
centerViews
:
[
UIView
]
{
get
{
return
toolbar
.
centerViews
}
/// Back Button.
open
var
backButton
:
IconButton
{
return
navigationItem
.
backButton
}
/// Title Label.
open
var
titleLabel
:
UILabel
{
return
toolbar
.
titleLabel
}
/// Detail Label.
open
var
detailLabel
:
UILabel
{
return
toolbar
.
detailLabel
}
/// Left side UIViews.
open
var
leftViews
:
[
UIView
]
{
get
{
return
toolbar
.
leftViews
}
set
(
value
)
{
toolbar
.
leftViews
=
value
}
}
/// Right side UIViews.
open
var
rightViews
:
[
UIView
]
{
get
{
return
toolbar
.
rightViews
}
set
(
value
)
{
toolbar
.
rightViews
=
value
}
}
/// Center UIViews.
open
var
centerViews
:
[
UIView
]
{
get
{
return
toolbar
.
centerViews
}
set
(
value
)
{
toolbar
.
centerViews
=
value
}
set
(
value
)
{
toolbar
.
centerViews
=
value
}
}
}
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