huangwenfei / MiniFlawless

iOS Animation Lib.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MiniFlawless

  • MiniFlawless 是一个动画库。
  • MiniFlawless 目前仅支持 iOS。

内容

  • 要求
  • 安装
  • 例子

要求

  • iOS 12+
  • Xcode 15+
  • Swift 5+

安装

  • Swift Package
dependencies: [
    .package(url: "https://github.com/huangwenfei/MiniFlawless.git", .upToNextMajor(from: "0.0.3.3"))
]
  • Cocoapods
pod 'MiniFlawless'

例子

具体请查看 iOS-Example 工程。

  • Tween
import MiniFlawless

let testView = ...

let item = MiniFlawlessItem<CGFloat>.init(
    name: "Test",
    duration: 0.3,
    from: testView.frame.minY,
    to: testView.frame.minY + 240,
    stepper: .tween(.linear),
    completion: { item in
        print("Done")
    })

let mini = MiniFlawlessAnimator(displayItem: item)
mini.startAnimation()
  • Spring
import MiniFlawless

let testView = ...

let item = MiniFlawlessItem<CGFloat>.init(
    name: "Test",
    duration: 0.3,
    from: testView.frame.minY,
    to: testView.frame.minY + 130,
    stepper: .spring(.init()),
    completion: { item in
        print("Done")
    })
    
let mini = MiniFlawlessAnimator(displayItem: item)
mini.startAnimation()

  • MiniFlawless is an animation library.
  • MiniFlawless is currently iOS only.

Content

  • Requirements
  • Installation
  • Examples

Requirements

  • iOS 12+
  • Xcode 15+
  • Swift 5+

Installation

  • Swift Package
dependencies: [
    .package(url: "https://github.com/huangwenfei/MiniFlawless.git", .upToNextMajor(from: "0.0.3.3"))
]
  • Cocoapods
pod 'MiniFlawless'

Examples

See the iOS-Example project for details.

  • Tween
import MiniFlawless

let testView = ...

let item = MiniFlawlessItem<CGFloat>.init(
    name: "Test",
    duration: 0.3,
    from: testView.frame.minY,
    to: testView.frame.minY + 240,
    stepper: .tween(.linear),
    completion: { item in
        print("Done")
    })

let mini = MiniFlawlessAnimator(displayItem: item)
mini.startAnimation()
  • Spring
import MiniFlawless

let testView = ...

let item = MiniFlawlessItem<CGFloat>.init(
    name: "Test",
    duration: 0.3,
    from: testView.frame.minY,
    to: testView.frame.minY + 130,
    stepper: .spring(.init()),
    completion: { item in
        print("Done")
    })
    
let mini = MiniFlawlessAnimator(displayItem: item)
mini.startAnimation()

About

iOS Animation Lib.

License:MIT License


Languages

Language:Swift 92.7%Language:Ruby 7.1%Language:Objective-C 0.2%