Skip to content

Commit

Permalink
fixed #176: warnings bundle resouece
Browse files Browse the repository at this point in the history
  • Loading branch information
tilltue committed Apr 17, 2019
1 parent a42179b commit b788509
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 358 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- TLPhotoPicker (1.8.3)
- TLPhotoPicker (1.8.6)

DEPENDENCIES:
- TLPhotoPicker (from `../`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
TLPhotoPicker: 1399b3b1cb2b8b19fc2a7108b1398e25ad465845
TLPhotoPicker: c5aefdc9beaca82116d7855924f1d8abdd055f79

PODFILE CHECKSUM: 79c2955b8f0f82b92e74722dc635d1390f908d1a

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
6 changes: 3 additions & 3 deletions Example/Pods/Local Podspecs/TLPhotoPicker.podspec.json

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

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

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

678 changes: 336 additions & 342 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Example/TLPhotoPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TLPhotoPicker_Example/Pods-TLPhotoPicker_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-TLPhotoPicker_Example/Pods-TLPhotoPicker_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/TLPhotoPicker/TLPhotoPicker.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -310,7 +310,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TLPhotoPicker_Example/Pods-TLPhotoPicker_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TLPhotoPicker_Example/Pods-TLPhotoPicker_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
4 changes: 2 additions & 2 deletions TLPhotoPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TLPhotoPicker'
s.version = '1.8.5'
s.version = '1.8.6'
s.summary = 'multiple phassets picker for iOS lib. like facebook'

# This description is used to generate tags and improve search results.
Expand All @@ -32,7 +32,7 @@ TODO: Add long description of the pod here.
s.swift_version = '5.0'
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.0' }

s.source_files = 'TLPhotoPicker/Classes/**/*'
s.source_files = 'TLPhotoPicker/Classes/**/*.swift'

s.resource_bundles = { 'TLPhotoPicker' => ['TLPhotoPicker/Classes/*.xib'] }
s.resources = 'TLPhotoPicker/TLPhotoPickerController.bundle'
Expand Down
2 changes: 1 addition & 1 deletion TLPhotoPicker/Classes/TLAlbumPopView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class TLAlbumPopView: UIView,PopupViewProtocol {
self.popupView.layer.cornerRadius = 5.0
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapBgView))
self.bgView.addGestureRecognizer(tapGesture)
self.tableView.register(UINib(nibName: "TLCollectionTableViewCell", bundle: Bundle(for: TLCollectionTableViewCell.self)), forCellReuseIdentifier: "TLCollectionTableViewCell")
self.tableView.register(UINib(nibName: "TLCollectionTableViewCell", bundle: TLBundle.bundle()), forCellReuseIdentifier: "TLCollectionTableViewCell")
}

@objc func tapBgView() {
Expand Down
9 changes: 9 additions & 0 deletions TLPhotoPicker/Classes/TLBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ class TLBundle {
}
return nil
}

class func bundle() -> Bundle {
let podBundle = Bundle(for: TLBundle.self)
if let url = podBundle.url(forResource: "TLPhotoPicker", withExtension: "bundle") {
let bundle = Bundle(url: url)
return bundle ?? podBundle
}
return podBundle
}
}
4 changes: 2 additions & 2 deletions TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ open class TLPhotosPickerViewController: UIViewController {
}

public init() {
super.init(nibName: "TLPhotosPickerViewController", bundle: Bundle(for: TLPhotosPickerViewController.self))
super.init(nibName: "TLPhotosPickerViewController", bundle: TLBundle.bundle())
}

@objc convenience public init(withPHAssets: (([PHAsset]) -> Void)? = nil, didCancel: (() -> Void)? = nil) {
Expand Down Expand Up @@ -291,7 +291,7 @@ extension TLPhotosPickerViewController {
}

@objc open func makeUI() {
registerNib(nibName: "TLPhotoCollectionViewCell", bundle: Bundle(for: TLPhotoCollectionViewCell.self))
registerNib(nibName: "TLPhotoCollectionViewCell", bundle: TLBundle.bundle())
if let nibSet = self.configure.nibSet {
registerNib(nibName: nibSet.nibName, bundle: nibSet.bundle)
}
Expand Down

0 comments on commit b788509

Please sign in to comment.