From f3471aad1f0cd8acaf498c1ab2d6c494d796b3eb Mon Sep 17 00:00:00 2001 From: Harry Tran Date: Tue, 21 Nov 2023 15:01:19 +0700 Subject: [PATCH] Remove SwiftyJSON and set minimum deployment target to 12.0 --- ChatViewController.xcodeproj/project.pbxproj | 4 ++-- Example/Podfile | 11 ++++++++-- Example/Podfile.lock | 22 +++++++++---------- Example/Source/FileInfo.swift | 2 ++ Example/Source/MessageViewModel.swift | 1 - Example/iOS Example.xcodeproj/project.pbxproj | 19 +++++----------- Source/Core/ChatViewController+Subviews.swift | 2 +- Source/ImagePicker/PhotoDataManager.swift | 2 +- 8 files changed, 31 insertions(+), 32 deletions(-) diff --git a/ChatViewController.xcodeproj/project.pbxproj b/ChatViewController.xcodeproj/project.pbxproj index 95421bc..12c6b96 100644 --- a/ChatViewController.xcodeproj/project.pbxproj +++ b/ChatViewController.xcodeproj/project.pbxproj @@ -406,7 +406,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -464,7 +464,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/Example/Podfile b/Example/Podfile index 4375e7e..b4cec2d 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,9 +1,16 @@ -platform :ios, '10.0' +platform :ios, '12.0' target 'iOS Example' do use_frameworks! pod 'ChatViewController', :path => ".." pod 'Kingfisher' - pod 'SwiftyJSON' +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0' + end + end end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index c2c9288..7f00483 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,31 +1,31 @@ PODS: - - ChatViewController (1.1.0): + - ChatViewController (1.2.0): - PlaceholderUITextView - - Kingfisher (5.3.1) + - Kingfisher (7.10.0) - PlaceholderUITextView (1.2.0) - - SwiftyJSON (4.3.0) + - SwiftLint (0.54.0) DEPENDENCIES: - ChatViewController (from `..`) - Kingfisher - - SwiftyJSON + - SwiftLint SPEC REPOS: - https://github.com/cocoapods/specs.git: + trunk: - Kingfisher - PlaceholderUITextView - - SwiftyJSON + - SwiftLint EXTERNAL SOURCES: ChatViewController: :path: ".." SPEC CHECKSUMS: - ChatViewController: e2ab18e0a4910cce0544773239ba1549a9afe4b9 - Kingfisher: d9e7e0b209b59b8f9873aa2f37654e81a7beea51 + ChatViewController: b8b4b16c9a50c4b1ec4146a0349aa7725c87c8ec + Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6 PlaceholderUITextView: a2158e51dc0a3217ecca2d879bbe59372292d391 - SwiftyJSON: 6faa0040f8b59dead0ee07436cbf76b73c08fd08 + SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211 -PODFILE CHECKSUM: dca9be4f0f56343a982263e8bd7d779297a35449 +PODFILE CHECKSUM: f9efcf20ed351e0f7798c7364948b1892c9c3c75 -COCOAPODS: 1.6.0 +COCOAPODS: 1.14.3 diff --git a/Example/Source/FileInfo.swift b/Example/Source/FileInfo.swift index 361f825..b93be5e 100644 --- a/Example/Source/FileInfo.swift +++ b/Example/Source/FileInfo.swift @@ -16,6 +16,8 @@ enum FileType: Int, Decodable { struct FileInfo: Decodable { + + let id: String let type: FileType let originalURL: URL? diff --git a/Example/Source/MessageViewModel.swift b/Example/Source/MessageViewModel.swift index 0d01102..8763bbd 100644 --- a/Example/Source/MessageViewModel.swift +++ b/Example/Source/MessageViewModel.swift @@ -7,7 +7,6 @@ // import UIKit -import SwiftyJSON enum BubbleStyle { case facebook diff --git a/Example/iOS Example.xcodeproj/project.pbxproj b/Example/iOS Example.xcodeproj/project.pbxproj index 6aa9102..da35b06 100644 --- a/Example/iOS Example.xcodeproj/project.pbxproj +++ b/Example/iOS Example.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -323,22 +323,11 @@ files = ( ); inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iOS Example/Pods-iOS Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/ChatViewController/ChatViewController.framework", - "${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework", - "${BUILT_PRODUCTS_DIR}/PlaceholderUITextView/PlaceholderUITextView.framework", - "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework", + "${PODS_ROOT}/Target Support Files/Pods-iOS Example/Pods-iOS Example-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ChatViewController.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PlaceholderUITextView.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework", + "${PODS_ROOT}/Target Support Files/Pods-iOS Example/Pods-iOS Example-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -522,6 +511,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -543,6 +533,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Source/Core/ChatViewController+Subviews.swift b/Source/Core/ChatViewController+Subviews.swift index e562c2a..7fd5165 100644 --- a/Source/Core/ChatViewController+Subviews.swift +++ b/Source/Core/ChatViewController+Subviews.swift @@ -120,7 +120,7 @@ extension ChatViewController { /// Show keyboard from nothing // Handle keyboard show/hide notification to animation show ChatBarView func animateKeyboard(notification: Notification, isShowing: Bool) { - var userInfo = notification.userInfo! + let userInfo = notification.userInfo! let keyboardRect = (userInfo[UIResponder.keyboardFrameEndUserInfoKey]! as AnyObject).cgRectValue let curve = (userInfo[UIResponder.keyboardAnimationCurveUserInfoKey]! as AnyObject).uint32Value diff --git a/Source/ImagePicker/PhotoDataManager.swift b/Source/ImagePicker/PhotoDataManager.swift index 62fb296..5a623fe 100644 --- a/Source/ImagePicker/PhotoDataManager.swift +++ b/Source/ImagePicker/PhotoDataManager.swift @@ -10,7 +10,7 @@ import UIKit import Photos /// PhotoDataManagerDelegate -public protocol PhotoDataManagerDelegate: class { +public protocol PhotoDataManagerDelegate: AnyObject { // Trigger whenever PhotoDataManager update func photoDataManagerDidUpdate() // Image size need export