aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-12-14 20:02:37 -0600
committerEric Kuck <eric@bluelinelabs.com>2018-12-14 20:02:37 -0600
commitccd8cfe4788c102165a4671ef57339dfbd68d0a7 (patch)
tree033ae014e14993e4ad506b73260fe66901826df0 /WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift
parentReorganized project structure (diff)
downloadwireguard-apple-ccd8cfe4788c102165a4671ef57339dfbd68d0a7.tar.xz
wireguard-apple-ccd8cfe4788c102165a4671ef57339dfbd68d0a7.zip
KeyValueCells now share code
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift48
1 files changed, 0 insertions, 48 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift b/WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift
deleted file mode 100644
index bd6f547..0000000
--- a/WireGuard/WireGuard/UI/iOS/View/ScrollableLabel.swift
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: MIT
-// Copyright © 2018 WireGuard LLC. All Rights Reserved.
-
-import UIKit
-
-class ScrollableLabel: UIScrollView {
- var text: String {
- get { return label.text ?? "" }
- set(value) { label.text = value }
- }
- var textColor: UIColor {
- get { return label.textColor }
- set(value) { label.textColor = value }
- }
-
- let label: UILabel = {
- let label = UILabel()
- label.translatesAutoresizingMaskIntoConstraints = false
- label.textAlignment = .right
- return label
- }()
-
- init() {
- super.init(frame: CGRect.zero)
-
- isDirectionalLockEnabled = true
- showsHorizontalScrollIndicator = false
- showsVerticalScrollIndicator = false
-
- addSubview(label)
- label.translatesAutoresizingMaskIntoConstraints = false
- NSLayoutConstraint.activate([
- label.leftAnchor.constraint(equalTo: contentLayoutGuide.leftAnchor),
- label.topAnchor.constraint(equalTo: contentLayoutGuide.topAnchor),
- label.bottomAnchor.constraint(equalTo: contentLayoutGuide.bottomAnchor),
- label.rightAnchor.constraint(equalTo: contentLayoutGuide.rightAnchor),
- label.heightAnchor.constraint(equalTo: heightAnchor)
- ])
-
- let expandToFitValueLabelConstraint = NSLayoutConstraint(item: label, attribute: .width, relatedBy: .equal, toItem: self, attribute: .width, multiplier: 1, constant: 0)
- expandToFitValueLabelConstraint.priority = .defaultLow + 1
- expandToFitValueLabelConstraint.isActive = true
- }
-
- required init?(coder aDecoder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
-}