Skip to content

Commit

Permalink
Merge pull request hyperoslo#87 from hyperoslo/fix/framework-resources
Browse files Browse the repository at this point in the history
Fix framework resources
  • Loading branch information
RamonGilabert committed Jan 12, 2016
2 parents 4882663 + ab252c5 commit 54e4a43
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
29D699E61B70ABFC0021FA73 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 29D699E51B70ABFC0021FA73 /* Images.xcassets */; };
29D699E91B70ABFC0021FA73 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29D699E71B70ABFC0021FA73 /* LaunchScreen.xib */; };
29D699FF1B70ACD50021FA73 /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = 29D699FE1B70ACD50021FA73 /* Podfile */; };
C3771E008DA39CF04754C8A9 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 733A7AD0105A657A80502E72 /* Pods.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
C3771E008DA39CF04754C8A9 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 733A7AD0105A657A80502E72 /* Pods.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down
6 changes: 3 additions & 3 deletions Demo/ImagePickerDemo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- ImagePicker (1.0)
- ImagePicker (1.1)

DEPENDENCIES:
- ImagePicker (from `../../`)
Expand All @@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:path: ../../

SPEC CHECKSUMS:
ImagePicker: 66b59702f077d64bb62f4d22a10392f5af2a49f5
ImagePicker: 2a904341bbc47c96457de00558d2f8dd186eff7c

COCOAPODS: 0.39.0.beta.4
COCOAPODS: 0.39.0
32 changes: 32 additions & 0 deletions ImagePicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
D5D370C01C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BA1C44FD1600690C0A /* [email protected] */; };
D5D370C11C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BB1C44FD1600690C0A /* [email protected] */; };
D5D370C21C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BC1C44FD1600690C0A /* [email protected] */; };
D5D370C31C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BD1C44FD1600690C0A /* [email protected] */; };
D5D370C41C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BE1C44FD1600690C0A /* [email protected] */; };
D5D370C51C44FD1600690C0A /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D5D370BF1C44FD1600690C0A /* [email protected] */; };
D5DC59961C201BE1003BD79B /* ImagePicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5DC598B1C201BE1003BD79B /* ImagePicker.framework */; };
D5DC59C21C201CC4003BD79B /* BottomContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC59AD1C201CC4003BD79B /* BottomContainerView.swift */; };
D5DC59C31C201CC4003BD79B /* ButtonPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5DC59AE1C201CC4003BD79B /* ButtonPicker.swift */; };
Expand Down Expand Up @@ -35,6 +41,12 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
D5D370BA1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5D370BB1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5D370BC1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5D370BD1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5D370BE1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5D370BF1C44FD1600690C0A /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D5DC598B1C201BE1003BD79B /* ImagePicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ImagePicker.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D5DC59951C201BE1003BD79B /* ImagePicker-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "ImagePicker-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
D5DC59A61C201CC4003BD79B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -74,9 +86,23 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
D5D370B91C44FD1600690C0A /* Images */ = {
isa = PBXGroup;
children = (
D5D370BA1C44FD1600690C0A /* [email protected] */,
D5D370BB1C44FD1600690C0A /* [email protected] */,
D5D370BC1C44FD1600690C0A /* [email protected] */,
D5D370BD1C44FD1600690C0A /* [email protected] */,
D5D370BE1C44FD1600690C0A /* [email protected] */,
D5D370BF1C44FD1600690C0A /* [email protected] */,
);
path = Images;
sourceTree = "<group>";
};
D5DC59811C201BE1003BD79B = {
isa = PBXGroup;
children = (
D5D370B91C44FD1600690C0A /* Images */,
D5DC59A51C201CC4003BD79B /* Tests */,
D5DC59A81C201CC4003BD79B /* SupportFiles */,
D5DC59AA1C201CC4003BD79B /* Source */,
Expand Down Expand Up @@ -260,6 +286,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5D370C41C44FD1600690C0A /* [email protected] in Resources */,
D5D370C21C44FD1600690C0A /* [email protected] in Resources */,
D5D370C01C44FD1600690C0A /* [email protected] in Resources */,
D5D370C51C44FD1600690C0A /* [email protected] in Resources */,
D5D370C11C44FD1600690C0A /* [email protected] in Resources */,
D5D370C31C44FD1600690C0A /* [email protected] in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
9 changes: 5 additions & 4 deletions Source/CameraView/CameraView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,12 @@ class CameraView: UIViewController {
}

func getImage(name: String) -> UIImage {
guard let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle")
else { return UIImage() }

let bundle = NSBundle(path: bundlePath)
let traitCollection = UITraitCollection(displayScale: 3)
var bundle = NSBundle(forClass: self.classForCoder)

if let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle"), resourceBundle = NSBundle(path: bundlePath) {
bundle = resourceBundle
}

guard let image = UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: traitCollection)
else { return UIImage() }
Expand Down
14 changes: 8 additions & 6 deletions Source/ImageGallery/ImageGalleryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ImageGalleryView: UIView {
view.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.6)
view.layer.cornerRadius = Dimensions.indicatorHeight / 2
view.translatesAutoresizingMaskIntoConstraints = false

return view
}()

Expand All @@ -74,7 +74,7 @@ public class ImageGalleryView: UIView {
label.alpha = 0
label.sizeToFit()
self.addSubview(label)

return label
}()

Expand Down Expand Up @@ -176,11 +176,13 @@ public class ImageGalleryView: UIView {
// MARK: - Private helpers

func getImage(name: String) -> UIImage {
guard let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle") else { return UIImage() }

let bundle = NSBundle(path: bundlePath)
let traitCollection = UITraitCollection(displayScale: 3)

var bundle = NSBundle(forClass: self.classForCoder)

if let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle"), resourceBundle = NSBundle(path: bundlePath) {
bundle = resourceBundle
}

guard let image = UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: traitCollection)
else { return UIImage() }

Expand Down
10 changes: 6 additions & 4 deletions Source/TopView/TopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ class TopView: UIView {
// MARK: - Private helpers

func getImage(name: String) -> UIImage {
guard let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle")
else { return UIImage() }

let bundle = NSBundle(path: bundlePath)
let traitCollection = UITraitCollection(displayScale: 3)
var bundle = NSBundle(forClass: self.classForCoder)

if let bundlePath = NSBundle(forClass: self.classForCoder).resourcePath?.stringByAppendingString("/ImagePicker.bundle"), resourceBundle = NSBundle(path: bundlePath) {
bundle = resourceBundle
}

guard let image = UIImage(named: name, inBundle: bundle, compatibleWithTraitCollection: traitCollection) else { return UIImage() }

return image
Expand Down

0 comments on commit 54e4a43

Please sign in to comment.