Skip to content

Commit

Permalink
update with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hugobernalstream committed Jun 16, 2022
2 parents 7b6f0b6 + d848e05 commit 9551990
Show file tree
Hide file tree
Showing 70 changed files with 1,163 additions and 219 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}
- name: Allure TestOps Launch Removal
if: env.LAUNCH_ID != '' && cancelled()
run: bundle exec fastlane allure_launch_removal launch_id:$LAUNCH_ID
env:
ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }}

allure_testops_launch:
name: Launch Allure TestOps
Expand Down
1 change: 0 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
--commas inline
--trimwhitespace nonblank-lines
--stripunusedargs closure-only
--maxwidth 132

--binarygrouping 4,7
--octalgrouping none
Expand Down
3 changes: 1 addition & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ excluded:
- vendor
- UISDKdocumentation
- Tests
- TestTools
- Carthage
- Pods
- .build
Expand All @@ -20,8 +21,6 @@ disabled_rules:
- multiple_closures_with_trailing_closure
- todo
- function_parameter_count
- force_cast
- force_try
- type_name
- nesting
- identifier_name
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming
## StreamChat
### ✅ Added
- `parentMessageId` parameter for typing events [#2080](https://github.com/GetStream/stream-chat-swift/issues/2080)
### 🐞 Fixed
- Fix hidden channels not appearing on relaunch [#2056](https://github.com/GetStream/stream-chat-swift/issues/2056)
- Fix `channel.hidden` event failing to decode on launch/reconnection [#2056](https://github.com/GetStream/stream-chat-swift/issues/2056)
- Fix messages in hidden channels with `clearHistory` re-appearing [#2056](https://github.com/GetStream/stream-chat-swift/issues/2056)
- Fix last message of hidden channel with `clearHistory` visible in channel list [#2056](https://github.com/GetStream/stream-chat-swift/issues/2056)
- Message action title now supports displaying 2 lines of text instead of 1 [#2082](https://github.com/GetStream/stream-chat-swift/pull/2082)
- Fix Logger persisting config after usage, preventing changing parameters (such as LogLevel) [#2081](https://github.com/GetStream/stream-chat-swift/issues/2081)
### 🔄 Changed
- JSON decoding performance is increased 3 times, parsing time reduced by %70 [#2081](https://github.com/GetStream/stream-chat-swift/issues/2081)

## StreamChatUI
### ✅ Added
- Show typing users within a thread [#2080](https://github.com/GetStream/stream-chat-swift/issues/2080)

## StreamChatUI
### ✅ Added
Expand Down
16 changes: 8 additions & 8 deletions DemoApp/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="3Sb-ov-lIw">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="3Sb-ov-lIw">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
Expand All @@ -28,7 +28,7 @@
<rect key="frame" x="0.0" y="290.5" width="414" height="571.5"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" id="aZA-7S-O7h" customClass="UserCredentialsCell" customModule="ChatSample" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="UserCredentialsCell" id="aZA-7S-O7h" customClass="UserCredentialsCell" customModule="ChatSample" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="62.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="aZA-7S-O7h" id="e3W-Zp-DRN">
Expand Down Expand Up @@ -147,7 +147,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacingType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="8QA-pW-MTy">
<rect key="frame" x="0.0" y="16" width="414" height="160"/>
<rect key="frame" x="0.0" y="60" width="414" height="160"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Chat API Key" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Jye-aX-OTy">
<rect key="frame" x="0.0" y="0.0" width="414" height="34"/>
Expand All @@ -172,7 +172,7 @@
</subviews>
</stackView>
<button opaque="NO" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NAL-Cp-UKn" customClass="MainButton" customModule="ChatSample" customModuleProvider="target">
<rect key="frame" x="0.0" y="208" width="414" height="44"/>
<rect key="frame" x="0.0" y="252" width="414" height="44"/>
<color key="backgroundColor" name="AccentColor"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="JRh-ZO-YhQ"/>
Expand Down Expand Up @@ -301,7 +301,7 @@
<rect key="frame" x="0.0" y="91" width="414" height="655"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="72" id="fPJ-ch-riB" customClass="UserCredentialsCell" customModule="ChatSample" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="UserCredentialsCell" rowHeight="72" id="fPJ-ch-riB" customClass="UserCredentialsCell" customModule="ChatSample" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="72"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="fPJ-ch-riB" id="A5U-q9-6qd">
Expand Down Expand Up @@ -460,7 +460,7 @@
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="Mgv-Ml-5Ew" customClass="GroupUserCell" customModule="ChatSample" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="GroupUserCell" id="Mgv-Ml-5Ew" customClass="GroupUserCell" customModule="ChatSample" customModuleProvider="target">
<rect key="frame" x="0.0" y="-14" width="128" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="LI1-gx-p7l">
Expand Down Expand Up @@ -539,7 +539,7 @@
<rect key="frame" x="0.0" y="124" width="414" height="627"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" id="pn0-12-DRx" customClass="SearchUserCell" customModule="ChatSample" customModuleProvider="target">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="SearchUserCell" id="pn0-12-DRx" customClass="SearchUserCell" customModule="ChatSample" customModuleProvider="target">
<rect key="frame" x="0.0" y="44.5" width="414" height="62.5"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" layoutMarginsFollowReadableWidth="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="pn0-12-DRx" id="vN2-tu-tg7">
Expand Down
19 changes: 11 additions & 8 deletions DemoApp/DemoAppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ private extension DemoAppCoordinator {
self?.showChat(for: user, cid: nil, animated: true)
}

set(rootViewController: loginVC, animated: animated)
if let loginVC = loginVC {
set(rootViewController: loginVC, animated: animated)
}
}

func set(rootViewController: UIViewController, animated: Bool) {
Expand All @@ -86,14 +88,15 @@ private extension DemoAppCoordinator {
// MARK: - Screens factory

private extension DemoAppCoordinator {
func makeLoginVC(onUserSelection: @escaping (DemoUserType) -> Void) -> UIViewController {
func makeLoginVC(onUserSelection: @escaping (DemoUserType) -> Void) -> UIViewController? {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let loginNVC = storyboard.instantiateInitialViewController() as! UINavigationController

let loginVC = loginNVC.viewControllers.first as! LoginViewController
loginVC.onUserSelection = onUserSelection
if let loginNVC = storyboard.instantiateInitialViewController() as? UINavigationController,
let loginVC = loginNVC.viewControllers.first as? LoginViewController {
loginVC.onUserSelection = onUserSelection
return loginNVC
}

return loginNVC
return nil
}

func makeChatVC(for user: DemoUserType, startOn cid: ChannelId?, onLogout: @escaping () -> Void) -> UIViewController {
Expand Down Expand Up @@ -134,7 +137,7 @@ private extension DemoAppCoordinator {
onLogout: @escaping () -> Void
) -> UIViewController {
let channelListVC = DemoChatChannelListVC.make(with: controller)
channelListVC.demoRouter.onLogout = onLogout
channelListVC.demoRouter?.onLogout = onLogout
channelListVC.selectedChannel = selectedChannel
return channelListVC
}
Expand Down
18 changes: 10 additions & 8 deletions DemoApp/Screens/Create Chat/CreateChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,10 @@ class CreateChatViewController: UIViewController {

@objc func openCreateGroupChat() {
let storyboard = UIStoryboard(name: "Main", bundle: .main)

let createGroupController = storyboard.instantiateViewController(withIdentifier: "CreateGroupViewController")
as! CreateGroupViewController
createGroupController.searchController = searchController.client.userSearchController()

navigationController?.pushViewController(createGroupController, animated: true)
if let createGroupController = storyboard.instantiateViewController(withIdentifier: "CreateGroupViewController") as? CreateGroupViewController {
createGroupController.searchController = searchController.client.userSearchController()
navigationController?.pushViewController(createGroupController, animated: true)
}
}
}

Expand Down Expand Up @@ -301,7 +299,9 @@ extension CreateChatViewController: UITableViewDelegate, UITableViewDataSource {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! UserCredentialsCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: "UserCredentialsCell", for: indexPath) as? UserCredentialsCell else {
return UITableViewCell()
}
let user = users[indexPath.row]

if let imageURL = user.imageURL {
Expand Down Expand Up @@ -332,7 +332,9 @@ extension CreateChatViewController: UITableViewDelegate, UITableViewDataSource {
tableView.deselectRow(at: indexPath, animated: true)
}

let cell = tableView.cellForRow(at: indexPath) as! UserCredentialsCell
guard let cell = tableView.cellForRow(at: indexPath) as? UserCredentialsCell else {
return
}
guard cell.accessoryImageView.image == nil else {
// The cell isn't selected
// De-select user by tapping functionality was removed due to designer feedback
Expand Down
15 changes: 12 additions & 3 deletions DemoApp/Screens/Create Chat/CreateGroupViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Foundation
import Nuke
import StreamChat
import StreamChatUI
import UIKit

class CreateGroupViewController: UIViewController {
Expand Down Expand Up @@ -163,7 +164,10 @@ extension CreateGroupViewController: UITableViewDelegate, UITableViewDataSource
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! SearchUserCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: "SearchUserCell", for: indexPath) as? SearchUserCell else {
return UITableViewCell()
}

let user = users[indexPath.row]

if let imageURL = user.imageURL {
Expand Down Expand Up @@ -194,7 +198,9 @@ extension CreateGroupViewController: UITableViewDelegate, UITableViewDataSource
tableView.deselectRow(at: indexPath, animated: true)
}

let cell = tableView.cellForRow(at: indexPath) as! SearchUserCell
guard let cell = tableView.cellForRow(at: indexPath) as? SearchUserCell else {
return
}
guard cell.accessoryImageView.image == nil else {
// The cell isn't selected
// De-select user by tapping functionality was removed due to designer feedback
Expand All @@ -220,7 +226,10 @@ extension CreateGroupViewController: UICollectionViewDataSource, UICollectionVie
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! GroupUserCell
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "GroupUserCell", for: indexPath) as? GroupUserCell else {
return UICollectionViewCell()
}

let user = selectedUsers[indexPath.row]

if let imageURL = user.imageURL {
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/Screens/Create Chat/NameGroupViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ extension NameGroupViewController: UITableViewDataSource {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: UserCell.reuseIdentifier) as! UserCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: UserCell.reuseIdentifier) as? UserCell else { return UITableViewCell() }
let user = selectedUsers[indexPath.row]

if let imageURL = user.imageURL {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension LoginViewController: UITableViewDelegate, UITableViewDataSource {
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! UserCredentialsCell
guard let cell = tableView.dequeueReusableCell(withIdentifier: "UserCredentialsCell", for: indexPath) as? UserCredentialsCell else { return UITableViewCell() }

let user = users[indexPath.row]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import Foundation
import StreamChat
import StreamChatUI
import UIKit

class UserCredentialsCell: UITableViewCell {
Expand Down
10 changes: 4 additions & 6 deletions DemoApp/StreamChat/Components/DemoChatChannelListRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ final class DemoChatChannelListRouter: ChatChannelListRouter {

func showCreateNewChannelFlow() {
let storyboard = UIStoryboard(name: "Main", bundle: .main)

let chatViewController = storyboard.instantiateViewController(withIdentifier: "CreateChatViewController")
as! CreateChatViewController
chatViewController.searchController = rootViewController.controller.client.userSearchController()

rootNavigationController?.pushViewController(chatViewController, animated: true)
if let chatViewController = storyboard.instantiateViewController(withIdentifier: "CreateChatViewController") as? CreateChatViewController {
chatViewController.searchController = rootViewController.controller.client.userSearchController()
rootNavigationController?.pushViewController(chatViewController, animated: true)
}
}

override func showCurrentUserProfile() {
Expand Down
Loading

0 comments on commit 9551990

Please sign in to comment.