InteractivePlayerView 3.0

InteractivePlayerView 3.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2018年9月
SPM支持SPM

Ahmet维护。



InteractivePlayerView

自定义iOS音乐播放界面

屏幕

关于

InteractivePlayerView 是一个 IBDesignableView(自定义视图),具有自己的进度条、封面图像和操作按钮。

安装

下载项目,并将InteractivePlayerView文件夹复制到您的项目中,然后您可以在任何文件中使用它。

需求

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3.0+

Cocoapods

platform :ios, '8.0'
use_frameworks!

pod 'InteractivePlayerView', '2.0'

使用说明

  • 在Storyboard中添加您的视图
  • 调整您视图的大小为正方形(这样看起来更好)
  • 设置视图的类为InteractivePlayerView
  • 等待它在Storyboard中构建并设置变量
  • 然后创建视图的属性并将其委托设置为self以使用它的委托方法,即可使用!
  @IBOutlet var ipv: InteractivePlayerView!
  
  // set delegation
  self.ipv!.delegate = self

  // duration of music
  self.ipv.progress = 120.0
  
  // start - stop player
  self.ipv.start()
  self.ipv.stop()
  
  // restart player with duration
  self.ipv.restartWithProgress(duration: 50)

  /* InteractivePlayerViewDelegate METHODS */
    func actionOneButtonTapped(sender: UIButton, isSelected: Bool) {
        println("ActionOneButton tapped")
    }
    
    func actionTwoButtonTapped(sender: UIButton, isSelected: Bool) {
        println("ActionTwoButton tapped")
    }
    
    func actionThreeButtonTapped(sender: UIButton, isSelected: Bool) {
        println("ActionThreeButton tapped")

    }

实用方法

  // set progress colors
  self.ipv.progressEmptyColor = UIColor.yellowColor()
  self.ipv.progressFullColor = UIColor.redColor()
  // get and set isSelected value of action buttons
  let isSelected = self.ipv.isActionOneSelected
  self.ipv.isActionOneSelected = true
  // Buttons are also square and setting one value to width and height is enough. And also you can set action button's images
  self.ipv.buttonSizes = 30.0

  self.ipv.actionOne_icon_selected = UIImage(named: "shuffle_selected.png")
  self.ipv.actionOne_icon_unselected = UIImage(named: "shuffle_unselected.png")

  self.ipv.coverImage = UIImage(named: "imagetest.png")

设计

以下是原始设计

许可证

Copyright 2015 Ahmet Keskin.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.