Skip to content

Commit

Permalink
4.8.0 Release (#1744)
Browse files Browse the repository at this point in the history
Release 4.8.0
  • Loading branch information
tbarbugli committed Jan 4, 2022
1 parent c0a435a commit 1edabbe
Show file tree
Hide file tree
Showing 906 changed files with 2,664 additions and 1,445 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/publish-release.yml
Expand Up @@ -41,6 +41,9 @@ jobs:
VERSION=${BRANCH_NAME#release/}
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
- uses: ./.github/actions/bootstrap
- name: "Starting on the Fastlane Publish Release"
- name: "Fastlane - Publish Release"
if: startsWith(github.event.pull_request.head.ref, 'release/')
env:
GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: bundle exec fastlane publish_release version:${{ env.RELEASE_VERSION }}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed

# [4.8.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.8.0)
_January 4, 2022_

### ✅ Added
- Add support to paginate messages pinned in a channel [#1741](https://github.com/GetStream/stream-chat-swift/issues/1741)

### 🐞 Fixed
- `notification.channel_deleted` events are now handled by the SDK [#1737](https://github.com/GetStream/stream-chat-swift/pull/1737)

# [4.7.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.7.0)
_December 28, 2021_

Expand All @@ -16,6 +27,7 @@ _December 28, 2021_
- Fix unncessary API calls performed when loading threads [#1716](https://github.com/GetStream/stream-chat-swift/issues/1716)
- Fix quoted messages not updated after edit [#1703](https://github.com/GetStream/stream-chat-swift/pull/1703)
- Fix deleted replies being shown in channel [#1707](https://github.com/GetStream/stream-chat-swift/pull/1707)
- Fix Date._unconditionallyBridgeFromObjectiveC crashes [#1646](https://github.com/GetStream/stream-chat-swift/pull/1646)

# [4.6.0](https://github.com/GetStream/stream-chat-swift/releases/tag/4.6.0)
_December 20, 2021_
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/AdvancedOptionsViewController.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import UIKit
Expand Down
6 changes: 4 additions & 2 deletions DemoApp/AppDelegate.swift
@@ -1,7 +1,8 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Atlantis
import StreamChat
import UIKit

Expand All @@ -11,7 +12,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Override point for customization after application launch.
// Uncomment this to be able to proxy WebSocket events from Proxyman.app
// Atlantis.start()
true
}

Expand Down
2 changes: 1 addition & 1 deletion DemoApp/BannerShowingConnectionDelegate.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import StreamChat
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/BannerView.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import StreamChatUI
Expand Down
66 changes: 1 addition & 65 deletions DemoApp/ChatPresenter.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import StreamChat
Expand Down Expand Up @@ -279,67 +279,3 @@ class DemoChatChannelListRouter: ChatChannelListRouter {
}
}
}

class DemoChannelListVC: ChatChannelListVC {
/// The `UIButton` instance used for navigating to new channel screen creation,
lazy var createChannelButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(systemName: "plus.message")!, for: .normal)
return button
}()

lazy var hiddenChannelsButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(systemName: "archivebox")!, for: .normal)
return button
}()

override func viewDidLoad() {
super.viewDidLoad()

navigationItem.rightBarButtonItems = [
UIBarButtonItem(customView: hiddenChannelsButton),
UIBarButtonItem(customView: createChannelButton)
]
createChannelButton.addTarget(self, action: #selector(didTapCreateNewChannel), for: .touchUpInside)
hiddenChannelsButton.addTarget(self, action: #selector(didTapHiddenChannelsButton), for: .touchUpInside)
}

@objc private func didTapCreateNewChannel(_ sender: Any) {
(router as! DemoChatChannelListRouter).showCreateNewChannelFlow()
}

@objc private func didTapHiddenChannelsButton(_ sender: Any) {
let channelListVC = HiddenChannelListVC()
channelListVC.controller = controller
.client
.channelListController(
query: .init(
filter: .and(
[
.containMembers(userIds: [controller.client.currentUserId!]),
.equal(.hidden, to: true)
]
)
)
)
navigationController?.pushViewController(channelListVC, animated: true)
}

override func controller(_ controller: ChatChannelListController, shouldListUpdatedChannel channel: ChatChannel) -> Bool {
channel.lastActiveMembers.contains(where: { $0.id == controller.client.currentUserId })
}

override func controller(_ controller: ChatChannelListController, shouldAddNewChannelToList channel: ChatChannel) -> Bool {
channel.lastActiveMembers.contains(where: { $0.id == controller.client.currentUserId })
}
}

class HiddenChannelListVC: ChatChannelListVC {
override func setUpAppearance() {
super.setUpAppearance()

title = "Hidden Channels"
navigationItem.leftBarButtonItem = nil
}
}
2 changes: 1 addition & 1 deletion DemoApp/ChatUser+CustomFields.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/CreateChatViewController.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/CreateGroupViewController.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Foundation
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/CustomMessageContentView.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Foundation
Expand Down
153 changes: 147 additions & 6 deletions DemoApp/DemoAppCoordinator.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import StreamChat
Expand Down Expand Up @@ -118,21 +118,25 @@ final class DemoAppCoordinator: NSObject, UNUserNotificationCenterDelegate {

connectionController = ChatClient.shared.connectionController()
connectionController?.delegate = connectionDelegate

navigationController.viewControllers = [chatList]
navigationController.isNavigationBarHidden = false

// Init the channel VC and navigate there directly
if let cid = channelID {
let channelVC = ChatChannelVC()
let channelVC = CustomChannelVC()
channelVC.channelController = ChatClient.shared.channelController(for: cid)
navigationController.viewControllers.append(channelVC)
}


let isIpad = UIDevice.current.userInterfaceIdiom == .pad
let window = navigationController.view.window!
let rootVC: UIViewController = isIpad
? makeSplitViewController(channelListVC: chatList)
: navigationController

UIView.transition(with: window, duration: 0.3, options: .transitionFlipFromRight, animations: {
window.rootViewController = self.navigationController

window.rootViewController = rootVC
})
}

Expand All @@ -143,8 +147,33 @@ final class DemoAppCoordinator: NSObject, UNUserNotificationCenterDelegate {
}
}
}

private func makeSplitViewController(channelListVC: DemoChannelListVC) -> UISplitViewController {
let makeChannelController: (String) -> ChatChannelController = { cid in
channelListVC.controller.client.channelController(
for: ChannelId(type: .messaging, id: cid),
channelListQuery: channelListVC.controller.query
)
}

let channelVC = CustomChannelVC()
channelVC.channelController = makeChannelController("unknown")

channelListVC.didSelectChannel = { channel in
channelVC.channelController = makeChannelController(channel.cid.id)
channelVC.messageListVC.listView.reloadData()
channelVC.setUp()
}

let splitController = UISplitViewController()
splitController.viewControllers = [channelListVC, UINavigationController(rootViewController: channelVC)]
splitController.preferredDisplayMode = .oneBesideSecondary
return splitController
}
}

// MARK: Custom Components for the Demo App

class CustomChannelVC: ChatChannelVC {
override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -164,3 +193,115 @@ class CustomChannelVC: ChatChannelVC {
}
}
}

class DemoChannelListVC: ChatChannelListVC {
/// The `UIButton` instance used for navigating to new channel screen creation.
lazy var createChannelButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(systemName: "plus.message")!, for: .normal)
return button
}()

lazy var hiddenChannelsButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(systemName: "archivebox")!, for: .normal)
return button
}()

override func viewDidLoad() {
super.viewDidLoad()

navigationItem.rightBarButtonItems = [
UIBarButtonItem(customView: hiddenChannelsButton),
UIBarButtonItem(customView: createChannelButton)
]
createChannelButton.addTarget(self, action: #selector(didTapCreateNewChannel), for: .touchUpInside)
hiddenChannelsButton.addTarget(self, action: #selector(didTapHiddenChannelsButton), for: .touchUpInside)
}

@objc private func didTapCreateNewChannel(_ sender: Any) {
(router as! DemoChatChannelListRouter).showCreateNewChannelFlow()
}

@objc private func didTapHiddenChannelsButton(_ sender: Any) {
let channelListVC = HiddenChannelListVC()
channelListVC.controller = controller
.client
.channelListController(
query: .init(
filter: .and(
[
.containMembers(userIds: [controller.client.currentUserId!]),
.equal(.hidden, to: true)
]
)
)
)
navigationController?.pushViewController(channelListVC, animated: true)
}

override func controller(_ controller: ChatChannelListController, shouldListUpdatedChannel channel: ChatChannel) -> Bool {
channel.lastActiveMembers.contains(where: { $0.id == controller.client.currentUserId })
}

override func controller(_ controller: ChatChannelListController, shouldAddNewChannelToList channel: ChatChannel) -> Bool {
channel.lastActiveMembers.contains(where: { $0.id == controller.client.currentUserId })
}

var isPad: Bool { UIDevice.current.userInterfaceIdiom == .pad }

var didSelectChannel: ((ChatChannel) -> Void)?
var selectedChannel: ChatChannel? {
didSet {
if selectedChannel != oldValue, let channel = selectedChannel {
didSelectChannel?(channel)
}
}
}

override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if isPad {
let channel = controller.channels[indexPath.row]
selectedChannel = channel
return
}

super.collectionView(collectionView, didSelectItemAt: indexPath)
}

override func controller(_ controller: DataController, didChangeState state: DataController.State) {
super.controller(controller, didChangeState: state)

if isPad && (state == .remoteDataFetched || state == .localDataFetched) {
guard let channel = self.controller.channels.first else { return }
selectedChannel = channel
}
}

override func controller(_ controller: ChatChannelListController, didChangeChannels changes: [ListChange<ChatChannel>]) {
super.controller(controller, didChangeChannels: changes)

guard isPad else { return }
guard let selectedChannel = selectedChannel else { return }
guard let selectedChannelRow = controller.channels.firstIndex(of: selectedChannel) else {
return
}

let selectedItemIndexPath = IndexPath(row: selectedChannelRow, section: 0)

collectionView.selectItem(
at: selectedItemIndexPath,
animated: false,
scrollPosition: .centeredHorizontally
)
}
}

class HiddenChannelListVC: ChatChannelListVC {
override func setUpAppearance() {
super.setUpAppearance()

title = "Hidden Channels"
navigationItem.leftBarButtonItem = nil
}
}
2 changes: 1 addition & 1 deletion DemoApp/DemoUsers.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Foundation
Expand Down
6 changes: 6 additions & 0 deletions DemoApp/Info.plist
Expand Up @@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSBonjourServices</key>
<array>
<string>_Proxyman._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>Atlantis would use Bonjour Service to discover Proxyman app from your local network.</string>
<key>NSCameraUsageDescription</key>
<string>We need access to your camera for sending photo attachments.</string>
<key>CFBundleDevelopmentRegion</key>
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/LoginViewController.swift
@@ -1,5 +1,5 @@
//
// Copyright © 2021 Stream.io Inc. All rights reserved.
// Copyright © 2022 Stream.io Inc. All rights reserved.
//

import Nuke
Expand Down

0 comments on commit 1edabbe

Please sign in to comment.