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
...
@@ -36,105 +36,105 @@ fileprivate var NavigationItemKey: UInt8 = 0
fileprivate
var
NavigationItemContext
:
UInt8
=
0
fileprivate
var
NavigationItemContext
:
UInt8
=
0
fileprivate
class
NavigationItem
:
NSObject
{
fileprivate
class
NavigationItem
:
NSObject
{
/// A reference to the toolbar.
/// A reference to the toolbar.
@objc
@objc
let
toolbar
=
Toolbar
()
let
toolbar
=
Toolbar
()
/// Back Button.
/// Back Button.
lazy
var
backButton
=
IconButton
()
lazy
var
backButton
=
IconButton
()
/// An optional reference to the NavigationBar.
/// An optional reference to the NavigationBar.
var
navigationBar
:
NavigationBar
?
{
var
navigationBar
:
NavigationBar
?
{
var
v
=
toolbar
.
contentView
.
superview
var
v
=
toolbar
.
contentView
.
superview
while
nil
!=
v
{
while
nil
!=
v
{
if
let
navigationBar
=
v
as?
NavigationBar
{
if
let
navigationBar
=
v
as?
NavigationBar
{
return
navigationBar
return
navigationBar
}
}
v
=
v
?
.
superview
v
=
v
?
.
superview
}
return
nil
}
}
return
nil
}
}
}
fileprivate
extension
UINavigationItem
{
fileprivate
extension
UINavigationItem
{
/// NavigationItem reference.
/// NavigationItem reference.
var
navigationItem
:
NavigationItem
{
var
navigationItem
:
NavigationItem
{
get
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
NavigationItemKey
)
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
NavigationItemKey
)
{
return
NavigationItem
()
return
NavigationItem
()
}
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
NavigationItemKey
,
value
:
value
)
}
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
NavigationItemKey
,
value
:
value
)
}
}
}
}
internal
extension
UINavigationItem
{
internal
extension
UINavigationItem
{
/// A reference to the NavigationItem Toolbar.
/// A reference to the NavigationItem Toolbar.
var
toolbar
:
Toolbar
{
var
toolbar
:
Toolbar
{
return
navigationItem
.
toolbar
return
navigationItem
.
toolbar
}
}
}
}
extension
UINavigationItem
{
extension
UINavigationItem
{
/// Should center the contentView.
/// Should center the contentView.
open
var
contentViewAlignment
:
ContentViewAlignment
{
open
var
contentViewAlignment
:
ContentViewAlignment
{
get
{
get
{
return
toolbar
.
contentViewAlignment
return
toolbar
.
contentViewAlignment
}
}
set
(
value
)
{
set
(
value
)
{
toolbar
.
contentViewAlignment
=
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
{
/// Center UIViews.
return
toolbar
.
contentView
open
var
centerViews
:
[
UIView
]
{
get
{
return
toolbar
.
centerViews
}
}
set
(
value
)
{
/// Back Button.
toolbar
.
centerViews
=
value
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
}
}
}
}
}
}
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