• Stars
    star
    272
  • Rank 151,235 (Top 3 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SpringIndicator is indicator and PullToRefresh. Inspired by Material design components.

SpringIndicator

Carthage compatible Version License Platform

Appetize's Demo

  • Refresher is a simple as UIRefreshControl.
  • Don't need to add a UIScrollView delegate.

Indicator Refresher

Image

Requirements

  • Swift 5
  • iOS 8.0 or later
  • tvOS 9.0 or later

How to Install SpringIndicator

Cocoapods

Add the following to your Podfile:

pod "SpringIndicator"

Carthage

Add the following to your Cartfile:

github "KyoheiG3/SpringIndicator"

Swift Package Manager

To install BulletinBoard using the Swift Package Manager, add this dependency to your Package.swift file:

.package(url: "https://github.com/KyoheiG3/SpringIndicator.git", from: "5.1.0")

Usage

Example

Add Code

let indicator = SpringIndicator(frame: CGRect(x: 100, y: 100, width: 60, height: 60))
view.addSubview(indicator)
indicator.start()

RefreshIndicator

let refreshControl = RefreshIndicator()
refreshControl.addTarget(self, action: "onRefresh", forControlEvents: .ValueChanged)
scrollView.addSubview(refreshControl)

Exit refresh

refreshControl.endRefreshing()

Can use Interface Builder

Interface Builder

Variable

Indicator

@IBInspectable var animating: Bool
  • Start the animation automatically in drawRect.
@IBInspectable var lineWidth: CGFloat
  • Line thickness.
@IBInspectable var lineColor: UIColor
  • Line Color.
  • Default is gray.
var lineColors: [UIColor]
  • Line Colors.
  • Can change some colors during rotation.
  • If set, lineColor is not used.
@IBInspectable var lineCap: Bool
  • Cap style.
  • Options are round or square. true is round.
  • Default is false.
@IBInspectable var rotateDuration: Double
  • Rotation duration.
  • Default is 1.5.

RefreshIndicator

let indicator: SpringIndicator
  • Indicator for refresh control.
var isRefreshing: Bool
  • Refreshing status.

Function

Indicator

var isSpinning: Bool
  • During stroke animation is true.
func start()
  • Start animating.
func stop(with: Bool = default, completion: ((SpringIndicator) -> Swift.Void)? = default)
  • Stop animating.
  • If true, waiting for stroke animation.
func strokeRatio(_ ratio: CGFloat)
  • between 0.0 and 1.0.

Refresher

func endRefreshing()
  • Must be explicitly called when the refreshing has completed.

Author

Kyohei Ito

Follow me πŸŽ‰

LICENSE

Under the MIT license. See LICENSE file for details.

More Repositories

1

DynamicBlurView

DynamicBlurView is a dynamic and high performance UIView subclass for Blur.
Swift
967
star
2

GridView

Reusable GridView with excellent performance and customization that can be time table, spreadsheet, paging and more.
Swift
855
star
3

TableViewDragger

A cells of UITableView can be rearranged by drag and drop.
Swift
536
star
4

AttributedLabel

Easy to use, fast, and higher performance than UILabel.
Swift
524
star
5

SimpleAlert

Customizable simple Alert and simple ActionSheet for Swift
Swift
398
star
6

PagingView

Infinite paging, Smart auto layout, Interface of similar to UIKit.
Swift
316
star
7

Keynode

Interactive Keyboard Controller for Swift
Swift
77
star
8

NavigationNotice

Customizable and interactive animated notification UI control.
Swift
75
star
9

ProtobufExample

Example of requesting Protocol Buffers and JSON with Swift. API is Swift or Go.
Swift
67
star
10

Plan

The Plan.framework helps to keep your iOS application design clean.
Swift
36
star
11

RxDisplayLink

RxDisplayLink reactive wrapper for CADisplayLink
Swift
29
star
12

smooth_counter

Dart
24
star
13

Exclusion

Customizable URLCache.
Swift
19
star
14

MountainView

The animation curve looks like Mountain View.
Swift
14
star
15

G3JSON

Objective-C
11
star
16

gRPCExample

Swift
11
star
17

XcodeGenSample

Swift
9
star
18

InfiniteView

Swift
4
star
19

lcov_excluder

It is possible to exclude coverage by editing the contents of the lcov.info file.
Dart
3
star
20

grain

Module management library like requirejs.
JavaScript
2
star
21

CollectionViewGridLayout

How to use grid layout in UICollectionView.
Swift
2
star
22

assets

1
star