-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestViewController.swift
More file actions
45 lines (32 loc) · 1.13 KB
/
Copy pathTestViewController.swift
File metadata and controls
45 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// TestViewController.swift
// DialsExample
//
// Created by Akiva Leffert on 3/28/15.
// Copyright (c) 2015 Akiva Leffert. All rights reserved.
//
import UIKit
import Dials
var color = UIColor(red:0.17, green:0.72, blue:1, alpha:1)
var buttonTitle = "Better Title"
class TestViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
DLSGroupWithName("Example Group (Swift)") {
DLSControl("Some Color").colorOf(&color)
_ = DLSControl("Set Color as Background").actionOf {[weak self] in
self?.view.backgroundColor = color
}
_ = DLSControl("Add Toolbar Button").actionOf {[weak self] in
var items = self?.toolbarItems ?? []
items.append(UIBarButtonItem(title: buttonTitle, style: .plain, target: nil, action: nil))
self?.toolbarItems = items
}
DLSControl("Button Title").textFieldOf(&buttonTitle)
}
}
deinit {
print("clearing")
}
}