Skip to content

Commit

Permalink
[Player] Fix bundle not found error when used outside cocoapods
Browse files Browse the repository at this point in the history
  • Loading branch information
isair committed Nov 25, 2015
1 parent 481ba5a commit b503325
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MobilePlayer/Extensions/UIImage+CocoaPods.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import UIKit
extension UIImage {

convenience init?(podResourceNamed name: String) {
let bundleUrl = NSBundle(forClass: MobilePlayerViewController.self).URLForResource("MobilePlayer", withExtension: "bundle")!
let bundleUrl =
NSBundle(forClass: MobilePlayerViewController.self).URLForResource("MobilePlayer", withExtension: "bundle") ??
NSBundle(forClass: MobilePlayerViewController.self).bundleURL
let bundle = NSBundle(URL: bundleUrl)
self.init(named: name, inBundle: bundle, compatibleWithTraitCollection:nil)
}
Expand Down

0 comments on commit b503325

Please sign in to comment.