diff --git a/.github/workflows/ci_pr_example.yml b/.github/workflows/ci_pr_example.yml index da2947ef5..cb3215700 100644 --- a/.github/workflows/ci_pr_example.yml +++ b/.github/workflows/ci_pr_example.yml @@ -2,15 +2,20 @@ name: Build Example app on: pull_request +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + jobs: tests: name: Build Example app - runs-on: macos-12 + runs-on: macos-13 env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer steps: - name: Checkout the Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 10 - name: Build and run example project diff --git a/.github/workflows/ci_pr_framework.yml b/.github/workflows/ci_pr_framework.yml index d55f62496..b2a79229d 100644 --- a/.github/workflows/ci_pr_framework.yml +++ b/.github/workflows/ci_pr_framework.yml @@ -2,14 +2,19 @@ name: Build Framework on: pull_request +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + jobs: tests: name: Build Framework - runs-on: macos-12 + runs-on: macos-13 env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer steps: - name: Checkout the Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build framework run: make framework diff --git a/.github/workflows/ci_pr_tests.yml b/.github/workflows/ci_pr_tests.yml index b063efceb..e5e35f91a 100644 --- a/.github/workflows/ci_pr_tests.yml +++ b/.github/workflows/ci_pr_tests.yml @@ -2,14 +2,19 @@ name: Tests on: pull_request +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + jobs: tests: name: Run Tests - runs-on: macos-12 + runs-on: macos-13 env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer steps: - name: Checkout the Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build and run tests run: make test diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 2df8f4481..78ecf1893 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -3,18 +3,23 @@ name: Danger on: pull_request_target: types: [opened, reopened, synchronize, ready_for_review] + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true jobs: danger: name: Run Danger - runs-on: macos-12 + runs-on: macos-13 env: - DEVELOPER_DIR: /Applications/Xcode_13.4.1.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer steps: - name: Checkout the Git repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: - fetch-depth: 100 + fetch-depth: 40 token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.ref }} - name: Resolve SwiftPM dependencies diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 36e267b19..ac3472478 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -4,11 +4,18 @@ on: push: branches: - "main" + permissions: contents: write + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + jobs: build_docs: - runs-on: macos-12 + runs-on: macos-latest steps: - name: Checkout 🛎️ uses: actions/checkout@v3 @@ -29,4 +36,4 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs \ No newline at end of file + publish_dir: ./docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d77b2a49..2e88fa51c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,21 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa ### Removed +## 4.2.0 + +### Added + +### Fixed + +- Fix Advanced example hiding indicator [#1792](https://github.com/MessageKit/MessageKit/pull/1792) by [@kaspik](https://github.com/Kaspik) +- Fix hiding typing indicator crash [#1804](https://github.com/MessageKit/MessageKit/pull/1804) by [@Zandor300](https://github.com/Zandor300) + +### Changed + +- Update Github Actions and bump dependencies by [@kaspik](https://github.com/Kaspik) + +### Removed + ## 4.1.0 ### Added diff --git a/Example/ChatExample.xcodeproj/project.pbxproj b/Example/ChatExample.xcodeproj/project.pbxproj index 98d7293e3..1f646ec98 100644 --- a/Example/ChatExample.xcodeproj/project.pbxproj +++ b/Example/ChatExample.xcodeproj/project.pbxproj @@ -338,7 +338,6 @@ 882B5E301CF7D4B900B6E160 /* Frameworks */, 882B5E2F1CF7D4B900B6E160 /* Sources */, 882B5E311CF7D4B900B6E160 /* Resources */, - 7E0AFF9D207BB460004DFD4C /* ShellScript */, ); buildRules = ( ); @@ -467,22 +466,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 7E0AFF9D207BB460004DFD4C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "#\"${PODS_ROOT}/SwiftLint/swiftlint\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 882B5E2F1CF7D4B900B6E160 /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Example/ChatExample.xcworkspace/contents.xcworkspacedata b/Example/ChatExample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..66edd0cf9 --- /dev/null +++ b/Example/ChatExample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/Example/ChatExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Sources/View Controllers/AdvancedExampleViewController.swift b/Example/Sources/View Controllers/AdvancedExampleViewController.swift index 4892390f5..d575e64cc 100644 --- a/Example/Sources/View Controllers/AdvancedExampleViewController.swift +++ b/Example/Sources/View Controllers/AdvancedExampleViewController.swift @@ -74,9 +74,9 @@ final class AdvancedExampleViewController: ChatViewController { MockSocket.shared.connect(with: [SampleData.shared.nathan, SampleData.shared.wu]) .onTypingStatus { [weak self] in - self?.setTypingIndicatorViewHidden(false) + self?.setTypingIndicatorViewHidden(false, animated: true) }.onNewMessage { [weak self] message in - self?.setTypingIndicatorViewHidden(true, performUpdates: { + self?.setTypingIndicatorViewHidden(true, animated: false, performUpdates: { self?.insertMessage(message) }) } @@ -190,9 +190,9 @@ final class AdvancedExampleViewController: ChatViewController { return messageList[indexPath.section].user == messageList[indexPath.section + 1].user } - func setTypingIndicatorViewHidden(_ isHidden: Bool, performUpdates updates: (() -> Void)? = nil) { + func setTypingIndicatorViewHidden(_ isHidden: Bool, animated: Bool, performUpdates updates: (() -> Void)? = nil) { updateTitleView(title: "MessageKit", subtitle: isHidden ? "2 Online" : "Typing...") - setTypingIndicatorViewHidden(isHidden, animated: true, whilePerforming: updates) { [weak self] success in + setTypingIndicatorViewHidden(isHidden, animated: animated, whilePerforming: updates) { [weak self] success in if success, self?.isLastSectionVisible() == true { self?.messagesCollectionView.scrollToLastItem(animated: true) } diff --git a/Gemfile.lock b/Gemfile.lock index b0a24c9ed..1ab5ad023 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -53,7 +53,7 @@ GEM faraday-patron (1.0.0) faraday-rack (1.0.0) faraday-retry (1.0.3) - git (1.12.0) + git (1.13.1) addressable (~> 2.8) rchardet (~> 1.8) kramdown (2.4.0) @@ -67,7 +67,7 @@ GEM faraday (>= 1, < 3) sawyer (~> 0.9) open4 (1.3.4) - public_suffix (5.0.0) + public_suffix (5.0.1) rake (13.0.6) rchardet (1.8.0) rexml (3.2.5) diff --git a/Makefile b/Makefile index 609433812..0343d308b 100644 --- a/Makefile +++ b/Makefile @@ -25,15 +25,15 @@ test: @echo "Running MessageKit tests." - @set -o pipefail && xcodebuild test -scheme MessageKit -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 11" | xcpretty -c + @set -o pipefail && xcodebuild test -scheme MessageKit -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 14" | xcpretty -c framework: @echo "Building MessageKit Framework." - @set -o pipefail && xcodebuild build -scheme MessageKit -destination "platform=iOS Simulator,name=iPhone 11" | xcpretty -c + @set -o pipefail && xcodebuild build -scheme MessageKit -destination "platform=iOS Simulator,name=iPhone 14" | xcpretty -c build_example: @echo "Building & testing MessageKit Example app." - @cd Example && set -o pipefail && xcodebuild build analyze -scheme ChatExample -destination "platform=iOS Simulator,name=iPhone 11" CODE_SIGNING_REQUIRED=NO | xcpretty -c + @cd Example && set -o pipefail && xcodebuild build analyze -scheme ChatExample -destination "platform=iOS Simulator,name=iPhone 14" CODE_SIGNING_REQUIRED=NO | xcpretty -c format: @swift package --allow-writing-to-package-directory format-source-code --file . diff --git a/README.md b/README.md index 51ba36c09..5313b0350 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,9 @@ Add your app to the list of apps using this library and make a pull request. - [Girlfriend Plus](https://apps.apple.com/us/app/girlfriend-plus/id1011637655) - [Noon Happen](https://apps.apple.com/app/id1477310602) - [XPASS](https://apps.apple.com/cz/app/id1596773834) - +- [HeiaHeia](https://www.heiaheia.com) +- [Starstruck AI](https://apps.apple.com/au/app/starstruck-message-anyone/id6446234281) + _Please provide attribution, it is greatly appreciated._ ## Core Team diff --git a/Sources/Controllers/MessagesViewController+TypingIndicator.swift b/Sources/Controllers/MessagesViewController+TypingIndicator.swift index 441073400..434a66bb2 100644 --- a/Sources/Controllers/MessagesViewController+TypingIndicator.swift +++ b/Sources/Controllers/MessagesViewController+TypingIndicator.swift @@ -50,14 +50,15 @@ extension MessagesViewController { } let section = messagesCollectionView.numberOfSections - messagesCollectionView.setTypingIndicatorViewHidden(isHidden) if animated { messagesCollectionView.performBatchUpdates({ [weak self] in + self?.messagesCollectionView.setTypingIndicatorViewHidden(isHidden) self?.performUpdatesForTypingIndicatorVisability(at: section) updates?() }, completion: completion) } else { + messagesCollectionView.setTypingIndicatorViewHidden(isHidden) performUpdatesForTypingIndicatorVisability(at: section) updates?() completion?(true)