Skip to content

Commit 3a61253

Browse files
author
Nikola Markovic
committed
Resources loading from cocoapods bundle
1 parent bf45162 commit 3a61253

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

AutocompleteClient/FW/UI/CIOAutocompleteViewController.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ import UIKit
1313
*/
1414

1515
public class CIOAutocompleteViewController: UIViewController {
16-
17-
private static var bundle = Bundle(for: CIOAutocompleteViewController.self)
16+
private static let __bundle = Bundle(for: CIOAutocompleteViewController.self)
17+
private static var bundle: Bundle{
18+
get{
19+
if let bundleURL = __bundle.url(forResource: "ConstructorAutocomplete", withExtension: "bundle"),
20+
let bundle = Bundle(url: bundleURL) {
21+
return bundle
22+
}else{
23+
return __bundle
24+
}
25+
}
26+
}
1827

1928
/**
2029
Results table view.

ConstructorAutocomplete.podspec

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'ConstructorAutocomplete'
3-
spec.version = '0.0.1'
3+
spec.version = '0.0.3'
44
spec.license = { :type => 'MIT', :file => 'LICENSE' }
55
spec.homepage = 'https://www.constructor.io'
66
spec.authors = { 'Nikola Markovic' => '[email protected]' }
77
spec.summary = 'Constructor.io iOS autosuggest client.'
8-
spec.source = { :git => 'https://github.com/Constructor-io/constructorio-client-swift.git', :tag => "v#{spec.version}" }
8+
spec.source = { :git => 'https://github.com/Constructor-io/constructorio-client-swift.git', :tag => "v0.0.1" }
99
spec.platform = :ios, '8.0'
10-
11-
spec.source_files = 'AutocompleteClient/*'
10+
spec.source_files = 'AutocompleteClient/**/*.swift'
11+
spec.framework = 'UIKit'
1212
spec.ios.resource_bundle = { 'ConstructorAutocomplete' => 'AutocompleteClient/Resources/*.png' }
13-
spec.framework = 'UIKit'
1413
end

0 commit comments

Comments
 (0)