Skip to content

Commit

Permalink
Merge pull request #86 from mobileplayer/fix/pod-resources
Browse files Browse the repository at this point in the history
Fix cocoapods resource issues
  • Loading branch information
isair committed Nov 17, 2015
2 parents fd9261e + a57d132 commit c7f1f5c
Show file tree
Hide file tree
Showing 43 changed files with 162 additions and 130 deletions.
29 changes: 15 additions & 14 deletions MobilePlayer.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
Pod::Spec.new do |s|
s.name = "MobilePlayer"
s.version = "1.0.0"
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.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
120 changes: 106 additions & 14 deletions MobilePlayer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions MobilePlayer.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions MobilePlayer/Config/ButtonConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ public class ButtonConfig: ElementConfig {
if let imageName = dictionary["image"] as? String {
image = UIImage(named: imageName)
} else if let identifier = dictionary["identifier"] as? String {
let mobilePlayerBundle = NSBundle(forClass: ButtonConfig.self)
switch identifier {
case "close":
image = UIImage(named: "MLCloseButton", inBundle: mobilePlayerBundle, compatibleWithTraitCollection: nil)
image = UIImage(podResourceNamed: "MLCloseButton.png")?.template
case "action":
image = UIImage(named: "MLShareButton", inBundle: mobilePlayerBundle, compatibleWithTraitCollection: nil)
image = UIImage(podResourceNamed: "MLShareButton")?.template
default:
image = nil
}
Expand Down
7 changes: 3 additions & 4 deletions MobilePlayer/Config/ToggleButtonConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ public class ToggleButtonConfig: ElementConfig {
let identifier = dictionary["identifier"] as? String

height = (dictionary["height"] as? CGFloat) ?? 40

let mobilePlayerBundle = NSBundle(forClass: ToggleButtonConfig.self)

if let imageName = dictionary["image"] as? String {
image = UIImage(named: imageName)
} else if identifier == "play" {
image = UIImage(named: "MLPlayButton", inBundle: mobilePlayerBundle, compatibleWithTraitCollection: nil)
image = UIImage(podResourceNamed: "MLPlayButton")?.template
} else {
image = nil
}
Expand All @@ -64,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", inBundle: mobilePlayerBundle, compatibleWithTraitCollection: nil)
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)
}
}
Binary file not shown.
13 changes: 0 additions & 13 deletions MobilePlayer/Images.xcassets/MLCloseButton.imageset/Contents.json

This file was deleted.

This file was deleted.

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

This file was deleted.

Binary file not shown.
13 changes: 0 additions & 13 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.
13 changes: 0 additions & 13 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/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
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")
increaseVolumeImage.image = UIImage(podResourceNamed: "MLIncreaseVolume")?.template
increaseVolumeImage.tintColor = increaseVolumeTintColor
addSubview(increaseVolumeImage)
reduceVolumeImage.contentMode = .ScaleAspectFit;
reduceVolumeImage.image = UIImage(named: "MLReduceVolume")
reduceVolumeImage.image = UIImage(podResourceNamed: "MLReduceVolume")?.template
reduceVolumeImage.tintColor = reduceVolumeTintColor
addSubview(reduceVolumeImage)
}
Expand Down

0 comments on commit c7f1f5c

Please sign in to comment.