Latest 1.0.0
Homepage https://github.com/LaudyLaw/LSPlayPauseButton
License MIT
Platforms ios 9.0
Authors

English

Overview

This project is a swift version of XLPlayButton thanks for XianLiang Meng

The play&pause button include style of iQiYi and YouKu

Usage

The LSPlayPauseButton is a sub class of UIButton, you can use the normal initiate method:

let button = LSPlayPauseButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60), style: .youku, state: .play)

You can also use lazy init method

let button = LSPlayPauseButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60))

The lazy version use style of iQiYi as default style and pause state as the default state of the button. (You must expicity init the frame since the animation will use the frame size)

You change the button’s state use the buttonState property change the state of the button

button.buttonState = .play

or

button.buttonState = .pause

Others

I’ll add Cocoapods support later, please keep following of new version.

中文

简介

这是一个使用Swift重写的 XLPlayButton, 感谢XianLiang Meng

LSPlayPauseButton包含了爱奇艺优酷两种国内常见的播放暂停按钮的app端动画展示

使用方法

LSPlayPauseButton继承自UIKit的UIButton类,你可以使用完整初始化方法

let button = LSPlayPauseButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60), style: .youku, state: .play)

你也可以使用如下的简单初始化方法

let button = LSPlayPauseButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60))

简单初始化方法以爱奇艺的样式为默认样式,以暂停状态为按钮的初始状态(初始化必须设置正确的frame参数,这是因为播放暂停按钮的动画需要根据frame的尺寸来进行设置)

使用对象的buttonState属性来对按钮的状态进行更改

button.buttonState = .play

或者

button.buttonState = .pause

其他

后续会添加Cocoapods的支持,敬请关注

Latest podspec

{
    "name": "LSPlayPauseButton",
    "version": "1.0.0",
    "license": "MIT",
    "summary": "Video play button with animation style of iQiYi and YouKu",
    "homepage": "https://github.com/LaudyLaw/LSPlayPauseButton",
    "description": "This is a video play button with animation style of iQiYi and YouKu, which implement by Swift.",
    "authors": {
        "Luo Song": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LaudyLaw/LSPlayPauseButton.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Source/*.swift",
    "pushed_with_swift_version": "3.1"
}

Pin It on Pinterest

Share This