Commit 9ec09e6f by Daniel Dahan

added potential fix for MaterialIcon support with CocoaPods

parent 310eafdf
......@@ -31,7 +31,17 @@
import UIKit
public struct MaterialIcon {
public static let bundle = NSBundle(URL: NSBundle(forClass: MaterialView.self).resourceURL!)
private static var internalBundle: NSBundle?
public static var bundle: NSBundle {
if nil == MaterialIcon.internalBundle {
MaterialIcon.internalBundle = NSBundle(forClass: MaterialView.self)
let b: NSBundle? = NSBundle(URL: MaterialIcon.internalBundle!.resourceURL!.URLByAppendingPathComponent("io.cosmicmind.Material.bundle"))
if let v: NSBundle = b {
MaterialIcon.internalBundle = v
}
}
return MaterialIcon.internalBundle!
}
public static let add: UIImage? = UIImage(named: "ic_add_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
public static let arrowBack: UIImage? = UIImage(named: "ic_arrow_back_white", inBundle: bundle, compatibleWithTraitCollection: nil)?.imageWithRenderingMode(.AlwaysTemplate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment