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
da9375eb
Unverified
Commit
da9375eb
authored
Sep 16, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated RootController API
parent
75c4665b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
28 deletions
+33
-28
Sources/iOS/NavigationItem.swift
+1
-0
Sources/iOS/RootController.swift
+32
-28
No files found.
Sources/iOS/NavigationItem.swift
View file @
da9375eb
...
...
@@ -143,6 +143,7 @@ extension UINavigationItem {
}
}
/// Title text.
@nonobjc
public
var
title
:
String
?
{
get
{
...
...
Sources/iOS/RootController.swift
View file @
da9375eb
...
...
@@ -113,25 +113,27 @@ open class RootController: UIViewController {
the transition animation from the active rootViewController
to the toViewController has completed.
*/
open
func
transition
FromRootViewController
(
toV
iewController
:
UIViewController
,
duration
:
TimeInterval
=
0.5
,
options
:
UIViewAnimationOptions
=
[],
animations
:
(()
->
Void
)?
=
nil
,
completion
:
((
Bool
)
->
Void
)?
=
nil
)
{
open
func
transition
(
to
v
iewController
:
UIViewController
,
duration
:
TimeInterval
=
0.5
,
options
:
UIViewAnimationOptions
=
[],
animations
:
(()
->
Void
)?
=
nil
,
completion
:
((
Bool
)
->
Void
)?
=
nil
)
{
rootViewController
.
willMove
(
toParentViewController
:
nil
)
addChildViewController
(
toV
iewController
)
toV
iewController
.
view
.
frame
=
rootViewController
.
view
.
bounds
addChildViewController
(
v
iewController
)
v
iewController
.
view
.
frame
=
rootViewController
.
view
.
bounds
transition
(
from
:
rootViewController
,
to
:
toV
iewController
,
to
:
v
iewController
,
duration
:
duration
,
options
:
options
,
animations
:
animations
,
completion
:
{
[
weak
self
]
(
result
:
Bool
)
in
if
let
s
:
RootController
=
self
{
toViewController
.
didMove
(
toParentViewController
:
s
)
s
.
rootViewController
.
removeFromParentViewController
()
s
.
rootViewController
=
toViewController
s
.
rootViewController
.
view
.
clipsToBounds
=
true
s
.
rootViewController
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
s
.
rootViewController
.
view
.
contentScaleFactor
=
Device
.
scale
completion
?(
result
)
}
guard
let
s
=
self
else
{
return
}
viewController
.
didMove
(
toParentViewController
:
s
)
s
.
rootViewController
.
removeFromParentViewController
()
s
.
rootViewController
=
viewController
s
.
rootViewController
.
view
.
clipsToBounds
=
true
s
.
rootViewController
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
s
.
rootViewController
.
view
.
contentScaleFactor
=
Device
.
scale
completion
?(
result
)
})
}
...
...
@@ -163,21 +165,23 @@ open class RootController: UIViewController {
}
/**
A method that adds the passed in controller as a child of
the BarController within the passed in
container view.
- Parameter viewController: A UIViewController to add as a child.
- Parameter container: A UIView that is the parent of the
passed in controller view within the view hierarchy.
*/
A method that adds the passed in controller as a child of
the BarController within the passed in
container view.
- Parameter viewController: A UIViewController to add as a child.
- Parameter container: A UIView that is the parent of the
passed in controller view within the view hierarchy.
*/
internal
func
prepareControllerWithinContainer
(
viewController
:
UIViewController
?,
container
:
UIView
)
{
if
let
v
:
UIViewController
=
viewController
{
addChildViewController
(
v
)
container
.
addSubview
(
v
.
view
)
v
.
didMove
(
toParentViewController
:
self
)
v
.
view
.
clipsToBounds
=
true
v
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
v
.
view
.
contentScaleFactor
=
Device
.
scale
}
guard
let
v
=
viewController
else
{
return
}
addChildViewController
(
v
)
container
.
addSubview
(
v
.
view
)
v
.
didMove
(
toParentViewController
:
self
)
v
.
view
.
clipsToBounds
=
true
v
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
v
.
view
.
contentScaleFactor
=
Device
.
scale
}
}
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