#4693 - Drop iOS 11 support.

This commit is contained in:
Stefan Ceriu 2021-09-01 12:44:15 +03:00 committed by Stefan Ceriu
parent dacaa891a0
commit a786cbb90a
32 changed files with 73 additions and 176 deletions

View file

@ -25,7 +25,7 @@
KEYCHAIN_ACCESS_GROUP = $(AppIdentifierPrefix)$(BASE_BUNDLE_IDENTIFIER).keychain.shared
// Build settings
IPHONEOS_DEPLOYMENT_TARGET = 11.0
IPHONEOS_DEPLOYMENT_TARGET = 12.1
SDKROOT = iphoneos
TARGETED_DEVICE_FAMILY = 1,2
SWIFT_VERSION = 5.3.1
@ -45,4 +45,4 @@ CLANG_ANALYZER_NONNULL = YES
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE
CLANG_ENABLE_MODULES = YES
CLANG_ENABLE_OBJC_ARC = YES
CLANG_ENABLE_OBJC_ARC = YES

View file

@ -1,7 +1,7 @@
source 'https://cdn.cocoapods.org/'
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.1'
# Use frameforks to allow usage of pod written in Swift (like PiwikTracker)
use_frameworks!
@ -72,7 +72,7 @@ abstract_target 'RiotPods' do
pod 'SwiftJWT', '~> 3.6.200'
pod 'SideMenu', '~> 6.5'
pod 'DSWaveformImage', '~> 6.1.1'
pod 'ffmpeg-kit-ios-audio', '~> 4.4.LTS'
pod 'ffmpeg-kit-ios-audio', '~> 4.4'
pod 'FLEX', '~> 4.4.1', :configurations => ['Debug']

View file

@ -116,7 +116,7 @@ PODS:
DEPENDENCIES:
- DGCollectionViewLeftAlignFlowLayout (~> 1.0.4)
- DSWaveformImage (~> 6.1.1)
- ffmpeg-kit-ios-audio (~> 4.4.LTS)
- ffmpeg-kit-ios-audio (~> 4.4)
- FLEX (~> 4.4.1)
- FlowCommoniOS (~> 1.10.0)
- GBDeviceInfo (~> 6.6.0)
@ -219,6 +219,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
PODFILE CHECKSUM: f9dc9d7fa1edb054941ecb97326eb31a900d2b13
PODFILE CHECKSUM: 81db0a2f4da6c24be3bfdd2c2de5b57e954f133e
COCOAPODS: 1.10.1
COCOAPODS: 1.10.2

View file

@ -21,17 +21,12 @@ import UIKit
/// Returns 'true' if the current device has a notch
var hasNotch: Bool {
if #available(iOS 11.0, *) {
// Case 1: Portrait && top safe area inset >= 44
let case1 = !UIDevice.current.orientation.isLandscape && (UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0) >= 44
// Case 2: Lanscape && left/right safe area inset > 0
let case2 = UIDevice.current.orientation.isLandscape && ((UIApplication.shared.keyWindow?.safeAreaInsets.left ?? 0) > 0 || (UIApplication.shared.keyWindow?.safeAreaInsets.right ?? 0) > 0)
return case1 || case2
} else {
// Fallback on earlier versions
return false
}
// Case 1: Portrait && top safe area inset >= 44
let case1 = !UIDevice.current.orientation.isLandscape && (UIApplication.shared.keyWindow?.safeAreaInsets.top ?? 0) >= 44
// Case 2: Lanscape && left/right safe area inset > 0
let case2 = UIDevice.current.orientation.isLandscape && ((UIApplication.shared.keyWindow?.safeAreaInsets.left ?? 0) > 0 || (UIApplication.shared.keyWindow?.safeAreaInsets.right ?? 0) > 0)
return case1 || case2
}
/// Returns if the device is a Phone

View file

@ -22,10 +22,8 @@ extension UITableView {
/// Returns safe area insetted separator inset. Should only be used when custom constraints on custom table view cells are being set according to separator insets.
@objc var vc_separatorInset: UIEdgeInsets {
var result = separatorInset
if #available(iOS 11.0, *) {
result.left -= self.safeAreaInsets.left
result.right -= self.safeAreaInsets.right
}
result.left -= self.safeAreaInsets.left
result.right -= self.safeAreaInsets.right
return result
}

View file

@ -26,10 +26,8 @@ extension UITableViewCell {
/// Returns safe area insetted separator inset. Should only be used when custom constraints on custom table view cells are being set according to separator insets.
@objc var vc_separatorInset: UIEdgeInsets {
var result = separatorInset
if #available(iOS 11.0, *) {
result.left -= self.safeAreaInsets.left
result.right -= self.safeAreaInsets.right
}
result.left -= self.safeAreaInsets.left
result.right -= self.safeAreaInsets.right
return result
}

View file

@ -80,7 +80,6 @@ import DesignKit
var keyboardAppearance: UIKeyboardAppearance { get }
@available(iOS 12.0, *)
var userInterfaceStyle: UIUserInterfaceStyle { get }

View file

@ -76,7 +76,6 @@ class DarkTheme: NSObject, Theme {
var scrollBarStyle: UIScrollView.IndicatorStyle = .white
var keyboardAppearance: UIKeyboardAppearance = .dark
@available(iOS 12.0, *)
var userInterfaceStyle: UIUserInterfaceStyle {
return .dark
}

View file

@ -82,7 +82,6 @@ class DefaultTheme: NSObject, Theme {
var scrollBarStyle: UIScrollView.IndicatorStyle = .default
var keyboardAppearance: UIKeyboardAppearance = .light
@available(iOS 12.0, *)
var userInterfaceStyle: UIUserInterfaceStyle {
return .light
}

View file

@ -708,12 +708,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
}
_isAppForeground = YES;
if (@available(iOS 11.0, *))
{
// Riot has its own dark theme. Prevent iOS from applying its one
[application keyWindow].accessibilityIgnoresInvertColors = YES;
}
// Riot has its own dark theme. Prevent iOS from applying its one
[application keyWindow].accessibilityIgnoresInvertColors = YES;
[self handleAppState];
}

View file

@ -1,59 +0,0 @@
//
// Copyright 2020 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
import SafariServices
/// LegacySSOAuthentificationSession is session used to authenticate a user through a web service on iOS 11 and earlier. It uses SFAuthenticationSession.
final class LegacySSOAuthentificationSession: SSOAuthentificationSessionProtocol {
// MARK: - Constants
// MARK: - Properties
private var authentificationSession: SFAuthenticationSession?
// MARK: - Public
func setContextProvider(_ contextProvider: SSOAuthenticationSessionContextProviding) {
}
func authenticate(with url: URL, callbackURLScheme: String?, completionHandler: @escaping SSOAuthenticationSessionCompletionHandler) {
let authentificationSession = SFAuthenticationSession(url: url, callbackURLScheme: callbackURLScheme) { (callbackURL, error) in
var finalError: Error?
if let error = error as? SFAuthenticationError {
switch error.code {
case .canceledLogin:
finalError = SSOAuthentificationSessionError.userCanceled
default:
finalError = error
}
}
completionHandler(callbackURL, finalError)
}
self.authentificationSession = authentificationSession
authentificationSession.start()
}
func cancel() {
self.authentificationSession?.cancel()
}
}

View file

@ -110,19 +110,11 @@ final class SSOAuthenticationPresenter: NSObject {
return
}
let authenticationSession: SSOAuthentificationSessionProtocol
let authenticationSession = SSOAuthentificationSession()
if #available(iOS 12.0, *) {
authenticationSession = SSOAuthentificationSession()
} else {
authenticationSession = LegacySSOAuthentificationSession()
}
if #available(iOS 12.0, *) {
if let presentingWindow = presentingViewController.view.window {
let contextProvider = SSOAuthenticationSessionContextProvider(window: presentingWindow)
authenticationSession.setContextProvider(contextProvider)
}
if let presentingWindow = presentingViewController.view.window {
let contextProvider = SSOAuthenticationSessionContextProvider(window: presentingWindow)
authenticationSession.setContextProvider(contextProvider)
}
authenticationSession.authenticate(with: authenticationURL, callbackURLScheme: self.ssoAuthenticationService.callBackURLScheme) { [weak self] (callBackURL, error) in

View file

@ -18,7 +18,6 @@ import Foundation
import AuthenticationServices
/// Provides context to target where in an application's UI the authorization view should be shown.
@available(iOS 12.0, *)
class SSOAuthenticationSessionContextProvider: NSObject, SSOAuthenticationSessionContextProviding, ASWebAuthenticationPresentationContextProviding {
let window: UIWindow
@ -33,7 +32,6 @@ class SSOAuthenticationSessionContextProvider: NSObject, SSOAuthenticationSessio
/// SSOAuthentificationSession is session used to authenticate a user through a web service on iOS 12+. It uses ASWebAuthenticationSession.
/// More information: https://developer.apple.com/documentation/authenticationservices/authenticating_a_user_through_a_web_service
@available(iOS 12.0, *)
final class SSOAuthentificationSession: SSOAuthentificationSessionProtocol {
// MARK: - Constants

View file

@ -749,7 +749,7 @@
}
// Look for the lowest section index visible in the bottom sticky headers.
CGFloat maxVisiblePosY = self.recentsTableView.contentOffset.y + self.recentsTableView.frame.size.height - self.recentsTableView.mxk_adjustedContentInset.bottom;
CGFloat maxVisiblePosY = self.recentsTableView.contentOffset.y + self.recentsTableView.frame.size.height - self.recentsTableView.adjustedContentInset.bottom;
UIView *lastDisplayedSectionHeader = displayedSectionHeaders.lastObject;
for (UIView *header in _stickyHeadersBottomContainer.subviews)
@ -1542,7 +1542,7 @@
{
if (!self.recentsSearchBar.isHidden)
{
if (!self.recentsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.mxk_adjustedContentInset.top > self.recentsSearchBar.frame.size.height))
if (!self.recentsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.adjustedContentInset.top > self.recentsSearchBar.frame.size.height))
{
// Hide the search bar
[self hideSearchBar:YES];
@ -1991,7 +1991,7 @@
- (void)scrollToTop:(BOOL)animated
{
[self.recentsTableView setContentOffset:CGPointMake(-self.recentsTableView.mxk_adjustedContentInset.left, -self.recentsTableView.mxk_adjustedContentInset.top) animated:animated];
[self.recentsTableView setContentOffset:CGPointMake(-self.recentsTableView.adjustedContentInset.left, -self.recentsTableView.adjustedContentInset.top) animated:animated];
}
- (void)scrollToTheTopTheNextRoomWithMissedNotificationsInSection:(NSInteger)section

View file

@ -545,7 +545,7 @@
{
if (!self.groupsSearchBar.isHidden)
{
if (!self.groupsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.mxk_adjustedContentInset.top > self.groupsSearchBar.frame.size.height))
if (!self.groupsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.adjustedContentInset.top > self.groupsSearchBar.frame.size.height))
{
// Hide the search bar
[self hideSearchBar:YES];
@ -590,7 +590,7 @@
- (void)scrollToTop:(BOOL)animated
{
[self.groupsTableView setContentOffset:CGPointMake(-self.groupsTableView.mxk_adjustedContentInset.left, -self.groupsTableView.mxk_adjustedContentInset.top) animated:animated];
[self.groupsTableView setContentOffset:CGPointMake(-self.groupsTableView.adjustedContentInset.left, -self.groupsTableView.adjustedContentInset.top) animated:animated];
}
#pragma mark - MXKGroupListViewControllerDelegate

View file

@ -167,7 +167,7 @@
// Observe kAppDelegateDidTapStatusBarNotification.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.contactsTableView setContentOffset:CGPointMake(-self.contactsTableView.mxk_adjustedContentInset.left, -self.contactsTableView.mxk_adjustedContentInset.top) animated:YES];
[self.contactsTableView setContentOffset:CGPointMake(-self.contactsTableView.adjustedContentInset.left, -self.contactsTableView.adjustedContentInset.top) animated:YES];
}];
@ -353,7 +353,7 @@
- (void)scrollToTop:(BOOL)animated
{
// Scroll to the top
[self.contactsTableView setContentOffset:CGPointMake(-self.contactsTableView.mxk_adjustedContentInset.left, -self.contactsTableView.mxk_adjustedContentInset.top) animated:animated];
[self.contactsTableView setContentOffset:CGPointMake(-self.contactsTableView.adjustedContentInset.left, -self.contactsTableView.adjustedContentInset.top) animated:animated];
}
#pragma mark - UITableView delegate

View file

@ -113,7 +113,7 @@
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.tableView setContentOffset:CGPointMake(-self.tableView.mxk_adjustedContentInset.left, -self.tableView.mxk_adjustedContentInset.top) animated:YES];
[self.tableView setContentOffset:CGPointMake(-self.tableView.adjustedContentInset.left, -self.tableView.adjustedContentInset.top) animated:YES];
}];

View file

@ -19,7 +19,7 @@ import Foundation
class VersionCheckCoordinator: Coordinator, VersionCheckBannerViewDelegate, VersionCheckAlertViewControllerDelegate {
private enum Constants {
static let osVersionToBeDropped = 11
static let hasOSVersionBeenDropped = false
static let hasOSVersionBeenDropped = true
static let supportURL = URL(string: "https://support.apple.com/en-gb/guide/iphone/iph3e504502/ios")
}

View file

@ -36,15 +36,14 @@ final class BubbleReactionActionViewCell: UICollectionViewCell, NibReusable, The
// MARK: - Life cycle
override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
if #available(iOS 12.0, *) {
/*
On iOS 12, there are issues with self-sizing cells as described in Apple release notes (https://developer.apple.com/documentation/ios_release_notes/ios_12_release_notes) :
"You might encounter issues with systemLayoutSizeFitting(_:) when using a UICollectionViewCell subclass that requires updateConstraints().
(42138227) Workaround: Don't call the cell's setNeedsUpdateConstraints() method unless you need to support live constraint changes.
If you need to support live constraint changes, call updateConstraintsIfNeeded() before calling systemLayoutSizeFitting(_:)."
*/
self.updateConstraintsIfNeeded()
}
/*
On iOS 12, there are issues with self-sizing cells as described in Apple release notes (https://developer.apple.com/documentation/ios_release_notes/ios_12_release_notes) :
"You might encounter issues with systemLayoutSizeFitting(_:) when using a UICollectionViewCell subclass that requires updateConstraints().
(42138227) Workaround: Don't call the cell's setNeedsUpdateConstraints() method unless you need to support live constraint changes.
If you need to support live constraint changes, call updateConstraintsIfNeeded() before calling systemLayoutSizeFitting(_:)."
*/
self.updateConstraintsIfNeeded()
return super.preferredLayoutAttributesFitting(layoutAttributes)
}

View file

@ -57,15 +57,14 @@ final class BubbleReactionViewCell: UICollectionViewCell, NibReusable, Themable
}
override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
if #available(iOS 12.0, *) {
/*
On iOS 12, there are issues with self-sizing cells as described in Apple release notes (https://developer.apple.com/documentation/ios_release_notes/ios_12_release_notes) :
"You might encounter issues with systemLayoutSizeFitting(_:) when using a UICollectionViewCell subclass that requires updateConstraints().
(42138227) Workaround: Don't call the cell's setNeedsUpdateConstraints() method unless you need to support live constraint changes.
If you need to support live constraint changes, call updateConstraintsIfNeeded() before calling systemLayoutSizeFitting(_:)."
*/
self.updateConstraintsIfNeeded()
}
/*
On iOS 12, there are issues with self-sizing cells as described in Apple release notes (https://developer.apple.com/documentation/ios_release_notes/ios_12_release_notes) :
"You might encounter issues with systemLayoutSizeFitting(_:) when using a UICollectionViewCell subclass that requires updateConstraints().
(42138227) Workaround: Don't call the cell's setNeedsUpdateConstraints() method unless you need to support live constraint changes.
If you need to support live constraint changes, call updateConstraintsIfNeeded() before calling systemLayoutSizeFitting(_:)."
*/
self.updateConstraintsIfNeeded()
return super.preferredLayoutAttributesFitting(layoutAttributes)
}

View file

@ -58,11 +58,7 @@ final class RoomContextualMenuViewController: UIViewController, Themable {
private var hiddenToolbarViewBottomConstant: CGFloat {
let bottomSafeAreaHeight: CGFloat
if #available(iOS 11.0, *) {
bottomSafeAreaHeight = self.view.safeAreaInsets.bottom
} else {
bottomSafeAreaHeight = self.bottomLayoutGuide.length
}
bottomSafeAreaHeight = self.view.safeAreaInsets.bottom
return -(self.menuToolbarViewHeightConstraint.constant + bottomSafeAreaHeight)
}

View file

@ -92,9 +92,7 @@ final class EmojiPickerViewController: UIViewController {
// Enable to hide search bar on scrolling after first time view appear
// Commenting out below code for now. It broke the navigation bar background. For details: https://github.com/vector-im/riot-ios/issues/3271
// if #available(iOS 11.0, *) {
// self.navigationItem.hidesSearchBarWhenScrolling = true
// }
// self.navigationItem.hidesSearchBarWhenScrolling = true
}
override func viewDidDisappear(_ animated: Bool) {
@ -140,9 +138,7 @@ final class EmojiPickerViewController: UIViewController {
self.setupCollectionView()
if #available(iOS 11.0, *) {
self.setupSearchController()
}
self.setupSearchController()
}
private func setupCollectionView() {
@ -158,10 +154,8 @@ final class EmojiPickerViewController: UIViewController {
collectionViewFlowLayout.sectionInset = CollectionViewLayout.sectionInsets
collectionViewFlowLayout.sectionHeadersPinToVisibleBounds = true // Enable sticky headers
// Avoid device notch in landascape (e.g. iPhone X)
if #available(iOS 11.0, *) {
collectionViewFlowLayout.sectionInsetReference = .fromSafeArea
}
// Avoid device notch in landscape (e.g. iPhone X)
collectionViewFlowLayout.sectionInsetReference = .fromSafeArea
}
self.collectionView.register(supplementaryViewType: EmojiPickerHeaderView.self, ofKind: UICollectionView.elementKindSectionHeader)
@ -175,11 +169,9 @@ final class EmojiPickerViewController: UIViewController {
searchController.searchBar.placeholder = VectorL10n.searchDefaultPlaceholder
searchController.hidesNavigationBarDuringPresentation = false
if #available(iOS 11.0, *) {
self.navigationItem.searchController = searchController
// Make the search bar visible on first view appearance
self.navigationItem.hidesSearchBarWhenScrolling = false
}
self.navigationItem.searchController = searchController
// Make the search bar visible on first view appearance
self.navigationItem.hidesSearchBarWhenScrolling = false
self.definesPresentationContext = true

View file

@ -562,7 +562,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
// Observe kAppDelegateDidTapStatusBarNotification.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self setBubbleTableViewContentOffset:CGPointMake(-self.bubblesTableView.mxk_adjustedContentInset.left, -self.bubblesTableView.mxk_adjustedContentInset.top) animated:YES];
[self setBubbleTableViewContentOffset:CGPointMake(-self.bubblesTableView.adjustedContentInset.left, -self.bubblesTableView.adjustedContentInset.top) animated:YES];
}];
if ([self.roomDataSource.roomId isEqualToString:[LegacyAppDelegate theDelegate].lastNavigatedRoomIdFromPush])
@ -756,7 +756,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
CGRect frame = previewHeader.bottomBorderView.frame;
self.previewHeaderContainerHeightConstraint.constant = frame.origin.y + frame.size.height;
self.bubblesTableViewTopConstraint.constant = self.previewHeaderContainerHeightConstraint.constant - self.bubblesTableView.mxk_adjustedContentInset.top;
self.bubblesTableViewTopConstraint.constant = self.previewHeaderContainerHeightConstraint.constant - self.bubblesTableView.adjustedContentInset.top;
}
else
{
@ -2262,7 +2262,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveEaseIn
animations:^{
self.bubblesTableViewTopConstraint.constant = self.previewHeaderContainerHeightConstraint.constant - self.bubblesTableView.mxk_adjustedContentInset.top;
self.bubblesTableViewTopConstraint.constant = self.previewHeaderContainerHeightConstraint.constant - self.bubblesTableView.adjustedContentInset.top;
previewHeader.roomAvatar.alpha = 1;
@ -4108,7 +4108,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
// Switch back to the live mode when the user scrolls to the bottom of the non live timeline.
if (!self.roomDataSource.isLive && ![self isRoomPreview])
{
CGFloat contentBottomPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.frame.size.height - self.bubblesTableView.mxk_adjustedContentInset.bottom;
CGFloat contentBottomPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.frame.size.height - self.bubblesTableView.adjustedContentInset.bottom;
if (contentBottomPosY >= self.bubblesTableView.contentSize.height && ![self.roomDataSource.timeline canPaginate:MXTimelineDirectionForwards])
{
[self goBackToLive];
@ -5092,12 +5092,12 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
if (readMarkerTableViewCell && isAppeared && !self.isBubbleTableViewDisplayInTransition)
{
// Check whether the read marker is visible
CGFloat contentTopPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.mxk_adjustedContentInset.top;
CGFloat contentTopPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.adjustedContentInset.top;
CGFloat readMarkerViewPosY = readMarkerTableViewCell.frame.origin.y + readMarkerTableViewCell.readMarkerView.frame.origin.y;
if (contentTopPosY <= readMarkerViewPosY)
{
// Compute the max vertical position visible according to contentOffset
CGFloat contentBottomPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.frame.size.height - self.bubblesTableView.mxk_adjustedContentInset.bottom;
CGFloat contentBottomPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.frame.size.height - self.bubblesTableView.adjustedContentInset.bottom;
if (readMarkerViewPosY <= contentBottomPosY)
{
// Launch animation
@ -5205,7 +5205,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
// The read marker display is still enabled (see roomDataSource.showReadMarker flag),
// this means the read marker was not been visible yet.
// We show the banner if the marker is located in the top hidden part of the cell.
CGFloat contentTopPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.mxk_adjustedContentInset.top;
CGFloat contentTopPosY = self.bubblesTableView.contentOffset.y + self.bubblesTableView.adjustedContentInset.top;
CGFloat readMarkerViewPosY = roomBubbleTableViewCell.frame.origin.y + roomBubbleTableViewCell.readMarkerView.frame.origin.y;
self.jumpToLastUnreadBannerContainer.hidden = (contentTopPosY < readMarkerViewPosY);
}

View file

@ -116,7 +116,7 @@
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.searchTableView setContentOffset:CGPointMake(-self.searchTableView.mxk_adjustedContentInset.left, -self.searchTableView.mxk_adjustedContentInset.top) animated:YES];
[self.searchTableView setContentOffset:CGPointMake(-self.searchTableView.adjustedContentInset.left, -self.searchTableView.adjustedContentInset.top) animated:YES];
}];
}

View file

@ -117,7 +117,7 @@
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.searchTableView setContentOffset:CGPointMake(-self.searchTableView.mxk_adjustedContentInset.left, -self.searchTableView.mxk_adjustedContentInset.top) animated:YES];
[self.searchTableView setContentOffset:CGPointMake(-self.searchTableView.adjustedContentInset.left, -self.searchTableView.adjustedContentInset.top) animated:YES];
}];
}

View file

@ -320,7 +320,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
// Observe appDelegateDidTapStatusBarNotificationObserver.
appDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.tableView setContentOffset:CGPointMake(-self.tableView.mxk_adjustedContentInset.left, -self.tableView.mxk_adjustedContentInset.top) animated:YES];
[self.tableView setContentOffset:CGPointMake(-self.tableView.adjustedContentInset.left, -self.tableView.adjustedContentInset.top) animated:YES];
}];
}

View file

@ -134,7 +134,7 @@ const CGFloat kComposerContainerTrailingPadding = 12;
{
[self.attachMediaButton setImage:[UIImage imageNamed:@"upload_icon_dark"] forState:UIControlStateNormal];
}
else if (@available(iOS 12.0, *) && ThemeService.shared.theme.userInterfaceStyle == UIUserInterfaceStyleDark) {
else if (ThemeService.shared.theme.userInterfaceStyle == UIUserInterfaceStyleDark) {
[self.attachMediaButton setImage:[UIImage imageNamed:@"upload_icon_dark"] forState:UIControlStateNormal];
}

View file

@ -151,7 +151,7 @@
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.tableView setContentOffset:CGPointMake(-self.tableView.mxk_adjustedContentInset.left, -self.tableView.mxk_adjustedContentInset.top) animated:YES];
[self.tableView setContentOffset:CGPointMake(-self.tableView.adjustedContentInset.left, -self.tableView.adjustedContentInset.top) animated:YES];
}];

View file

@ -736,7 +736,7 @@ TableViewSectionsDelegate>
// Observe kAppDelegateDidTapStatusBarNotificationObserver.
kAppDelegateDidTapStatusBarNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kAppDelegateDidTapStatusBarNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
[self.tableView setContentOffset:CGPointMake(-self.tableView.mxk_adjustedContentInset.left, -self.tableView.mxk_adjustedContentInset.top) animated:YES];
[self.tableView setContentOffset:CGPointMake(-self.tableView.adjustedContentInset.left, -self.tableView.adjustedContentInset.top) animated:YES];
}];

View file

@ -71,11 +71,7 @@ class SlidingModalContainerView: UIView, Themable, NibLoadable {
private var dismissContentViewBottomConstant: CGFloat {
let bottomSafeAreaHeight: CGFloat
if #available(iOS 11.0, *) {
bottomSafeAreaHeight = self.contentView.safeAreaInsets.bottom
} else {
bottomSafeAreaHeight = 0
}
bottomSafeAreaHeight = self.contentView.safeAreaInsets.bottom
return -(self.contentViewHeightConstraint.constant + bottomSafeAreaHeight)
}

View file

@ -267,9 +267,7 @@
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
dispatch_async(dispatch_get_main_queue(), ^{
[self.recentsSearchBar setShowsCancelButton:YES animated:NO];
});
}
@ -288,7 +286,7 @@
{
if (!self.recentsSearchBar.isHidden)
{
if (!self.recentsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.mxk_adjustedContentInset.top > self.recentsSearchBar.frame.size.height))
if (!self.recentsSearchBar.text.length && (scrollView.contentOffset.y + scrollView.adjustedContentInset.top > self.recentsSearchBar.frame.size.height))
{
// Hide the search bar
[self hideSearchBar:YES];

1
changelog.d/4693.build Normal file
View file

@ -0,0 +1 @@
Bumped the minimum deployment target to iOS 12.1