-
Notifications
You must be signed in to change notification settings - Fork 6
Installation Guide
SwiftyPlayer supports from Swift 5.0.
This is the guide for SwiftyPlayer used in a UIKit app.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapodsTo integrate SwiftyPlayer into your project using CocoaPods, specify it to a target in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
# your other pod
# ...
pod 'SwiftyPlayer', '~> 1.0.0'
endThen, run the following command:
$ pod install You should open the {Project}.xcworkspace instead of the {Project}.xcodeproj after you installed anything from CocoaPods.
Carthage is a decentralized dependency manager for Cocoa application. To install the Carthage tool, you can use Homebrew.
$ brew update
$ brew install carthageTo integrate SwiftyPlayer into your project using Carthage, specify it in your Cartfile.
github "shiwei93/SwiftyPlayer" ~> 1.0.0
Then, run the following command to build the SwiftyPlayer framework:
$ carthage update SwiftyPlayer --platform iOSAt last, you need to set up your Xcode project manually to add the SwiftyPlayer framework:
- On your application targets "General" settings tab, in the "Linked Frameworks and Libraries" section, drag and drop
SwiftyPlayer.frameworkfrom the Carthage/Build folder on disk. - On your application targets "Build Phases" settings tab, click the "+" icon and choose "New Run Script Phase". Create a Run Script with the following content:
/usr/local/bin/carthage copy-frameworks
- Add the paths to the frameworks you want to use under “Input Files”:
$(SRCROOT)/Carthage/Build/iOS/SwiftyPlayer.framework
- Add the paths to the copied frameworks to the “Output Files”:
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftyPlayer.framework
From Xcode 11, you can use Swift Package Manager to add SwiftyPlayer to your project.
- Select File > Swift Packages > Add Package Dependency. Enter https://github.com/shiwei93/SwiftyPlayer.git in the "Choose Package Repository" dialog.
- In the next page, specify the version resolving rule as "Up to Next Major" with "1.0.0" as its earliest version.
- After Xcode checking out the source and resolving the version, you can choose the "SwiftyPlayer" library and add it to your app target.
After installation, you could import SwiftyPlayer to your project by adding this:
import SwiftyPlayerto the files in which you want to use SwiftyPlayer.
Once you prepared, continue to have a look at the Cheat Sheet to see how to use SwiftyPlayer.