All Projects → micazeve → Magearrefreshcontrol

micazeve / Magearrefreshcontrol

Licence: mit
An iOS refresh control with gear animation

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Magearrefreshcontrol

react-native-js-tableview
A JavaScript implementation for TableView that looks great on both iOS and Android.
Stars: ✭ 23 (-90.04%)
Mutual labels:  uitableview, tableview
Aiforms.settingsview
SettingsView for Xamarin.Forms
Stars: ✭ 274 (+18.61%)
Mutual labels:  uitableview, tableview
Tabanimated
A skeleton screen framework based on native for iOS. (一个由iOS原生组件映射出骨架屏的框架,包含快速植入,低耦合,兼容复杂视图等特点,提供国内主流骨架屏动画的加载方案,同时支持上拉加载更多、自定制动画。)
Stars: ✭ 2,909 (+1159.31%)
Mutual labels:  ios-animation, uitableview
React Native Tableview Simple
Flexible and lightweight React Native component for UITableView made with pure CSS
Stars: ✭ 357 (+54.55%)
Mutual labels:  uitableview, tableview
Swipecellkit
A swipeable UITableViewCell or UICollectionViewCell with support for:
Stars: ✭ 5,745 (+2387.01%)
Mutual labels:  uitableview, tableview
Tdbadgedcell
TDBadgedCell is a table view cell class that adds a badge, similar to the badges in Apple's own apps
Stars: ✭ 1,444 (+525.11%)
Mutual labels:  uitableview, tableview
iOSProjects
It's project that contains different applications developed with Swift 5.7 👨‍💻👩🏼‍💻🧑🏿‍💻
Stars: ✭ 122 (-47.19%)
Mutual labels:  tableview, ios-animation
Ezplayer
基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定制性强,支持react-native。
Stars: ✭ 377 (+63.2%)
Mutual labels:  uitableview, tableview
Flow
Declarative approach to populate and manage UITableViews (see https://github.com/malcommac/FlowKit)
Stars: ✭ 421 (+82.25%)
Mutual labels:  uitableview, tableview
React Native Ezplayer
EZPlayer component for react-native apps
Stars: ✭ 47 (-79.65%)
Mutual labels:  uitableview, tableview
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+4577.06%)
Mutual labels:  ios-animation, uitableview
Swiftycomments
UITableView based component designed to display a hierarchy of expandable/foldable comments.
Stars: ✭ 200 (-13.42%)
Mutual labels:  uitableview
Hgplaceholders
Nice library to show placeholders and Empty States for any UITableView/UICollectionView in your project
Stars: ✭ 2,048 (+786.58%)
Mutual labels:  uitableview
Tqtableviewcellremovecontroller
A table view cell remove animation with FBPOP
Stars: ✭ 166 (-28.14%)
Mutual labels:  tableview
Shift
Animate gradient changes with time or motion for iOS Swift
Stars: ✭ 165 (-28.57%)
Mutual labels:  ios-animation
Expandabletable
AZExpandable is a lightweight proxy for UITableView to expand cells.
Stars: ✭ 218 (-5.63%)
Mutual labels:  uitableview
Rploadinganimation
Loading animations 🌀 by using Swift CALayer
Stars: ✭ 198 (-14.29%)
Mutual labels:  ios-animation
Vbpiledview
Simple and beautiful stacked UIView to use as a replacement for an UITableView, UIImageView or as a menu
Stars: ✭ 164 (-29%)
Mutual labels:  uitableview
Jztvosparallaxbutton
📺 tvOS Button with Parallax Effect (ObjC)
Stars: ✭ 161 (-30.3%)
Mutual labels:  ios-animation
Swform
iOS 高度封装自适应表单(重构版)
Stars: ✭ 159 (-31.17%)
Mutual labels:  tableview

README

Version License Platform

MAGearRefreshControl is a fully customizable iOS refresh control with gear animation for tableview refresh, writen in Swift.

MAGearRefreshControl

Edit from 20/02/17:

This component is now compatible with Swift 3.0. The swift-2.0 branch is still available.

Edit from 16/11/15:

A new enum, MAGearStyle, was added in order to custom single gears within the gear group.

  • .Normal : Full gear, the one you knew from the beginning :)
  • .Branched: Gear with branchs inside of it. Since it's difficult to describe, a picture will help :

BranchedGear

Now you can easily add your own gear styles and I will gladly merge them.

Edit from 23/06/15:

An intermediate class, MAAnimatedMultiGearView, was added in order to animate rotation without having to use an MAGearRefreshControl object.

Credits:

This project is inspired by this dribble post. The main structure of the refresh Control is based on EGOTableViewPullRefresh.

How to use:

Contents:

MAGearRefreshControl is made of five base classes you can use as you wish :

  • MAGear : This class represents a gear in the most abstract way, without any graphical code related.
  • MASingleGearView : This UIView subclass is used to draw a gear.
  • MAMultiGearView : This UIView subclass is used to draw multiples gears.
  • MAAnimatedMultiGearView : This MAMultiGearView subclass is used to draw and animate multiple gears
  • MAGearRefreshControl : This MAAnimatedMultiGearView subclass is used to draw multiples gears and offers the same interactions as an UIRefreshControl.

Refresh control

MAGearRefreshControl must be used from an UITableViewController subclass or UIViewController subclass with an UITableView. Examples are provided for both cases.

refreshControl = MAGearRefreshControl(frame: CGRect(x: 0, y: -self.myTableView.bounds.height, width: self.view.frame.width, height: self.myTableView.bounds.height))
    refreshControl.backgroundColor =  UIColor.initRGB(34, g: 75, b: 150)
    _ = refreshControl.addInitialGear(nbTeeth:12, color: UIColor.initRGB(92, g: 133, b: 236), radius:16)
    refreshControl.delegate = self
    self.tableView.addSubview(refreshControl)

You can add new gears easily with a single method :

    _ = refreshControl.addLinkedGear(0, nbTeeth:16, color: UIColor.blue, angleInDegree: 30)
    _ = refreshControl.addLinkedGear(0, nbTeeth:32, color: UIColor.red, angleInDegree: 190)
    
    // Gear with branch style :
    refreshControl.addLinkedGear(1, nbTeeth:14, color: yellowColor(), angleInDegree: 20, gearStyle: .WithBranchs)
    
    // Gear with branch style and custom number of branchs:
    refreshControl.addLinkedGear(1, nbTeeth:45, color: greenColor(), angleInDegree: -50, gearStyle: .WithBranchs, nbBranches:12))

Now you have to respect the MAGearRefreshDelegate protocol :

  // Method called to know if the data source is loading or no
   func MAGearRefreshTableHeaderDataSourceIsLoading(_ view: MAGearRefreshControl) -> Bool {
       return isLoading
   }

   // Method called when the pull to refresh move was triggered.
   func MAGearRefreshTableHeaderDidTriggerRefresh(_ view: MAGearRefreshControl) {
       refresh()
   }

The refresh control must be notified of scrolling events and when the data is loaded using MAGearRefreshScrollViewDidEndDragging, MAGearRefreshScrollViewDidScrolland MAGearRefreshScrollViewDataSourceDidFinishedLoading methods. The sample project illustrate when to call these methods.

Licence:

MAGearRefreshControl is under MIT Licence so you can use/modify it as you wish. Any feedback will be appreciated.

Contact:

@micazeve
[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].