Skip to content

Commit

Permalink
Fix cocoapods resource issues
Browse files Browse the repository at this point in the history
Fixes #85
  • Loading branch information
isair committed Nov 17, 2015
1 parent 4cad48a commit a57d132
Show file tree
Hide file tree
Showing 42 changed files with 147 additions and 141 deletions.
31 changes: 15 additions & 16 deletions MobilePlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
Pod::Spec.new do |s|
s.name = "MobilePlayer"
s.version = "1.0.1"
s.summary = "A powerful and completely customizable media player for iOS."
s.homepage = "https://github.com/mobileplayer/mobileplayer-ios"
s.license = 'CC'
s.author = { "Barış Şencan" => "[email protected]",
"Toygar Dündaralp" => "[email protected]",
"Cem Olcay" => "[email protected]",
"Şahin Boydaş" => "[email protected]" }
s.source = { :git => "https://github.com/mobileplayer/mobileplayer-ios.git", :tag => s.version.to_s }
s.platform = :ios, '8.0'
s.requires_arc = true
s.frameworks = 'UIKit', 'MediaPlayer'
s.source_files = 'MobilePlayer/**/*.swift'
#s.resource_bundle = { 'MobilePlayer' => 'MobilePlayer/Images.xcassets' }
s.resources = ["MobilePlayer/Images.xcassets/MLCloseButton.imageset/MLCloseButton.pdf", "MobilePlayer/Images.xcassets/MLIncreaseVolume.imageset/MLIncreaseVolume.pdf", "MobilePlayer/Images.xcassets/MLPauseButton.imageset/MLPauseButton.pdf", "MobilePlayer/Images.xcassets/MLPlayButton.imageset/MLPlayButton.pdf", "MobilePlayer/Images.xcassets/MLReduceVolume.imageset/MLReduceVolume.pdf", "MobilePlayer/Images.xcassets/MLShareButton.imageset/MLShareButton.pdf", "MobilePlayer/Images.xcassets/MLVolumeButton.imageset/MLVolumeButton.pdf"]
s.name = "MobilePlayer"
s.version = "1.0.1"
s.summary = "A powerful and completely customizable media player for iOS."
s.homepage = "https://github.com/mobileplayer/mobileplayer-ios"
s.license = 'CC'
s.author = { "Barış Şencan" => "[email protected]",
"Toygar Dündaralp" => "[email protected]",
"Cem Olcay" => "[email protected]",
"Şahin Boydaş" => "[email protected]" }
s.source = { :git => "https://github.com/mobileplayer/mobileplayer-ios.git", :tag => s.version.to_s }
s.platform = :ios, '8.0'
s.requires_arc = true
s.frameworks = 'UIKit', 'MediaPlayer'
s.source_files = 'MobilePlayer/**/*.swift'
s.resource_bundle = { 'MobilePlayer' => 'MobilePlayer/**/*.png' }
end
118 changes: 104 additions & 14 deletions MobilePlayer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions MobilePlayer/Config/ButtonConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public class ButtonConfig: ElementConfig {
} else if let identifier = dictionary["identifier"] as? String {
switch identifier {
case "close":
image = UIImage(named: "MLCloseButton.pdf")
image = UIImage(podResourceNamed: "MLCloseButton.png")?.template
case "action":
image = UIImage(named: "MLShareButton.pdf")
image = UIImage(podResourceNamed: "MLShareButton")?.template
default:
image = nil
}
Expand Down
4 changes: 2 additions & 2 deletions MobilePlayer/Config/ToggleButtonConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class ToggleButtonConfig: ElementConfig {
if let imageName = dictionary["image"] as? String {
image = UIImage(named: imageName)
} else if identifier == "play" {
image = UIImage(named: "MLPlayButton.pdf")
image = UIImage(podResourceNamed: "MLPlayButton")?.template
} else {
image = nil
}
Expand All @@ -63,7 +63,7 @@ public class ToggleButtonConfig: ElementConfig {
if let toggledImageName = dictionary["toggledImage"] as? String {
toggledImage = UIImage(named: toggledImageName)
} else if identifier == "play" {
toggledImage = UIImage(named: "MLPauseButton.pdf")
toggledImage = UIImage(podResourceNamed: "MLPauseButton")?.template
} else {
toggledImage = nil
}
Expand Down
22 changes: 22 additions & 0 deletions MobilePlayer/Extensions/UIImage+CocoaPods.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// UIImage+CocoaPods.swift
// MobilePlayer
//
// Created by Baris Sencan on 16/11/2015.
// Copyright © 2015 MovieLaLa. All rights reserved.
//

import UIKit

extension UIImage {

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

var template: UIImage {
return imageWithRenderingMode(.AlwaysTemplate)
}
}
6 changes: 0 additions & 6 deletions MobilePlayer/Images.xcassets/Contents.json

This file was deleted.

15 changes: 0 additions & 15 deletions MobilePlayer/Images.xcassets/MLCloseButton.imageset/Contents.json

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions MobilePlayer/Images.xcassets/MLPauseButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions MobilePlayer/Images.xcassets/MLPlayButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
13 changes: 0 additions & 13 deletions MobilePlayer/Images.xcassets/MLReduceVolume.imageset/Contents.json

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions MobilePlayer/Images.xcassets/MLShareButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
13 changes: 0 additions & 13 deletions MobilePlayer/Images.xcassets/MLVolumeButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file added MobilePlayer/Resources/MLCloseButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLIncreaseVolume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLPauseButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLPlayButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLReduceVolume.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLShareButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/MLVolumeButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MobilePlayer/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions MobilePlayer/Views/VolumeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class VolumeView: UIView {
volumeSlider.showsRouteButton = false
addSubview(volumeSlider)
increaseVolumeImage.contentMode = .ScaleAspectFit;
increaseVolumeImage.image = UIImage(named: "MLIncreaseVolume.pdf")
increaseVolumeImage.image = UIImage(podResourceNamed: "MLIncreaseVolume")?.template
increaseVolumeImage.tintColor = increaseVolumeTintColor
addSubview(increaseVolumeImage)
reduceVolumeImage.contentMode = .ScaleAspectFit;
reduceVolumeImage.image = UIImage(named: "MLReduceVolume.pdf")
reduceVolumeImage.image = UIImage(podResourceNamed: "MLReduceVolume")?.template
reduceVolumeImage.tintColor = reduceVolumeTintColor
addSubview(reduceVolumeImage)
}
Expand Down

0 comments on commit a57d132

Please sign in to comment.