Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from MasatoraAtarashi/Correspond-to-swift5-and…
Browse files Browse the repository at this point in the history
…-Xcode11

Updating for Xcode 11 and Swift5
  • Loading branch information
hsoi authored Jun 8, 2020
2 parents 83d8172 + e244638 commit 88d0f2b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ class HELargeCenterTabBarController: UITabBarController {
button.heightAnchor.constraint(equalToConstant: unselectedImage.size.height)
])
} else {
view.addConstraint(NSLayoutConstraint(item: button, attribute: NSLayoutAttribute.centerX, relatedBy: NSLayoutRelation.equal, toItem: view, attribute: NSLayoutAttribute.centerX, multiplier: 1.0, constant: 0.0))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[button]-0-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["button": button]));
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:[button(==\(unselectedImage.size.width))]", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["button": button]))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[button(==\(unselectedImage.size.height))]", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["button": button]))
view.addConstraint(NSLayoutConstraint(item: button, attribute: NSLayoutConstraint.Attribute.centerX, relatedBy: NSLayoutConstraint.Relation.equal, toItem: view, attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1.0, constant: 0.0))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[button]-0-|", options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: ["button": button]));
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:[button(==\(unselectedImage.size.width))]", options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: ["button": button]))
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:[button(==\(unselectedImage.size.height))]", options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: ["button": button]))
}

button.addTarget(self, action: #selector(centerButtonAction(_:)), for: .touchUpInside)
Expand Down Expand Up @@ -201,7 +201,7 @@ class HELargeCenterTabBarController: UITabBarController {
}

if let centerButton = centerButton {
centerButton.setBackgroundImage(buttonImage, for: UIControlState())
centerButton.setBackgroundImage(buttonImage, for: UIControl.State())
}
}

Expand Down

0 comments on commit 88d0f2b

Please sign in to comment.