Coder Social home page Coder Social logo

fdmprogressview's Introduction

功能

  • 支持修改拖拽速度。
  • 支持添加自定义拖动控件。
  • 支持显示播放进度与加载进度。
  • 支持动态修改进度条与拖动控件的颜色与大小。

注意

  • 初始化【ProgressView】时的高度即为拖动控件触控范围。
  • 修改【progressHeight】属性并不能修改触控范围。
 /*可用属性*/
 var progressHeight: CGFloat    // 进度条高度
 var dragSpeed: CGFloat    // 拖拽速度
 var currentValue: CGFloat   // 当前播放进度
 var loadValue: CGFloat    // 当前加载进度
 var controlSize: CGSize    // 拖动控制子视图Size
 var totalProgressColor: UIColor?    // 总进度颜色
 var loadProgressColor: UIColor?    // 加载进度颜色
 var currentProgressColor: UIColor?    // 当前进度颜色
 /*可用方法*/

 // 设置当前播放进度值 
 // - parameter value: 播放进度
 func setCurrentProgressValue(_ value: CGFloat)

 // 设置加载进度值 
 // - parameter value: 加载进度
 func setLoadProgressValue(_ value: CGFloat)

 // 设置控制按钮子视图
 // - 控制按钮的点击范围不会发生变化
 // - parameter view: 子视图
 // - parameter size: 子视图大小
 func setControlSubView(_ view: UIView, size: CGSize)

 // 重新布局视图
 func resetProgressView()
 /* 代理方法 - FDMProgressViewDelegate */

 // 进度条正在拖动时回调
 @objc func progressView(_ progressView: FDMProgressView, didDraggingProgressView currentValue: CGFloat)

 // 开始点击拖动视图时回调
 @objc optional func progressView(_ progressView: FDMProgressView, didTouchBeginDragView currentValue: CGFloat)

 // 停止点击拖动视图时回调
 @objc optional func progressView(_ progressView: FDMProgressView, didTouchEndDragView currentValue: CGFloat)

fdmprogressview's People

Contributors

tremblecat avatar

Stargazers

 avatar  avatar  avatar  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.