• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

KyoheiG3/SpringIndicator: SpringIndicator is indicator and PullToRefresh. Inspir ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

KyoheiG3/SpringIndicator

开源软件地址(OpenSource Url):

https://github.com/KyoheiG3/SpringIndicator

开源编程语言(OpenSource Language):

Swift 96.0%

开源软件介绍(OpenSource Introduction):

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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap