diff --git a/CHANGELOG.md b/CHANGELOG.md index 727d0e99..0f24c30f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Changed +- Changed `resources` to `resource_bundle` in MessageKit.podspec [#1460](https://github.com/MessageKit/MessageKit/pull/1460) by [@martinpucik](https://github.com/martinpucik) + ### Removed ## 3.4.2 diff --git a/Example/ChatExample.xcodeproj/project.pbxproj b/Example/ChatExample.xcodeproj/project.pbxproj index 54746ab6..a86ead3b 100644 --- a/Example/ChatExample.xcodeproj/project.pbxproj +++ b/Example/ChatExample.xcodeproj/project.pbxproj @@ -40,7 +40,7 @@ 882B5E811CF7D53600B6E160 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E781CF7D53600B6E160 /* AppDelegate.swift */; }; 882B5E901CF7D56000B6E160 /* ChatExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E8E1CF7D56000B6E160 /* ChatExampleUITests.swift */; }; 882B5E951CF7D56E00B6E160 /* ChatExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 882B5E931CF7D56E00B6E160 /* ChatExampleTests.swift */; }; - 9961327FB4F9B96CFD84A126 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + 9961327FB4F9B96CFD84A126 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; D4036D91BB2480E403CDC2F1 /* Pods_ChatExampleUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AC6E3F5C11E39F57598DBE6 /* Pods_ChatExampleUITests.framework */; }; F182DD0E2148F655FC0DFF91 /* Pods_ChatExampleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25FCE8536D329EC8856E2BA8 /* Pods_ChatExampleTests.framework */; }; /* End PBXBuildFile section */ @@ -147,7 +147,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9961327FB4F9B96CFD84A126 /* (null) in Frameworks */, + 9961327FB4F9B96CFD84A126 /* BuildFile in Frameworks */, D4036D91BB2480E403CDC2F1 /* Pods_ChatExampleUITests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -541,6 +541,7 @@ "${BUILT_PRODUCTS_DIR}/PINCache/PINCache.framework", "${BUILT_PRODUCTS_DIR}/PINOperation/PINOperation.framework", "${BUILT_PRODUCTS_DIR}/PINRemoteImage/PINRemoteImage.framework", + "${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -549,6 +550,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINCache.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINOperation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PINRemoteImage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/Example/Sources/Data Generation/SampleData.swift b/Example/Sources/Data Generation/SampleData.swift index e413f3be..bb92f954 100644 --- a/Example/Sources/Data Generation/SampleData.swift +++ b/Example/Sources/Data Generation/SampleData.swift @@ -22,6 +22,7 @@ SOFTWARE. */ +import UIKit import MessageKit import CoreLocation import AVFoundation diff --git a/Example/Sources/Models/MockMessage.swift b/Example/Sources/Models/MockMessage.swift index d8bd2cb8..12a365ba 100644 --- a/Example/Sources/Models/MockMessage.swift +++ b/Example/Sources/Models/MockMessage.swift @@ -23,6 +23,7 @@ */ import Foundation +import UIKit import CoreLocation import MessageKit import AVFoundation diff --git a/Example/Sources/View Controllers/MessageSubviewViewController.swift b/Example/Sources/View Controllers/MessageSubviewViewController.swift index 47a75e0e..0481d5e3 100644 --- a/Example/Sources/View Controllers/MessageSubviewViewController.swift +++ b/Example/Sources/View Controllers/MessageSubviewViewController.swift @@ -23,6 +23,7 @@ SOFTWARE. */ import Foundation +import UIKit import InputBarAccessoryView final class MessageSubviewViewController: BasicExampleViewController { diff --git a/MessageKit.podspec b/MessageKit.podspec index 89b3f5c3..844e3cc9 100644 --- a/MessageKit.podspec +++ b/MessageKit.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.swift_version = '5.3' s.ios.deployment_target = '12.0' - s.ios.resources = ['Sources/Assets.xcassets'] + s.ios.resource_bundle = { 'MessageKit' => 'Sources/Assets.xcassets' } s.dependency 'InputBarAccessoryView', '~> 5.2.1' diff --git a/Sources/Extensions/Bundle+Extensions.swift b/Sources/Extensions/Bundle+Extensions.swift index 558d3842..4fe47c26 100644 --- a/Sources/Extensions/Bundle+Extensions.swift +++ b/Sources/Extensions/Bundle+Extensions.swift @@ -28,6 +28,13 @@ internal extension Bundle { #if IS_SPM static var messageKitAssetBundle: Bundle = Bundle.module #else - static var messageKitAssetBundle: Bundle = Bundle(for: MessagesViewController.self) + static var messageKitAssetBundle: Bundle { + guard let url = Bundle(for: MessagesViewController.self).url(forResource: "MessageKit", withExtension: "bundle"), + let resourcesBundle = Bundle(url: url) + else { + fatalError(MessageKitError.couldNotLoadAssetsBundle) + } + return resourcesBundle + } #endif } diff --git a/Sources/Models/MessageKitError.swift b/Sources/Models/MessageKitError.swift index 27b93716..53c2d025 100644 --- a/Sources/Models/MessageKitError.swift +++ b/Sources/Models/MessageKitError.swift @@ -32,7 +32,6 @@ internal struct MessageKitError { static let unrecognizedSectionKind = "Received unrecognized element kind:" static let unrecognizedCheckingResult = "Received an unrecognized NSTextCheckingResult.CheckingType" static let couldNotLoadAssetsBundle = "MessageKit: Could not load the assets bundle" - static let couldNotCreateAssetsPath = "MessageKit: Could not create path to the assets bundle." static let customDataUnresolvedCell = "Did not return a cell for MessageKind.custom(Any)." static let customDataUnresolvedSize = "Did not return a size for MessageKind.custom(Any)." static let couldNotFindColorAsset = "MessageKit: Could not load the color asset."