From e244638f05e69c466582197194185a2511d5031d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=9F=E3=82=89=E3=81=97=E3=81=BE=E3=81=95?= =?UTF-8?q?=E3=81=A8=E3=82=89?= Date: Sun, 31 May 2020 02:43:39 +0900 Subject: [PATCH] Updating for Xcode 11 and Swift5 --- .../HELargeCenterTabBarController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HELargeCenterTabBarController/HELargeCenterTabBarController.swift b/HELargeCenterTabBarController/HELargeCenterTabBarController.swift index a99a7e8..07639ad 100644 --- a/HELargeCenterTabBarController/HELargeCenterTabBarController.swift +++ b/HELargeCenterTabBarController/HELargeCenterTabBarController.swift @@ -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) @@ -201,7 +201,7 @@ class HELargeCenterTabBarController: UITabBarController { } if let centerButton = centerButton { - centerButton.setBackgroundImage(buttonImage, for: UIControlState()) + centerButton.setBackgroundImage(buttonImage, for: UIControl.State()) } }