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
8ec40dd5
Commit
8ec40dd5
authored
Oct 06, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made ViewController themeable
parent
85d97b17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Sources/iOS/ViewController.swift
+10
-2
No files found.
Sources/iOS/ViewController.swift
View file @
8ec40dd5
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
import
UIKit
import
UIKit
open
class
ViewController
:
UIViewController
{
open
class
ViewController
:
UIViewController
,
Themeable
{
open
override
func
viewDidLoad
()
{
open
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
prepare
()
prepare
()
...
@@ -45,8 +45,8 @@ open class ViewController: UIViewController {
...
@@ -45,8 +45,8 @@ open class ViewController: UIViewController {
*/
*/
open
func
prepare
()
{
open
func
prepare
()
{
view
.
clipsToBounds
=
true
view
.
clipsToBounds
=
true
view
.
backgroundColor
=
.
white
view
.
contentScaleFactor
=
Screen
.
scale
view
.
contentScaleFactor
=
Screen
.
scale
applyCurrentTheme
()
}
}
open
override
func
viewWillLayoutSubviews
()
{
open
override
func
viewWillLayoutSubviews
()
{
...
@@ -61,4 +61,12 @@ open class ViewController: UIViewController {
...
@@ -61,4 +61,12 @@ open class ViewController: UIViewController {
have a certain need.
have a certain need.
*/
*/
open
func
layoutSubviews
()
{
}
open
func
layoutSubviews
()
{
}
/**
Applies given theme to the view controller.
- Parameter theme: A Theme.
*/
open
func
apply
(
theme
:
Theme
)
{
view
.
backgroundColor
=
theme
.
background
}
}
}
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