Code Monkey home page Code Monkey logo

lattetime's Introduction

LatteTime

Platform Cocoapods Compatible

LatteTime 可用于网络加载时候的Loading动画,通过便捷的方式能够快速展现生动与众不同的加载效果,并且可以自定义许多参数来达到自己想要的效果。

	override func viewDidLoad() {
		super.viewDidLoad()
        
		let loadingView = LatteTime()
        
		self.view.addSubview(loadingView)
        
		loadingView.play()
	}

功能

  • 可在viewDidLoad或者其他自定义View的初始化时中直接添加。
  • AutoLayout可自动调整大小,不需要设定。
  • 能够控制动画单次循环时长、跳跃高度、颜色、落地变形程度等参数,可实时转化。
  • 通过CADisplayLink的方式控制动画,避免如CAAnimation在从后台返回时动画停车。

需要

  • iOS 8.0+
  • Swift 4

安装

CocoaPods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'LatteTime', '~> 0.9.0'
end

参数说明

LatteTime.defaultStyle

可在AppDelegate获其他方式启动时,来配置LatteTime的配置,在之后的初始化中会启用这项配置、

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        
        LatteTime.defaultStyle.pointColor = UIColor.blue
        
        return true
    }

LatteTimeStyle.animationDuration

用于控制小球单次掉落或者升级的时长

LatteTimeStyle.pointColor

小球的颜色

pointDiameter

小球的直径

pointJumpHeight

小球的跳跃高度

pointCurvature

小球变形的程度 0.0 - 1.0之间

pointPadding

小球的间距

lattetime's People

Contributors

hanshuushi avatar

Watchers

 avatar

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.