Swiftpack.co -  lloydkeijzer/SwimpleAudio as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
lloydkeijzer/SwimpleAudio
Simple audio playback in Swift
.package(url: "https://github.com/lloydkeijzer/SwimpleAudio.git", from: "2.0.0")

SwimpleAudio

version issues license size

Simple audio playback in Swift.

SwimpleAudio is part of the Swimple packages series. Swimple stands for Simple Swift. These packages make coding with Swift simpler and more convenient.

Swift Package Manager ๐Ÿ“ฆ

From within Xcode 11 or up you can add SwimpleAudio as a Swift Package:

  1. Select your project
  2. Go to Swift packages
  3. Add a package (+)
  4. Enter https://github.com/lloydkeijzer/SwimpleAudio.git as the package repository url
  5. Select the version you want to use and click next

You're now able to import SwimpleAudio in your source code ๐ŸŽ‰

Binding audio ๐Ÿ”Š

You can easily bind any sound effect to an action of a UIControl object.

class ViewController: UIViewController {

  let button = UIButton()

  override func viewDidLoad() {
    super.viewDidLoad()
    button.addSound(named: "button_click.mp3", for: .touchUpInside)
  }
  
  deinit {
    button.removeTargets()
  }
}

Delaying a sound effect after an UIControl.Event triggers.

button.addSound(named: "button_click.mp3", for: .touchUpInside, delay: .seconds(3))

Repeating a sound effect a number of times after an UIControl.Event triggers.

button.addSound(named: "button_click.mp3", for: .touchUpInside, repeats: 5)

GitHub

link
Stars: 3
Last commit: 1 year ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jackโ€™d and SCRUFF. We are two of the worldโ€™s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

Production ready ๐Ÿ’ช
1 year ago

SwimpleAudio is production ready as of version 2.0.0 ๐Ÿ‘๐Ÿป. After swapping the binded actions logic with the code block sleeves the audio started working.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API