Skip to content

Commit

Permalink
fixup! Fix swift lint build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NSMutableString committed Jul 9, 2020
1 parent 943cb76 commit 83336da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
17 changes: 12 additions & 5 deletions OpenGpxTracker/DateFieldTypeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ class DateFieldTypeView: UIScrollView {
}

self.addSubview(scrollStack)
self.addConstraints( NSLayoutConstraint.constraints(withVisualFormat: "H:|-20-[sStack]-20-|", options: .alignAllLeft, metrics: nil, views: ["sStack": scrollStack]) )

self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-20-[sStack]-20-|",
options: .alignAllLeft,
metrics: nil,
views: ["sStack": scrollStack]))
}

/// Generates vertical stack that encapsulates text title, with all date patterns of same type.
Expand Down Expand Up @@ -160,7 +162,6 @@ class DateFieldTypeView: UIScrollView {
/// |SUBTITLE|SUBTITLE|
///
func genHStack(field: DateField) -> UIStackView {

let hStack = UIStackView()
hStack.axis = .horizontal
hStack.distribution = .fill
Expand Down Expand Up @@ -207,12 +208,18 @@ class DateFieldTypeView: UIScrollView {

subVStack.addArrangedSubview(button)
subVStack.addArrangedSubview(subtitleLabel)
NSLayoutConstraint(item: subtitleLabel, attribute: .width, relatedBy: .equal, toItem: button, attribute: .width, multiplier: 1, constant: 0).isActive = true
let subtitleConstraint = NSLayoutConstraint(item: subtitleLabel,
attribute: .width,
relatedBy: .equal,
toItem: button,
attribute: .width,
multiplier: 1,
constant: 0)
subtitleConstraint.isActive = true
hStack.addArrangedSubview(subVStack)
} else {
hStack.addArrangedSubview(button)
}

}

return hStack
Expand Down
1 change: 0 additions & 1 deletion OpenGpxTracker/TrackerButton.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import UIKit

/// Creates a button with rounded corners.
Expand Down

0 comments on commit 83336da

Please sign in to comment.