From d7bbac7404168baa6dccdd6c570b91e3feddb4e2 Mon Sep 17 00:00:00 2001 From: Suric Date: Mon, 8 Apr 2019 14:11:40 +0800 Subject: [PATCH] feature: support siwft 5 --- DropdownMenu.xcodeproj/project.pbxproj | 14 +++-- .../UserInterfaceState.xcuserstate | Bin 20750 -> 0 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 -- .../xcdebugger/Breakpoints_v2.xcbkptlist | 23 ------- DropdownMenu/DropUpMenu.swift | 48 ++++++++------- DropdownMenu/DropdownMenu.swift | 56 +++++++++--------- DropdownMenu/SectionHeader.swift | 9 ++- .../project.pbxproj | 24 ++++---- DropdownMenuTests/DropdownMenuTests.swift | 2 +- 9 files changed, 82 insertions(+), 99 deletions(-) delete mode 100644 DropdownMenu.xcworkspace/xcuserdata/wangwei.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 DropdownMenu.xcworkspace/xcuserdata/wangwei.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist delete mode 100644 DropdownMenu.xcworkspace/xcuserdata/zhangxiaolian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist diff --git a/DropdownMenu.xcodeproj/project.pbxproj b/DropdownMenu.xcodeproj/project.pbxproj index dff4ff8..de08a39 100644 --- a/DropdownMenu.xcodeproj/project.pbxproj +++ b/DropdownMenu.xcodeproj/project.pbxproj @@ -161,22 +161,24 @@ ACE6DB6B1CF74183005C6667 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = 7NLBE99QC4; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; ACE6DB751CF74183005C6667 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = 7NLBE99QC4; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = ACE6DB661CF74183005C6667 /* Build configuration list for PBXProject "DropdownMenu" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = ACE6DB621CF74183005C6667; productRefGroup = ACE6DB6D1CF74183005C6667 /* Products */; @@ -369,7 +371,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -390,7 +392,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenu; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -403,7 +405,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -416,7 +418,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/DropdownMenu.xcworkspace/xcuserdata/wangwei.xcuserdatad/UserInterfaceState.xcuserstate b/DropdownMenu.xcworkspace/xcuserdata/wangwei.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 174cc3fce810f14268255230fc23c7e542a0965c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20750 zcmc(H34Bw<*7(fby0>Z4v`w4RC25;3DQT7_U7&lRvK3mEmZhd`D3Q|CBxMKZ;(~&L zJAxY&1X)BxR1gtS6x;CL_dz;WgdC#B!?|UChn|o*G%*>gypEGId zXmfhJ2E+RZBMQ-oK`i39=eX_Tw9_4KkJHsYP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a/DropdownMenu.xcworkspace/xcuserdata/zhangxiaolian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/DropdownMenu.xcworkspace/xcuserdata/zhangxiaolian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index 1071dcf..0000000 --- a/DropdownMenu.xcworkspace/xcuserdata/zhangxiaolian.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/DropdownMenu/DropUpMenu.swift b/DropdownMenu/DropUpMenu.swift index 1ab9c30..685b825 100644 --- a/DropdownMenu/DropUpMenu.swift +++ b/DropdownMenu/DropUpMenu.swift @@ -33,14 +33,24 @@ public extension DropUpMenuDelegate { private let screenRect = UIScreen.main.bounds open class DropUpMenu: UIView { - fileprivate var items: [DropdownItem] = [] - fileprivate var selectedRow: Int - open var tableView: UITableView! - fileprivate var barCoverView: UIView! - fileprivate var isShow = false - fileprivate var addedWindow: UIWindow? - fileprivate var windowRootView: UIView? - fileprivate lazy var tapGestureRecognizer: UITapGestureRecognizer = { + private var items: [DropdownItem] = [] + private var selectedRow: Int + open lazy var tableView: UITableView = { + let tableView = UITableView(frame: CGRect.zero, style: .grouped) + tableView.estimatedSectionHeaderHeight = 0 + tableView.estimatedSectionFooterHeight = 0 + return tableView + }() + private lazy var barCoverView: UIView = { + let barCoverView = UIView() + barCoverView.backgroundColor = UIColor.clear + barCoverView.translatesAutoresizingMaskIntoConstraints = false + return barCoverView + }() + private var isShow = false + private var addedWindow: UIWindow? + private var windowRootView: UIView? + private lazy var tapGestureRecognizer: UITapGestureRecognizer = { return UITapGestureRecognizer(target: self, action: #selector(self.hideMenu)) }() @@ -86,10 +96,10 @@ open class DropUpMenu: UIView { clipsToBounds = true setupGestureView() - initTableView() + setupTableView() } - fileprivate func setupGestureView() { + private func setupGestureView() { let gestureView = UIView() gestureView.backgroundColor = UIColor.clear addSubview(gestureView) @@ -102,16 +112,13 @@ open class DropUpMenu: UIView { gestureView.addGestureRecognizer(tapGestureRecognizer) } - fileprivate func initTableView() { - tableView = UITableView(frame: CGRect.zero, style: .grouped) - tableView?.delegate = self - tableView?.dataSource = self - tableView.estimatedSectionHeaderHeight = 0 - tableView.estimatedSectionFooterHeight = 0 + private func setupTableView() { + tableView.delegate = self + tableView.dataSource = self addSubview(tableView) } - fileprivate func layoutTableView() { + private func layoutTableView() { tableViewHeight = CGFloat(items.count) * rowHeight let maxHeight = UIScreen.main.bounds.height - bottomOffsetY if tableViewHeight > maxHeight { @@ -125,7 +132,7 @@ open class DropUpMenu: UIView { NSLayoutConstraint.activate([NSLayoutConstraint.init(item: tableView, attribute: .right, relatedBy: .equal, toItem: self, attribute: .right, multiplier: 1.0, constant: 0)]) } - fileprivate func setupBottomSeperatorView() { + private func setupBottomSeperatorView() { let seperatorView = UIView() seperatorView.backgroundColor = tableViewSeperatorColor addSubview(seperatorView) @@ -136,10 +143,7 @@ open class DropUpMenu: UIView { NSLayoutConstraint.activate([NSLayoutConstraint.init(item: seperatorView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 0.5)]) } - fileprivate func setupBottomCoverView(on view: UIView) { - barCoverView = UIView() - barCoverView.backgroundColor = UIColor.clear - barCoverView.translatesAutoresizingMaskIntoConstraints = false + private func setupBottomCoverView(on view: UIView) { view.addSubview(barCoverView) NSLayoutConstraint.activate([NSLayoutConstraint.init(item: barCoverView, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1.0, constant: 0)]) NSLayoutConstraint.activate([NSLayoutConstraint.init(item: barCoverView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: bottomOffsetY)]) diff --git a/DropdownMenu/DropdownMenu.swift b/DropdownMenu/DropdownMenu.swift index 742c9cd..0022bf3 100644 --- a/DropdownMenu/DropdownMenu.swift +++ b/DropdownMenu/DropdownMenu.swift @@ -33,23 +33,28 @@ public extension DropdownMenuDelegate { } open class DropdownMenu: UIView { - fileprivate weak var navigationController: UINavigationController! + private weak var navigationController: UINavigationController! - fileprivate var sections: [DropdownSection] = [] - fileprivate var selectedIndexPath: IndexPath + private var sections: [DropdownSection] = [] + private var selectedIndexPath: IndexPath - open var tableView: UITableView! - fileprivate var barCoverView: UIView? + open var tableView: UITableView = { + let tableView = UITableView(frame: CGRect.zero, style: .grouped) + tableView.estimatedSectionFooterHeight = 0 + tableView.estimatedSectionHeaderHeight = 0 + return tableView + }() + private var barCoverView: UIView? open var isShow = false - fileprivate var addedWindow: UIWindow? - fileprivate var windowRootView: UIView? - fileprivate var topConstraint: NSLayoutConstraint? - fileprivate var navigationBarCoverViewHeightConstraint: NSLayoutConstraint? - fileprivate var tableViewHeightConstraint: NSLayoutConstraint? - fileprivate let iPhoneXPortraitTopOffset: CGFloat = 88.0 - fileprivate let portraitTopOffset: CGFloat = 64.0 - fileprivate let landscapeTopOffset: CGFloat = 32.0 - fileprivate var topLayoutConstraintConstant: CGFloat { + private var addedWindow: UIWindow? + private var windowRootView: UIView? + private var topConstraint: NSLayoutConstraint? + private var navigationBarCoverViewHeightConstraint: NSLayoutConstraint? + private var tableViewHeightConstraint: NSLayoutConstraint? + private let iPhoneXPortraitTopOffset: CGFloat = 88.0 + private let portraitTopOffset: CGFloat = 64.0 + private let landscapeTopOffset: CGFloat = 32.0 + private var topLayoutConstraintConstant: CGFloat { var offset: CGFloat = 0 if !navigationController.isNavigationBarHidden { offset = navigationController.navigationBar.frame.height + navigationController.navigationBar.frame.origin.y @@ -108,7 +113,7 @@ open class DropdownMenu: UIView { clipsToBounds = true setupGestureView() - initTableView() + setupTableView() NotificationCenter.default.addObserver(self, selector: #selector(self.updateForOrientationChange(_:)), name: UIApplication.willChangeStatusBarOrientationNotification, object: nil) } @@ -123,7 +128,7 @@ open class DropdownMenu: UIView { clipsToBounds = true setupGestureView() - initTableView() + setupTableView() NotificationCenter.default.addObserver(self, selector: #selector(self.updateForOrientationChange(_:)), name: UIApplication.willChangeStatusBarOrientationNotification, object: nil) } @@ -186,7 +191,7 @@ open class DropdownMenu: UIView { } } - fileprivate func setupGestureView() { + private func setupGestureView() { let gestureView = UIView() gestureView.backgroundColor = UIColor.clear addSubview(gestureView) @@ -199,17 +204,14 @@ open class DropdownMenu: UIView { gestureView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hideMenu))) } - fileprivate func initTableView() { - tableView = UITableView(frame: CGRect.zero, style: .grouped) + private func setupTableView() { tableView.separatorStyle = separatorStyle tableView.delegate = self tableView.dataSource = self - tableView.estimatedSectionFooterHeight = 0 - tableView.estimatedSectionHeaderHeight = 0 addSubview(tableView) } - fileprivate func layoutTableView() { + private func layoutTableView() { tableView.translatesAutoresizingMaskIntoConstraints = false updateTableViewHeight() @@ -222,7 +224,7 @@ open class DropdownMenu: UIView { self.tableViewHeightConstraint = tableViewHeightConstraint } - fileprivate func updateTableViewHeight() { + private func updateTableViewHeight() { tableViewHeight = tableviewHeight() let maxHeight = navigationController.view.frame.height - topLayoutConstraintConstant - defaultBottonMargin @@ -236,7 +238,7 @@ open class DropdownMenu: UIView { } } - fileprivate func updateForSectionsChange(_ animations: (() -> Void)? = nil) { + private func updateForSectionsChange(_ animations: (() -> Void)? = nil) { updateTableViewHeight() tableViewHeightConstraint?.constant = tableViewHeight UIView.animate(withDuration: 0.3) { [weak self] in @@ -248,7 +250,7 @@ open class DropdownMenu: UIView { } } - fileprivate func setupTopSeperatorView() { + private func setupTopSeperatorView() { let seperatorView = UIView() seperatorView.backgroundColor = tableViewSeperatorColor addSubview(seperatorView) @@ -259,7 +261,7 @@ open class DropdownMenu: UIView { NSLayoutConstraint.activate([NSLayoutConstraint.init(item: seperatorView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 0.5)]) } - fileprivate func setupNavigationBarCoverView(on view: UIView) { + private func setupNavigationBarCoverView(on view: UIView) { barCoverView = UIView() barCoverView?.backgroundColor = UIColor.clear view.addSubview(barCoverView!) @@ -273,7 +275,7 @@ open class DropdownMenu: UIView { barCoverView?.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(hideMenu))) } - fileprivate func tableviewHeight() -> CGFloat { + private func tableviewHeight() -> CGFloat { var height: CGFloat = 0 sections.enumerated().forEach { if displaySectionHeader { diff --git a/DropdownMenu/SectionHeader.swift b/DropdownMenu/SectionHeader.swift index ca39a21..f8fda7f 100644 --- a/DropdownMenu/SectionHeader.swift +++ b/DropdownMenu/SectionHeader.swift @@ -7,7 +7,12 @@ // open class SectionHeader: UIView { - var titleLabel: UILabel! + var titleLabel: UILabel = { + let titleLabel = UILabel() + titleLabel.translatesAutoresizingMaskIntoConstraints = false + return titleLabel + }() + var style: SectionHeaderStyle = SectionHeaderStyle() convenience init(style: SectionHeaderStyle) { @@ -25,8 +30,6 @@ open class SectionHeader: UIView { } func commonInit() { - titleLabel = UILabel() - titleLabel.translatesAutoresizingMaskIntoConstraints = false titleLabel.font = style.font titleLabel.textColor = style.textColor backgroundColor = style.backgroundColor diff --git a/DropdownMenuDemo/DropdownMenuDemo.xcodeproj/project.pbxproj b/DropdownMenuDemo/DropdownMenuDemo.xcodeproj/project.pbxproj index ecb07d9..586e282 100644 --- a/DropdownMenuDemo/DropdownMenuDemo.xcodeproj/project.pbxproj +++ b/DropdownMenuDemo/DropdownMenuDemo.xcodeproj/project.pbxproj @@ -224,25 +224,25 @@ ACE6DB8E1CF741F6005C6667 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = ZDUX4TJC7F; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; ACE6DBA21CF741F6005C6667 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = 7NLBE99QC4; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; TestTargetID = ACE6DB8E1CF741F6005C6667; }; ACE6DBAD1CF741F6005C6667 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = 7NLBE99QC4; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; TestTargetID = ACE6DB8E1CF741F6005C6667; }; }; }; buildConfigurationList = ACE6DB8A1CF741F6005C6667 /* Build configuration list for PBXProject "DropdownMenuDemo" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -400,7 +400,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -450,7 +450,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -466,7 +466,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenu2; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -480,7 +480,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenu2; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -493,7 +493,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DropdownMenuDemo.app/DropdownMenuDemo"; }; name = Debug; @@ -507,7 +507,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DropdownMenuDemo.app/DropdownMenuDemo"; }; name = Release; @@ -520,7 +520,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuDemoUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = DropdownMenuDemo; }; name = Debug; @@ -533,7 +533,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.teambition.DropdownMenuDemoUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; TEST_TARGET_NAME = DropdownMenuDemo; }; name = Release; diff --git a/DropdownMenuTests/DropdownMenuTests.swift b/DropdownMenuTests/DropdownMenuTests.swift index be0825e..bd89027 100644 --- a/DropdownMenuTests/DropdownMenuTests.swift +++ b/DropdownMenuTests/DropdownMenuTests.swift @@ -28,7 +28,7 @@ class DropdownMenuTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } }