diff --git a/RefreshDemo.xcodeproj/project.pbxproj b/RefreshDemo.xcodeproj/project.pbxproj index fb736c5..9a2ba1f 100644 --- a/RefreshDemo.xcodeproj/project.pbxproj +++ b/RefreshDemo.xcodeproj/project.pbxproj @@ -115,7 +115,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = ZouLiangming; TargetAttributes = { 86ECCB291C97F535008A6D58 = { @@ -217,12 +217,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -271,12 +273,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/RefreshDemo/SecondViewController.swift b/RefreshDemo/SecondViewController.swift index 78a40d6..fdd5458 100644 --- a/RefreshDemo/SecondViewController.swift +++ b/RefreshDemo/SecondViewController.swift @@ -30,8 +30,8 @@ class SecondViewController: UITableViewController { let minseconds = 2 * Double(NSEC_PER_SEC) let dtime = DispatchTime.now() + Double(Int64(minseconds)) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dtime, execute: { - for i in 1...10 { - self.content.append(String(i)) + for index in 1...10 { + self.content.append(String(index)) self.tableView.reloadData() self.tableView.isShowLoadingView = false self.tableView.refreshFooter?.isShowLoadingView = true @@ -43,8 +43,8 @@ class SecondViewController: UITableViewController { let dtime = DispatchTime.now() + Double(Int64(minseconds)) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dtime, execute: { let count = self.content.count - for i in count+1...count+5 { - self.content.append(String(i)) + for index in count+1...count+5 { + self.content.append(String(index)) self.tableView.reloadData() } self.tableView.refreshHeader?.endRefreshing() @@ -58,8 +58,8 @@ class SecondViewController: UITableViewController { let dtime = DispatchTime.now() + Double(Int64(minseconds)) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dtime, execute: { let count = self.content.count - for i in count+1...count+5 { - self.content.append(String(i)) + for index in count+1...count+5 { + self.content.append(String(index)) self.tableView.reloadData() } self.tableView.refreshFooter?.endRefreshing() diff --git a/RefreshDemo/UIViewControllerDemo.swift b/RefreshDemo/UIViewControllerDemo.swift index d373698..140aef0 100644 --- a/RefreshDemo/UIViewControllerDemo.swift +++ b/RefreshDemo/UIViewControllerDemo.swift @@ -35,8 +35,8 @@ class UIViewControllerDemo: UIViewController { let minseconds = 3 * Double(NSEC_PER_SEC) let dtime = DispatchTime.now() + Double(Int64(minseconds)) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dtime, execute: { - for i in 0...20 { - self.array.append(String(i)) + for index in 0...20 { + self.array.append(String(index)) } self.tableView.refreshHeader?.endRefreshing() self.tableView.reloadData() @@ -59,8 +59,8 @@ class UIViewControllerDemo: UIViewController { let dtime = DispatchTime.now() + Double(Int64(minseconds)) / Double(NSEC_PER_SEC) DispatchQueue.main.asyncAfter(deadline: dtime, execute: { let count = self.array.count - for i in count+1...count+5 { - self.array.append(String(i)) + for index in count+1...count+5 { + self.array.append(String(index)) self.tableView.reloadData() } self.tableView.refreshFooter?.endRefreshing() diff --git a/RefreshView.xcodeproj/project.pbxproj b/RefreshView.xcodeproj/project.pbxproj index f4ce050..c429768 100644 --- a/RefreshView.xcodeproj/project.pbxproj +++ b/RefreshView.xcodeproj/project.pbxproj @@ -134,7 +134,7 @@ C40F22F61C6331EE00F075CF /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = ZouLiangming; TargetAttributes = { C40F22FE1C6331EE00F075CF = { @@ -220,12 +220,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -278,12 +280,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/RefreshView.xcodeproj/xcshareddata/xcschemes/RefreshView.xcscheme b/RefreshView.xcodeproj/xcshareddata/xcschemes/RefreshView.xcscheme index 50affa0..e765d0b 100644 --- a/RefreshView.xcodeproj/xcshareddata/xcschemes/RefreshView.xcscheme +++ b/RefreshView.xcodeproj/xcshareddata/xcschemes/RefreshView.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/RefreshView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/RefreshView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/RefreshView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/RefreshView/CustomRefreshFooterView.swift b/RefreshView/CustomRefreshFooterView.swift index e7e473f..1c706b2 100644 --- a/RefreshView/CustomRefreshFooterView.swift +++ b/RefreshView/CustomRefreshFooterView.swift @@ -170,7 +170,7 @@ open class CustomRefreshFooterView: CustomRefreshView { } } - override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) { if !isUserInteractionEnabled { return } @@ -192,7 +192,7 @@ open class CustomRefreshFooterView: CustomRefreshView { } } - fileprivate func scrollViewContentOffsetDidChange(_ change: [NSKeyValueChangeKey : Any]?) { + fileprivate func scrollViewContentOffsetDidChange(_ change: [NSKeyValueChangeKey: Any]?) { if state != .idle || !isAutomaticallyRefresh || originY == 0 || cellsCount() == 0 || !isShowLoadingView { return } @@ -211,11 +211,11 @@ open class CustomRefreshFooterView: CustomRefreshView { } } - fileprivate func scrollViewContentSizeDidChange(_ change: [NSKeyValueChangeKey : Any]?) { + fileprivate func scrollViewContentSizeDidChange(_ change: [NSKeyValueChangeKey: Any]?) { originY = scrollView!.contentHeight } - fileprivate func scrollViewPanStateDidChange(_ chnage: [NSKeyValueChangeKey : Any]?) { + fileprivate func scrollViewPanStateDidChange(_ chnage: [NSKeyValueChangeKey: Any]?) { if state != .idle || cellsCount() == 0 || !isShowLoadingView { return } diff --git a/RefreshView/CustomRefreshHeaderView.swift b/RefreshView/CustomRefreshHeaderView.swift index 2a3b663..3e02ded 100644 --- a/RefreshView/CustomRefreshHeaderView.swift +++ b/RefreshView/CustomRefreshHeaderView.swift @@ -138,7 +138,7 @@ open class CustomRefreshHeaderView: CustomRefreshView { } } - override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { + override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) { if !isUserInteractionEnabled || isHidden { return } @@ -154,6 +154,7 @@ open class CustomRefreshHeaderView: CustomRefreshView { } } + // swiftlint:disable identifier_name fileprivate func changeCircleLayer(to value: CGFloat) { let startAngle = kPai/2 let endAngle = kPai/2+2*kPai*CGFloat(value) @@ -179,7 +180,7 @@ open class CustomRefreshHeaderView: CustomRefreshView { } } - fileprivate func scrollViewContentOffsetDidChange(_ change: [NSKeyValueChangeKey : Any]?) { + fileprivate func scrollViewContentOffsetDidChange(_ change: [NSKeyValueChangeKey: Any]?) { if state == .refreshing { if window != nil { var insetT = -scrollView!.offsetY > scrollViewOriginalInset!.top ? -scrollView!.offsetY : scrollViewOriginalInset!.top