From 187f7218ffefeb0a6a470d30696961c972ab4547 Mon Sep 17 00:00:00 2001 From: Rafael Moraes Date: Mon, 30 Oct 2017 10:49:40 -0300 Subject: [PATCH 1/5] Adding ptbr localization --- .../ESPullToRefreshExample.xcodeproj/project.pbxproj | 3 +++ Sources/Animator/pt-BR.lproj/Localizable.strings | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 Sources/Animator/pt-BR.lproj/Localizable.strings diff --git a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj index 9183687..1e6df5e 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj +++ b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj @@ -65,6 +65,7 @@ /* Begin PBXFileReference section */ 2869905A1EAF382C005B3E3E /* ES.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ES.swift; sourceTree = ""; }; + 28F0A8011FA7641000A0639F /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; 5A180DBD1E80112D00F9EE1A /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; 5A180DBF1E80113B00F9EE1A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 5A180DC01E80114200F9EE1A /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; @@ -345,6 +346,7 @@ Base, "zh-Hans", "zh-Hant", + "pt-BR", ); mainGroup = F69200031CDB9A530029EF47; productRefGroup = F692000D1CDB9A530029EF47 /* Products */; @@ -438,6 +440,7 @@ 5A180DBD1E80112D00F9EE1A /* Base */, 5A180DBF1E80113B00F9EE1A /* zh-Hans */, 5A180DC01E80114200F9EE1A /* zh-Hant */, + 28F0A8011FA7641000A0639F /* pt-BR */, ); name = Localizable.strings; path = Animator; diff --git a/Sources/Animator/pt-BR.lproj/Localizable.strings b/Sources/Animator/pt-BR.lproj/Localizable.strings new file mode 100644 index 0000000..4560c27 --- /dev/null +++ b/Sources/Animator/pt-BR.lproj/Localizable.strings @@ -0,0 +1,5 @@ +"Pull to refresh" = "Puxe para recarregar"; +"Release to refresh" = "Solte para recarregar"; +"Loading..." = "Carregando..."; +"Loading more" = "Carregando mais"; +"No more data" = "Não há mais dados"; From 083f949fe6346fa91f48847cdcbbb0b5d331ce19 Mon Sep 17 00:00:00 2001 From: Rafael Moraes Date: Mon, 30 Oct 2017 11:26:24 -0300 Subject: [PATCH 2/5] fixing sample swift compilation errors --- .../project.pbxproj | 20 ++++++++++++++++--- .../xcschemes/ESPullToRefresh.xcscheme | 4 +++- .../Day/ESRefreshDayHeaderAnimator.swift | 2 +- .../Custom/TextView/TextViewController.swift | 6 +++--- .../WeChat/WCRefreshHeaderAnimator.swift | 2 +- .../ViewController.swift | 2 +- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj index 1e6df5e..9652d57 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj +++ b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 2869905B1EAF382C005B3E3E /* ES.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2869905A1EAF382C005B3E3E /* ES.swift */; }; + 28F0A8021FA76DA600A0639F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5A180DBE1E80112D00F9EE1A /* Localizable.strings */; }; 37A073BD1F26F476002EF10F /* ES.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2869905A1EAF382C005B3E3E /* ES.swift */; }; 5A180DBC1E80112D00F9EE1A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5A180DBE1E80112D00F9EE1A /* Localizable.strings */; }; F63613701CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F636136F1CDD9CCD00AA9AF7 /* MTRefreshHeaderAnimator.swift */; }; @@ -322,7 +323,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "egg swift"; TargetAttributes = { F690772C1D0D0AE300BE91FE = { @@ -377,6 +378,7 @@ F6AB6EA61D6AF82100AC33BE /* ESRefreshTableViewCell.xib in Resources */, F69200171CDB9A530029EF47 /* Assets.xcassets in Resources */, F69200151CDB9A530029EF47 /* Main.storyboard in Resources */, + 28F0A8021FA76DA600A0639F /* Localizable.strings in Resources */, F66B80341D86BE36006DDD16 /* ListTableViewCell.xib in Resources */, F6AA6C411CDC80DD00723622 /* WebViewController.xib in Resources */, F6C5F2F71DD2C8C7001DEA80 /* ESPhotoTableViewCell.xib in Resources */, @@ -468,7 +470,7 @@ F69077331D0D0AE300BE91FE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -490,7 +492,7 @@ F69077341D0D0AE300BE91FE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -519,14 +521,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -569,14 +577,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = 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_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/xcshareddata/xcschemes/ESPullToRefresh.xcscheme b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/xcshareddata/xcschemes/ESPullToRefresh.xcscheme index bba3e36..582fada 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/xcshareddata/xcschemes/ESPullToRefresh.xcscheme +++ b/ESPullToRefreshExample/ESPullToRefreshExample.xcodeproj/xcshareddata/xcschemes/ESPullToRefresh.xcscheme @@ -1,6 +1,6 @@ @@ -36,6 +37,7 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/Day/ESRefreshDayHeaderAnimator.swift b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/Day/ESRefreshDayHeaderAnimator.swift index 2ee9ddd..8f904bc 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/Day/ESRefreshDayHeaderAnimator.swift +++ b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/Day/ESRefreshDayHeaderAnimator.swift @@ -85,7 +85,7 @@ public class ESRefreshDayHeaderAnimator: UIView, ESRefreshProtocol, ESRefreshAni } - public func timerAction() { + @objc public func timerAction() { percent += 0.001 if percent >= 1.0 { percent = 0.0 diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/TextView/TextViewController.swift b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/TextView/TextViewController.swift index 69bc5dd..03efd96 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/TextView/TextViewController.swift +++ b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/TextView/TextViewController.swift @@ -33,12 +33,12 @@ class TextViewController: UIViewController { textView.es.addPullToRefresh { [weak self] in DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { - self.num = 0 + self?.num = 0 let style = NSMutableParagraphStyle.init() style.lineSpacing = 0.0 style.firstLineHeadIndent = 10.0 style.alignment = .justified - self?.textView.attributedText = NSAttributedString.init(string: self.text1, attributes: [NSParagraphStyleAttributeName : style, NSFontAttributeName: UIFont.init(name: "ChalkboardSE-Bold", size: 16.0)!, NSForegroundColorAttributeName: UIColor.init(white: 0.3, alpha: 1.0)]) + self?.textView.attributedText = NSAttributedString.init(string: self?.text1 ?? "", attributes: [NSAttributedStringKey.paragraphStyle : style, NSAttributedStringKey.font: UIFont.init(name: "ChalkboardSE-Bold", size: 16.0)!, NSAttributedStringKey.foregroundColor: UIColor.init(white: 0.3, alpha: 1.0)]) self?.textView.es.stopPullToRefresh() } } @@ -74,7 +74,7 @@ class TextViewController: UIViewController { style.lineSpacing = 0.0 style.firstLineHeadIndent = 10.0 style.alignment = .justified - self?.textView.attributedText = NSAttributedString.init(string: str, attributes: [NSParagraphStyleAttributeName : style, NSFontAttributeName: UIFont.init(name: "ChalkboardSE-Bold", size: 16.0)!, NSForegroundColorAttributeName: UIColor.init(white: 0.3, alpha: 1.0)]) + self?.textView.attributedText = NSAttributedString.init(string: str, attributes: [NSAttributedStringKey.paragraphStyle : style, NSAttributedStringKey.font: UIFont.init(name: "ChalkboardSE-Bold", size: 16.0)!, NSAttributedStringKey.foregroundColor: UIColor.init(white: 0.3, alpha: 1.0)]) self?.textView.es.stopLoadingMore() } diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/WeChat/WCRefreshHeaderAnimator.swift b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/WeChat/WCRefreshHeaderAnimator.swift index 9883e2a..7b9b654 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/Custom/WeChat/WCRefreshHeaderAnimator.swift +++ b/ESPullToRefreshExample/ESPullToRefreshExample/Custom/WeChat/WCRefreshHeaderAnimator.swift @@ -76,7 +76,7 @@ public class WCRefreshHeaderAnimator: UIView, ESRefreshProtocol, ESRefreshAnimat self.state = state } - func timerAction() { + @objc func timerAction() { timerProgress += 0.01 self.imageView.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi) * CGFloat(timerProgress)) } diff --git a/ESPullToRefreshExample/ESPullToRefreshExample/ViewController.swift b/ESPullToRefreshExample/ESPullToRefreshExample/ViewController.swift index edb89f6..ad89ed7 100644 --- a/ESPullToRefreshExample/ESPullToRefreshExample/ViewController.swift +++ b/ESPullToRefreshExample/ESPullToRefreshExample/ViewController.swift @@ -37,7 +37,7 @@ public class ViewController: UIViewController, UITableViewDataSource, UITableVie self.navigationController?.navigationBar.isTranslucent = true self.navigationController?.navigationBar.barTintColor = UIColor.init(red: 250/255.0, green: 250/255.0, blue: 250/255.0, alpha: 0.8) - self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.init(red: 38/255.0, green: 38/255.0, blue: 38/255.0, alpha: 1.0), NSFontAttributeName: UIFont.systemFont(ofSize: 16.0)] + self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.init(red: 38/255.0, green: 38/255.0, blue: 38/255.0, alpha: 1.0), NSAttributedStringKey.font: UIFont.systemFont(ofSize: 16.0)] self.navigationController?.navigationBar.tintColor = UIColor.init(red: 38/255.0, green: 38/255.0, blue: 38/255.0, alpha: 1.0) self.navigationItem.title = "Example" From 1e55564305bced6299e29af46255ba559eb4d4e4 Mon Sep 17 00:00:00 2001 From: Rafael Moraes Date: Mon, 30 Oct 2017 12:51:21 -0300 Subject: [PATCH 3/5] adding a way to customize header and footer texts --- README.md | 21 +++++++++++++++++++++ Sources/ESPullToRefresh.swift | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4654914..7db1c57 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,28 @@ let expried = scrollView.espried // expired or not func es.removeRefreshHeader() func es.removeRefreshFooter() ``` +### Customizing header and footer texts +After adding pull to refresh / infinite scroll you can customize the labels with the following methods: + +``` +self.scrollView.es.addPullToRefresh { + //do something.. +} + +self.scrollView.es.customizeHeaderLoadingText(with: "Something different for your app!") +self.webView.scrollView.es.customizeHeaderPullToRefreshText(with: "Something different for your app!") +self.scrollView.es.customizeHeaderReleaseToRefreshText(with: "Something different for your app!") + +self.scrollView.es.addInfiniteScrolling { + //do something... +} + +self.scrollView.es.customizeFooterLoadingText(with: "Something different for your app!") +self.webView.scrollView.es.customizeFooterPullToRefreshText(with: "Something different for your app!") +self.scrollView.es.customizeHeaderFooterToRefreshText(with: "Something different for your app!") + +``` ## Contribution diff --git a/Sources/ESPullToRefresh.swift b/Sources/ESPullToRefresh.swift index 29524e5..5f4cc7c 100644 --- a/Sources/ESPullToRefresh.swift +++ b/Sources/ESPullToRefresh.swift @@ -145,7 +145,38 @@ public extension ES where Base: UIScrollView { public func stopLoadingMore() { self.base.footer?.stopRefreshing() } - + + // Customizing strings + + public func customizeHeaderLoadingText(with text: String) { + guard let animator = self.base.header?.animator as? ESRefreshHeaderAnimator else { return } + animator.loadingDescription = text + } + + public func customizeHeaderPullToRefreshText(with text: String) { + guard let animator = self.base.header?.animator as? ESRefreshHeaderAnimator else { return } + animator.pullToRefreshDescription = text + } + + public func customizeHeaderReleaseToRefreshText(with text: String) { + guard let animator = self.base.header?.animator as? ESRefreshHeaderAnimator else { return } + animator.releaseToRefreshDescription = text + } + + public func customizeFooterLoadingText(with text: String) { + guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } + animator.loadingDescription = text + } + + public func customizeFooterPullToRefreshText(with text: String) { + guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } + animator.pullToRefreshDescription = text + } + + public func customizeFooterReleaseToRefreshText(with text: String) { + guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } + animator.releaseToRefreshDescription = text + } } public extension UIScrollView /* Date Manager */ { From ee6c6081130f6d6319d32f514eac674b3c0e0933 Mon Sep 17 00:00:00 2001 From: Rafael Moraes Date: Mon, 30 Oct 2017 12:54:33 -0300 Subject: [PATCH 4/5] adjusting documentation markup to swift --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7db1c57..94db520 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ func es.removeRefreshFooter() After adding pull to refresh / infinite scroll you can customize the labels with the following methods: -``` +``` swift self.scrollView.es.addPullToRefresh { //do something.. } From 080e9ce49e384af01e7bd1371efd76c40aba0582 Mon Sep 17 00:00:00 2001 From: Rafael Moraes Date: Mon, 30 Oct 2017 13:30:35 -0300 Subject: [PATCH 5/5] fixing footer customization feature and README --- README.md | 6 ++--- .../Animator/ESRefreshFooterAnimator.swift | 26 ++++++++++++++++--- .../Animator/ESRefreshHeaderAnimator.swift | 16 ++++++++++-- Sources/ESPullToRefresh.swift | 14 +++++----- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 94db520..c5bba1f 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ self.scrollView.es.addPullToRefresh { } self.scrollView.es.customizeHeaderLoadingText(with: "Something different for your app!") -self.webView.scrollView.es.customizeHeaderPullToRefreshText(with: "Something different for your app!") +self.scrollView.es.customizeHeaderPullToRefreshText(with: "Something different for your app!") self.scrollView.es.customizeHeaderReleaseToRefreshText(with: "Something different for your app!") self.scrollView.es.addInfiniteScrolling { @@ -159,8 +159,8 @@ self.scrollView.es.addInfiniteScrolling { } self.scrollView.es.customizeFooterLoadingText(with: "Something different for your app!") -self.webView.scrollView.es.customizeFooterPullToRefreshText(with: "Something different for your app!") -self.scrollView.es.customizeHeaderFooterToRefreshText(with: "Something different for your app!") +self.scrollView.es.customizeFooterLoadingMoreText(with: "Something different for your app!") +self.scrollView.es.customizeFooterNoMoreDataText(with: "Something different for your app!") ``` diff --git a/Sources/Animator/ESRefreshFooterAnimator.swift b/Sources/Animator/ESRefreshFooterAnimator.swift index 59e1a33..b0cd411 100644 --- a/Sources/Animator/ESRefreshFooterAnimator.swift +++ b/Sources/Animator/ESRefreshFooterAnimator.swift @@ -27,9 +27,29 @@ import UIKit open class ESRefreshFooterAnimator: UIView, ESRefreshProtocol, ESRefreshAnimatorProtocol { - open var loadingMoreDescription: String = NSLocalizedString("Loading more", comment: "") - open var noMoreDataDescription: String = NSLocalizedString("No more data", comment: "") - open var loadingDescription: String = NSLocalizedString("Loading...", comment: "") + open var loadingMoreDescription: String = NSLocalizedString("Loading more", comment: ""){ + didSet { + if loadingMoreDescription != oldValue { + titleLabel.text = loadingMoreDescription; + } + } + } + + open var noMoreDataDescription: String = NSLocalizedString("No more data", comment: ""){ + didSet { + if noMoreDataDescription != oldValue { + titleLabel.text = noMoreDataDescription; + } + } + } + + open var loadingDescription = NSLocalizedString("Loading...", comment: "") { + didSet { + if loadingDescription != oldValue { + titleLabel.text = loadingDescription; + } + } + } open var view: UIView { return self } open var duration: TimeInterval = 0.3 diff --git a/Sources/Animator/ESRefreshHeaderAnimator.swift b/Sources/Animator/ESRefreshHeaderAnimator.swift index b24c4a2..39965d6 100644 --- a/Sources/Animator/ESRefreshHeaderAnimator.swift +++ b/Sources/Animator/ESRefreshHeaderAnimator.swift @@ -36,8 +36,20 @@ open class ESRefreshHeaderAnimator: UIView, ESRefreshProtocol, ESRefreshAnimator } } } - open var releaseToRefreshDescription = NSLocalizedString("Release to refresh", comment: "") - open var loadingDescription = NSLocalizedString("Loading...", comment: "") + open var releaseToRefreshDescription = NSLocalizedString("Release to refresh", comment: "") { + didSet { + if pullToRefreshDescription != oldValue { + titleLabel.text = releaseToRefreshDescription; + } + } + } + open var loadingDescription = NSLocalizedString("Loading...", comment: "") { + didSet { + if loadingDescription != oldValue { + titleLabel.text = loadingDescription; + } + } + } open var view: UIView { return self } open var insets: UIEdgeInsets = UIEdgeInsets.zero diff --git a/Sources/ESPullToRefresh.swift b/Sources/ESPullToRefresh.swift index 5f4cc7c..d96947a 100644 --- a/Sources/ESPullToRefresh.swift +++ b/Sources/ESPullToRefresh.swift @@ -164,18 +164,18 @@ public extension ES where Base: UIScrollView { } public func customizeFooterLoadingText(with text: String) { - guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } + guard let animator = self.base.footer?.animator as? ESRefreshFooterAnimator else { return } animator.loadingDescription = text } - public func customizeFooterPullToRefreshText(with text: String) { - guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } - animator.pullToRefreshDescription = text + public func customizeFooterLoadingMoreText(with text: String) { + guard let animator = self.base.footer?.animator as? ESRefreshFooterAnimator else { return } + animator.loadingMoreDescription = text } - public func customizeFooterReleaseToRefreshText(with text: String) { - guard let animator = self.base.footer?.animator as? ESRefreshHeaderAnimator else { return } - animator.releaseToRefreshDescription = text + public func customizeFooterNoMoreDataText(with text: String) { + guard let animator = self.base.footer?.animator as? ESRefreshFooterAnimator else { return } + animator.noMoreDataDescription = text } }