diff --git a/Demo/Demo/EasyPull/UIScrollView+EasyPull.swift b/Demo/Demo/EasyPull/UIScrollView+EasyPull.swift index 2bedf8c..4a5eba3 100644 --- a/Demo/Demo/EasyPull/UIScrollView+EasyPull.swift +++ b/Demo/Demo/EasyPull/UIScrollView+EasyPull.swift @@ -109,6 +109,13 @@ extension UIScrollView { Observer.unableUpExcuting() } + /** + release all of action + */ + public func easy_releaseAll() { + Observer.dropAction = nil + Observer.upAction = nil + } // MARK: private method private func addContentOffsetObserver() { diff --git a/EasyPull.podspec b/EasyPull.podspec index b524f5e..875dae1 100755 --- a/EasyPull.podspec +++ b/EasyPull.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "EasyPull" - s.version = "1.1.3" + s.version = "1.1.4" s.summary = "Let pull-to-refresh Easy for any UIScrollView in Swift" s.homepage = "https://github.com/ronghaopger/EasyPull" s.license = "MIT" diff --git a/EasyPull.xcworkspace/xcuserdata/ronghao.xcuserdatad/UserInterfaceState.xcuserstate b/EasyPull.xcworkspace/xcuserdata/ronghao.xcuserdatad/UserInterfaceState.xcuserstate index 0925f9b..9cbc685 100644 Binary files a/EasyPull.xcworkspace/xcuserdata/ronghao.xcuserdatad/UserInterfaceState.xcuserstate and b/EasyPull.xcworkspace/xcuserdata/ronghao.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/EasyPull/EasyPull/UIScrollView+EasyPull.swift b/EasyPull/EasyPull/UIScrollView+EasyPull.swift index 2bedf8c..4a5eba3 100644 --- a/EasyPull/EasyPull/UIScrollView+EasyPull.swift +++ b/EasyPull/EasyPull/UIScrollView+EasyPull.swift @@ -109,6 +109,13 @@ extension UIScrollView { Observer.unableUpExcuting() } + /** + release all of action + */ + public func easy_releaseAll() { + Observer.dropAction = nil + Observer.upAction = nil + } // MARK: private method private func addContentOffsetObserver() { diff --git a/README.md b/README.md index 039fb69..75cb572 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Note: You can enable/unable Up-Pull using this method. Suitable for scenes witho func unableUpExcuting() ``` -### Customization +### Customization (自定义) The pull-to-refresh view can be customized using the following methods: @@ -72,6 +72,17 @@ Or implement the `EasyViewAutomatic` protocol when you prefer the Automatic mode (see sample Xcode project in `/Demo/MyCusyomView.swift` or `/Demo/EasyPull/DefaultView.swift`) + +### Note (注意) + +释放所有的Action,避免循环引用cycle retain。 + +```Swift + func easy_releaseAll() +``` + +当App要离开某一个使用了EasyPull的viewController时,记得releaseAll哦 + ## Installation ### CocoaPods @@ -81,7 +92,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! -pod 'EasyPull', '~> 1.1.3' +pod 'EasyPull', '~> 1.1.4' ``` ### Source files