Uneri 1.0.1

Uneri 1.0.1

Atsushi Yamamoto 维护。



Uneri 1.0.1

  • 作者:
  • Atsuthi Yamamoto

Uneri

Uneri(うねり)是一个波浪动画视图库🌊

截图

Screenshot

安装

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理器。您可以运行以下命令进行安装

$ gem install cocoapods

要使用 CocoaPods 将 Uneri 集成到您的 Xcode 项目中,请在 Podfile 中指定它

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

target '<Your Target Name>' do
    pod 'Uneri'
end

然后,运行以下命令

$ pod install

Carthage

Carthage 是一个去中心化的依赖管理器,它构建您的依赖并提供二进制框架。

您可以使用以下命令通过 Homebrew 安装 Carthage

$ brew update
$ brew install carthage

使用Carthage将Uneri集成到您的Xcode项目中,请在您的Cartfile中指定它。

github "jimmythai/Uneri"

运行carthage update以构建框架,并将构建的Uneri.framework拖入您的Xcode项目。

需求

  • iOS 8.0+
  • Xcode 9.0+
  • Swift 4+

使用

初始化

import Uneri

let oceanHeight = CGFloat(200)
let frame = CGRect(x: 0, y: view.frame.size.height - oceanHeight, width: view.frame.size.width, height: oceanHeight)

// with default colors
let uneri0 = Uneri(frame: frame)

// with custom colors
let uneri1 = Uneri(frame: frame, mainColor: .orange, subColor: .purple)

// width custom gradient colors
let uneri2 = Uneri(frame: frame, mainGradientColors: [.orange, .purple], subGradientColors: [.purple, .purple])

// the uneri automatically starts
view.addSubview(uneri0)

设置

// uneri speed, 0.5 by default
uneri.uneriSpeed = 0.8

// uneri height, 10.0 by default
uneri.uneriHeight =8.0

// main uneri color, .orange by default
uneri.mainColor = .red

// sub uneri color, .purple by default
uneri.subColor = .orange

// main gradient colors, [.orange, .purple] by default
uneri.mainGradientColors = [.red, .orange]

// sub gradient colors, [.purple, .orange] by default
uneri.subGradientColors = [.orange, .red]

// main alpha, 0.7 by default
uneri.mainAlpha = 0.6

// sub alpha, 0.1 by default
uneri.subAlpha = 0.2

控制Uneri动画

// pause the uneri animation
uneri.pause()

// resume the uneri animation
uneri.resume()

许可证

Uneri遵循MIT许可证发布。详情请见LICENSE