Git Product home page Git Product logo

crrefresh's People

Contributors

imwcl avatar realmezjt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crrefresh's Issues

Ramotion Animation Intiializes with Circle Layer shown

There is an issue with RamotionBallLayer()

When you use the RamotionAnimation, a user can scroll down through a list (assuming the refresh is in header). When they scroll back up quickly, however, I noticed a bug where the while cirlce will appear, blocking content on the screen, even though it is not animating.

A quick-fix for this would be set the 'isHidden' attribute in the initialization method as shown below:


class RamotionBallLayer: CALayer {

init(frame: CGRect, duration: CFTimeInterval, moveUpDist: CGFloat, color: UIColor = .white) {
        upDuration = duration
        super.init()
        self.frame = frame
        let circleWidth = min(frame.size.width, frame.size.height)
        circleLayer = CircleLayer(size: circleWidth, moveUpDist: moveUpDist, frame: frame, color: color)
        addSublayer(circleLayer)

        //  Hide the ball layer on init
        isHidden = true
    }

}

Swift 4

Declarations from extensions cannot be overridden yet

removeFooter之后,scrollViewInsets没有重置

你好
我正在使用你的框架搭建也页面的刷新加载功能。出现了以下问题

当我反复调用添加footer,会出现整个scrollView的inset.bottom持续增加。即使我在重新添加之前移除了上一个footer,scrollView的inset.bottom也不会重置。

声明:我没有在调戏框架,而是某个需求页面导致当前页面根据不同的筛选条件,产生分页或者不分页的情况,所以会出现反复调用添加和删除【好像没有找到使header、footer失效的选项_(:з」∠)_ 】

Start refreshing by code

Currently the component supports real pull of scrollview, is there any possibility where the scrolling could be started programmatically?

不支持largeTitle

不过至今也没在 GitHub 发现别的支持 largeTitle 的刷新和上推隐藏导航栏和这两种组件

下拉箭头不显示

下来箭头不显示,可否用下面代码解决

fileprivate let imageView: UIImageView = {
        let imageView = UIImageView.init()
        if /* Carthage */ let bundle = Bundle.init(identifier: "com.eggswift.CRRefresh") {
            imageView.image = UIImage(named: "refresh_arrow", in: bundle, compatibleWith: nil)
        } else if /* CocoaPods */ let bundle = Bundle.init(identifier: "org.cocoapods.CRRefresh") {
            imageView.image = UIImage(named: "NormalHeader.bundle/images/refresh_arrow", in: bundle, compatibleWith: nil)
        } else /* Manual */ {
            imageView.image = UIImage(named: "refresh_arrow")
        }
        
//        imageView.image = crBundle?.imageFromBundle("refresh_arrow")
        return imageView
    }()

Change Title label text

--> Is there any way to modify the title texts from "Pull down to refresh", "Release to refresh" to something else ?

ScrollView partially hidden by navigation bar (large titles)

When we force refresh using the HeadRefresh (with NormalHeaderAnimator), when the scrollView populates with cells (in my case is a collectionView) the first cell is partially hidden behind the navigation bar, but after touching/scrolling the scrollView the collectionView automatically snaps itself on the correct position and the bug is gone.

After headRefresh finishes to load the data:
photo_2021-03-14 16 57 28

After touching/scrolling the collectionView:
photo_2021-03-14 16 57 31

Has anyone experienced this before? How can I fix it?

isIgnoreObserving 来判断offset并不准确

在kvo里面添加如下打印 能打印出来 如果cell的大小为一个屏幕高度 会造成 回退不正常

            if keyPath == CRRefreshComponent.contentSizeKeyPath {
                if isIgnoreObserving == false {
                    sizeChange(change: change)
                }
            } else if keyPath == CRRefreshComponent.offsetKeyPath {
                if isIgnoreObserving == false {
                    offsetChange(change: change)
                    if isIgnoreObserving {
                        print("qqqqqq")
                    }
                }
            }

need for objective c

hi i need to use it in my app but my code is in objective ci am unable to call method in my class
what is tableview.cr?

Insets issue

Has anybody tested this for iOS 11? If you set header before viewDidAppear, than first row(s) are hided under navigation bar. If you try to begin end animation multiple times or even in right order one by one, than the same...

多次调用时,尤其弱网情况下,scrollview的contentInset.top计算有问题

您好,首先很感谢作者写了这个纯swift的刷新控件库,通过学习源码,自己也学习了很多,再次感谢!
我在使用过程中遇到了上面的问题,猜测应该是在下拉刷新重新计算scrollview的contentInset.top时,多计算了一次animator.hold,导致刷新结束后,tableview会有向上偏移的情况,刚好偏移一个animator.hold。
项目进度原因,我并没有深入调用机制去查询根本原因,这里我用了比较trick的方法解决了此问题。
CRRefresh 版本 1.0.9
文件: CRRefreshHeaderView.swift
lineNum: 104
screen shot 2018-08-10 at 1 28 13 pm

如果作者有时间,麻烦看下此问题,期待下个版本解决,感谢!

上拉不放手,tableView也会弹回

上拉加载的时候,上拉不放手,tableView会弹回,然后重复加载状态,然后导致多次加载。
是什么原因footer没有像header一样,添加拖拽手势的判断呢?没有pulling状态的判断

Footer keeps triggering

I'm experiencing a issue where footer keeps triggering once i trigger it manually.

image

here the code

table.cr.addFootRefresh(animator: NormalHeaderAnimator()) { [weak self] in
            guard let self = self else { return }
            
            if self.selectedFilter.rawValue > SearchFilterType.All.rawValue {
                self.handleSearch(for: trim(self.txtSearch.text))
            }
            
            self.table.cr.endLoadingMore()
}

and in handleSearch, i'm query the database and then reloading the tableview

根据下拉的百分比做旋转动画有问题

在func refresh(view: CRRefreshComponent, progressDidChange progress: CGFloat)这个函数中添加让UIView旋转的动画代码:
imageView.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi)*progress)
imageView的变形有异常,希望开发者看看。

iOS11中 上拉刷新会产生循环回调

image
iOS11.3 中 在上拉刷新的回调里调用 reloadData,这个if 语句总是能够执行 (等号条件成立),就会一直刷新,形成死循环。由于iOS11中 tableView的特殊性 这里改成小于或者加一段偏移。

Missing files

Hey,

Thanks for your awesome repo.

I installed it by using CocoaPods, I added this line to my Podfile: pod 'CRRefresh'
However, there are many missing files as you can see in the attached image. what is the problem?
I need to use FastAnimator but I can't because all its files didn't install.

screen shot 2017-05-08 at 10 17 38 am

Pull to Refresh breaks with iOS13

It doesn't appear that there is much activity support iOS13/Swift 5, so thought I'd drop a very hacky solution for supporting pull-to-refresh, particularly in a modal.

Since CRRefresh uses tableView.addSubview instead of tableView.refreshControl, the experience gets a bit odd in iOS13, in particular with modal sheets. Pulling down to refresh will actually dismiss the modal, instead of refreshing the tableView. There are some solutions that use isModalInPresentation = true, but that allows for a slight drag of the modal, and no affordance showing that PTR is happening. See this SO thread:

My solution was to fake the RefreshControl, but hide it.

extension UITableView {
  func iOS13RefreshControlHack() {
    if #available(iOS 13.0, *) {
      let refreshControl       = UIRefreshControl()
      refreshControl.tintColor = .clear
      
      self.refreshControl      = refreshControl
      self.refreshControl?.addTarget(self, action: #selector(handleRefreshControl), for: .valueChanged)
    }
  }
  
  @objc func handleRefreshControl() {
    self.refreshControl?.endRefreshing()
  }
}

Then call from your tableView via (or whatever better name you choose):

self.tableView.iOS13RefreshControlHack()

This triggers the modal to behave properly when PTR is requested, but also continues to show the CRRefresh custom spinners/checkmark instead. In addition, you can still dismiss the modal by pulling down from the navigationBar, but the modal does not move when pulling on the table cells.

Hope it helps someone.

infinite-scrolling

Thanks for good lib ! I use it already.
But with infinite-scrolling feature, how i can trigger it when not yet scroll to bottom? I want to load more when scroll about 80% of content size.

异常启动的下拉刷新动画

iPhone X, iOS 12.1 环境下
在UIViewController显示时,CRRefresh自动开启了刷新动画,调用endHeaderRefresh 后顶部下移。
调试后才发现,CRRefresh是监听contentOffset 来做刷新的。
而UIViewController为了实现“Under Top Bars”, tableView.contentOffset 会被设置为 CGPoint(x: 0, y: -88) 。这就造成了冲突。
所以, CRRefresh能否只是监听由手指拖拽引起的contentOffset变化来做刷新的?
或者有什么其它办法可以解决上述问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.