Skip to content

Commit

Permalink
FIx truncation in location label (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis authored Jan 11, 2017
1 parent 3c4a420 commit e03ccab
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions iOS/Source/MainController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class MainController: UIViewController {
}

var informationButtonTopAnchor: NSLayoutConstraint?
var informationButtonWidthAnchor: NSLayoutConstraint?

var locationLabelBottomAnchor: NSLayoutConstraint?
var locationLabelLeftAnchor: NSLayoutConstraint?
Expand All @@ -108,7 +109,6 @@ class MainController: UIViewController {

self.informationButton.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
self.informationButton.heightAnchor.constraint(equalToConstant: 80).isActive = true
self.informationButton.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: -self.insets.right).isActive = true

self.sunView.heightAnchor.constraint(equalToConstant: 133).isActive = true
self.sunView.bottomAnchor.constraint(equalTo: self.messageLabel.topAnchor, constant: -10).isActive = true
Expand Down Expand Up @@ -212,8 +212,11 @@ class MainController: UIViewController {
self.view.addSubview(overlayView)

self.informationButtonTopAnchor?.isActive = false
let screenshotInformationTopAnchor = self.informationButton.topAnchor.constraint(equalTo: overlayView.topAnchor, constant: -18)
screenshotInformationTopAnchor.isActive = true
let informationButtonTopAnchor = self.informationButton.topAnchor.constraint(equalTo: overlayView.topAnchor, constant: -18)
informationButtonTopAnchor.isActive = true

let informationButtonWidthAnchor = self.informationButton.widthAnchor.constraint(equalToConstant: 165)
informationButtonWidthAnchor.isActive = true

self.locationLabelBottomAnchor?.isActive = false
self.locationLabelLeftAnchor?.isActive = false
Expand All @@ -225,7 +228,7 @@ class MainController: UIViewController {
let screenshotLocationRightAnchor = self.locationLabel.rightAnchor.constraint(equalTo: self.view.rightAnchor, constant: -self.insets.right)
screenshotLocationRightAnchor.isActive = true

let screenshotLocationLeftAnchor = self.locationLabel.leftAnchor.constraint(equalTo: self.informationButton.leftAnchor)
let screenshotLocationLeftAnchor = self.locationLabel.leftAnchor.constraint(equalTo: self.informationButton.rightAnchor)
screenshotLocationLeftAnchor.isActive = true

self.locationLabel.textAlignment = .right
Expand All @@ -245,7 +248,8 @@ class MainController: UIViewController {
self.locationLabelLeftAnchor?.isActive = true
self.locationLabelRightAnchor?.isActive = true

screenshotInformationTopAnchor.isActive = false
informationButtonTopAnchor.isActive = false
informationButtonWidthAnchor.isActive = false
self.informationButtonTopAnchor?.isActive = true

overlayView.removeFromSuperview()
Expand Down

0 comments on commit e03ccab

Please sign in to comment.