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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
Sources/iOS/NavigationItem.swift
+1
-0
Sources/iOS/RootController.swift
+14
-10
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
)
guard
let
s
=
self
else
{
return
}
viewController
.
didMove
(
toParentViewController
:
s
)
s
.
rootViewController
.
removeFromParentViewController
()
s
.
rootViewController
=
toV
iewController
s
.
rootViewController
=
v
iewController
s
.
rootViewController
.
view
.
clipsToBounds
=
true
s
.
rootViewController
.
view
.
autoresizingMask
=
[
.
flexibleWidth
,
.
flexibleHeight
]
s
.
rootViewController
.
view
.
contentScaleFactor
=
Device
.
scale
completion
?(
result
)
}
})
}
...
...
@@ -171,7 +173,10 @@ open class RootController: UIViewController {
passed in controller view within the view hierarchy.
*/
internal
func
prepareControllerWithinContainer
(
viewController
:
UIViewController
?,
container
:
UIView
)
{
if
let
v
:
UIViewController
=
viewController
{
guard
let
v
=
viewController
else
{
return
}
addChildViewController
(
v
)
container
.
addSubview
(
v
.
view
)
v
.
didMove
(
toParentViewController
:
self
)
...
...
@@ -179,5 +184,4 @@ open class RootController: UIViewController {
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