Skip to content

Commit

Permalink
Merge pull request #78 from nakajijapan/delete-warning
Browse files Browse the repository at this point in the history
constraints is never used
  • Loading branch information
nakajijapan authored Feb 18, 2017
2 parents dfec308 + 94b7737 commit cf3220f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
10 changes: 4 additions & 6 deletions Sources/Classes/ImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,22 @@ class ImageView: UIView {
private func layoutScrollView() {

scrollView.translatesAutoresizingMaskIntoConstraints = false
let constraints = [
[
scrollView.topAnchor.constraint(equalTo: topAnchor, constant: 0.0),
scrollView.bottomAnchor.constraint(equalTo: bottomAnchor, constant: 0.0),
scrollView.rightAnchor.constraint(equalTo: rightAnchor, constant: 0.0),
scrollView.leftAnchor.constraint(equalTo: leftAnchor, constant: 0.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

private func layoutProgressView() {

progressView.translatesAutoresizingMaskIntoConstraints = false

let constraints = [
[
progressView.heightAnchor.constraint(equalToConstant: 40.0),
progressView.widthAnchor.constraint(equalToConstant: 40.0),
progressView.centerXAnchor.constraint(lessThanOrEqualTo: centerXAnchor, constant: 1.0),
progressView.centerYAnchor.constraint(lessThanOrEqualTo: centerYAnchor, constant: 1.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

func loadImage(imageURL: URL) {
Expand Down
16 changes: 8 additions & 8 deletions Sources/Classes/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,41 +231,41 @@ fileprivate extension ViewController {

func layoutScrollView() {
scrollView.translatesAutoresizingMaskIntoConstraints = false
let constraints = [
[
scrollView.topAnchor.constraint(equalTo: view.topAnchor, constant: 0.0),
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0.0),
scrollView.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0.0),
scrollView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

func layoutCloseButton() {
closeButton.translatesAutoresizingMaskIntoConstraints = false
let constraints = [
[
closeButton.topAnchor.constraint(equalTo: view.topAnchor, constant: 0.0),
closeButton.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0.0),
closeButton.heightAnchor.constraint(equalToConstant: 52.0),
closeButton.widthAnchor.constraint(equalToConstant: 52.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

func layoutPageControl() {
pageControl.translatesAutoresizingMaskIntoConstraints = false
let constraints = [
[
pageControl.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0.0),
pageControl.centerXAnchor.constraint(equalTo: view.centerXAnchor),
pageControl.rightAnchor.constraint(equalTo: view.rightAnchor, constant: 0.0),
pageControl.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

func layoutCaptionLabel() {
captionLabel.translatesAutoresizingMaskIntoConstraints = false
let constraints = [
[
captionLabel.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -32.0),
captionLabel.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -16.0),
captionLabel.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 16.0),
].map { $0.isActive = true }
].forEach { $0.isActive = true }
}

}
Expand Down

0 comments on commit cf3220f

Please sign in to comment.