Skip to content

Commit 86cd13e

Browse files
martinpucikKaspik
andauthored
Updated MessageKit.podspec to use resource_bundle instead of resources (#1460)
* Update MessageKit.podspec Changed resources to resource_bundle * Update CHANGELOG.md * Update MessageKit.podspec Update resource bundle getter for updated podspec bundle setting * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Jakub Kašpar <kaspikk@gmail.com>
1 parent 8cf9ba6 commit 86cd13e

File tree

8 files changed

+18
-5
lines changed

8 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
1010

1111
### Changed
1212

13+
- Changed `resources` to `resource_bundle` in MessageKit.podspec [#1460](https://github.com/MessageKit/MessageKit/pull/1460) by [@martinpucik](https://github.com/martinpucik)
14+
1315
### Removed
1416

1517
## 3.4.2

Example/ChatExample.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
882B5E811CF7D53600B6E160 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E781CF7D53600B6E160 /* AppDelegate.swift */; };
4141
882B5E901CF7D56000B6E160 /* ChatExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E8E1CF7D56000B6E160 /* ChatExampleUITests.swift */; };
4242
882B5E951CF7D56E00B6E160 /* ChatExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E931CF7D56E00B6E160 /* ChatExampleTests.swift */; };
43-
9961327FB4F9B96CFD84A126 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
43+
9961327FB4F9B96CFD84A126 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
4444
D4036D91BB2480E403CDC2F1 /* Pods_ChatExampleUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AC6E3F5C11E39F57598DBE6 /* Pods_ChatExampleUITests.framework */; };
4545
F182DD0E2148F655FC0DFF91 /* Pods_ChatExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25FCE8536D329EC8856E2BA8 /* Pods_ChatExampleTests.framework */; };
4646
/* End PBXBuildFile section */
@@ -147,7 +147,7 @@
147147
isa = PBXFrameworksBuildPhase;
148148
buildActionMask = 2147483647;
149149
files = (
150-
9961327FB4F9B96CFD84A126 /* (null) in Frameworks */,
150+
9961327FB4F9B96CFD84A126 /* BuildFile in Frameworks */,
151151
D4036D91BB2480E403CDC2F1 /* Pods_ChatExampleUITests.framework in Frameworks */,
152152
);
153153
runOnlyForDeploymentPostprocessing = 0;
@@ -541,6 +541,7 @@
541541
"${BUILT_PRODUCTS_DIR}/PINCache/PINCache.framework",
542542
"${BUILT_PRODUCTS_DIR}/PINOperation/PINOperation.framework",
543543
"${BUILT_PRODUCTS_DIR}/PINRemoteImage/PINRemoteImage.framework",
544+
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
544545
);
545546
name = "[CP] Embed Pods Frameworks";
546547
outputPaths = (
@@ -549,6 +550,7 @@
549550
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINCache.framework",
550551
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINOperation.framework",
551552
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINRemoteImage.framework",
553+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
552554
);
553555
runOnlyForDeploymentPostprocessing = 0;
554556
shellPath = /bin/sh;

Example/Sources/Data Generation/SampleData.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
SOFTWARE.
2323
*/
2424

25+
import UIKit
2526
import MessageKit
2627
import CoreLocation
2728
import AVFoundation

Example/Sources/Models/MockMessage.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424

2525
import Foundation
26+
import UIKit
2627
import CoreLocation
2728
import MessageKit
2829
import AVFoundation

Example/Sources/View Controllers/MessageSubviewViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SOFTWARE.
2323
*/
2424

2525
import Foundation
26+
import UIKit
2627
import InputBarAccessoryView
2728

2829
final class MessageSubviewViewController: BasicExampleViewController {

MessageKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Pod::Spec.new do |s|
1414
s.swift_version = '5.3'
1515

1616
s.ios.deployment_target = '12.0'
17-
s.ios.resources = ['Sources/Assets.xcassets']
17+
s.ios.resource_bundle = { 'MessageKit' => 'Sources/Assets.xcassets' }
1818

1919
s.dependency 'InputBarAccessoryView', '~> 5.2.1'
2020

Sources/Extensions/Bundle+Extensions.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ internal extension Bundle {
2828
#if IS_SPM
2929
static var messageKitAssetBundle: Bundle = Bundle.module
3030
#else
31-
static var messageKitAssetBundle: Bundle = Bundle(for: MessagesViewController.self)
31+
static var messageKitAssetBundle: Bundle {
32+
guard let url = Bundle(for: MessagesViewController.self).url(forResource: "MessageKit", withExtension: "bundle"),
33+
let resourcesBundle = Bundle(url: url)
34+
else {
35+
fatalError(MessageKitError.couldNotLoadAssetsBundle)
36+
}
37+
return resourcesBundle
38+
}
3239
#endif
3340
}

Sources/Models/MessageKitError.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ internal struct MessageKitError {
3232
static let unrecognizedSectionKind = "Received unrecognized element kind:"
3333
static let unrecognizedCheckingResult = "Received an unrecognized NSTextCheckingResult.CheckingType"
3434
static let couldNotLoadAssetsBundle = "MessageKit: Could not load the assets bundle"
35-
static let couldNotCreateAssetsPath = "MessageKit: Could not create path to the assets bundle."
3635
static let customDataUnresolvedCell = "Did not return a cell for MessageKind.custom(Any)."
3736
static let customDataUnresolvedSize = "Did not return a size for MessageKind.custom(Any)."
3837
static let couldNotFindColorAsset = "MessageKit: Could not load the color asset."

0 commit comments

Comments
 (0)