mirror of
https://github.com/nicklockwood/SwiftFormat.git
synced 2026-05-17 10:30:35 +00:00
31 lines
645 B
Swift
Executable File
31 lines
645 B
Swift
Executable File
// Copyright © 2017 Schibsted. All rights reserved.
|
|
|
|
import Layout
|
|
import UIKit
|
|
|
|
final class BoxesViewController: UIViewController {
|
|
var toggled = false {
|
|
didSet {
|
|
layoutNode?.setState(["isToggled": toggled])
|
|
}
|
|
}
|
|
|
|
@IBOutlet var layoutNode: LayoutNode? {
|
|
didSet {
|
|
layoutNode?.setState(["isToggled": toggled])
|
|
}
|
|
}
|
|
|
|
@IBAction func setToggled() {
|
|
UIView.animate(withDuration: 0.4) {
|
|
self.toggled = true
|
|
}
|
|
}
|
|
|
|
@IBAction func setUntoggled() {
|
|
UIView.animate(withDuration: 0.4) {
|
|
self.toggled = false
|
|
}
|
|
}
|
|
}
|