Updating FluentUI target iOS version to 13.0 (#439)

* Updated podfiles, xcconfig files. Ran pod install.

* Updating pods project.

* Fixing demo app project warning.

* Fix FluentUI project warning:
Enable Recommended Warning:
 - Quoted include in Framework Header

* Bumping library and demo apps versions.

* Removing @available(iOS 13.0, *) decorations.

* Removing if #available(iOS 13, *) checks.
This commit is contained in:
rdeassis 2021-02-17 10:02:13 -08:00 коммит произвёл GitHub
Родитель b1dfe7ad4e
Коммит b5dc346a49
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
52 изменённых файлов: 522 добавлений и 623 удалений

Просмотреть файл

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MicrosoftFluentUI'
s.version = '0.1.28'
s.version = '0.2.0'
s.summary = 'Fluent UI is a set of reusable UI controls and tools'
s.homepage = "https://www.microsoft.com/design/fluent/#/"
s.license = { :type => 'MIT', :file => 'LICENSE' }
@ -12,7 +12,7 @@ Pod::Spec.new do |s|
# iOS
s.ios.deployment_target = "11.0"
s.ios.deployment_target = "13.0"
s.subspec 'Calendar_ios' do |calendar_ios|
calendar_ios.platform = :ios

Просмотреть файл

@ -342,7 +342,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0940;
LastUpgradeCheck = 1120;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "Microsoft Corporation";
TargetAttributes = {
A5CEC20B20E436F10016922A = {
@ -593,6 +593,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -614,7 +615,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DOGFOOD;
@ -679,6 +680,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -705,7 +707,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -742,6 +744,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@ -762,7 +765,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

Просмотреть файл

@ -18,18 +18,13 @@ private let appCenterSecret = app_center_secret_to_be_supplied_before_building
#endif
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, ColorThemeHosting {
class AppDelegate: UIResponder, UIApplicationDelegate {
// MARK: UIApplicationDelegate
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if #available(iOS 13, *) {
// Configured in Scene Delegate
} else {
updateToWindowWith(type: DemoColorThemeDefaultWindow.self, pushing: nil)
}
#if DOGFOOD
MSAppCenter.start(appCenterSecret, withServices: [
@ -41,12 +36,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate, ColorThemeHosting {
return true
}
// MARK: ColorThemeHosting
func updateToWindowWith(type: UIWindow.Type, pushing viewController: UIViewController?) {
let newWindow = type.init(frame: UIScreen.main.bounds)
DemoListViewController.addDemoListTo(window: newWindow, pushing: viewController)
window = newWindow
}
}

Просмотреть файл

@ -139,12 +139,7 @@ class ColorDemoController: UIViewController {
@objc private func segmentedControlValueChanged(sender: Any) {
if let segmentedControl = sender as? SegmentedControl {
let windowType = colorProviderThemedWindowTypes[segmentedControl.selectedSegmentIndex].windowType
let colorThemeHost: ColorThemeHosting?
if #available(iOS 13, *) {
colorThemeHost = view.window?.windowScene?.delegate as? ColorThemeHosting
} else {
colorThemeHost = UIApplication.shared.delegate as? ColorThemeHosting
}
let colorThemeHost = view.window?.windowScene?.delegate as? ColorThemeHosting
if let navigationController = navigationController {
navigationController.popViewController(animated: false)

Просмотреть файл

@ -168,14 +168,12 @@ class TableViewCellFileAccessoryViewDemoController: DemoController {
}
if showErrorAction && !(!top && !showErrorOnBottomCellAction) {
if #available(iOS 13.0, *) {
let action = FileAccessoryViewAction(title: "Error",
image: UIImage(named: "ic_fluent_warning_24_regular")!,
target: self,
action: #selector(handleErrorAction),
canHide: false)
actions.append(action)
}
let action = FileAccessoryViewAction(title: "Error",
image: UIImage(named: "ic_fluent_warning_24_regular")!,
target: self,
action: #selector(handleErrorAction),
canHide: false)
actions.append(action)
}
return actions

Просмотреть файл

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.25</string>
<string>1.3.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
@ -26,7 +26,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>92</string>
<string>93</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>

Просмотреть файл

@ -5,7 +5,6 @@
import UIKit
@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate, ColorThemeHosting {
var window: UIWindow?
weak var windowScene: UIWindowScene?

Просмотреть файл

@ -1,4 +1,4 @@
platform :ios, '11.0'
platform :ios, '13.0'
target 'FluentUI.Demo' do
use_frameworks!

Просмотреть файл

@ -21,6 +21,6 @@ SPEC REPOS:
SPEC CHECKSUMS:
AppCenter: a1c30c47b7882a04a615ffa5ab26c007326436d8
PODFILE CHECKSUM: 1e1a9140723556e2c26508c3b257362fb3760243
PODFILE CHECKSUM: d1479915bd82a7fa670e32b1c738151bcf492a83
COCOAPODS: 1.9.1
COCOAPODS: 1.10.1

4
ios/FluentUI.Demo/Pods/Manifest.lock сгенерированный
Просмотреть файл

@ -21,6 +21,6 @@ SPEC REPOS:
SPEC CHECKSUMS:
AppCenter: a1c30c47b7882a04a615ffa5ab26c007326436d8
PODFILE CHECKSUM: 1e1a9140723556e2c26508c3b257362fb3760243
PODFILE CHECKSUM: d1479915bd82a7fa670e32b1c738151bcf492a83
COCOAPODS: 1.9.1
COCOAPODS: 1.10.1

769
ios/FluentUI.Demo/Pods/Pods.xcodeproj/project.pbxproj сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,3 +1,4 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AppCenter
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
@ -6,6 +7,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/AppCenter
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Просмотреть файл

@ -1,3 +1,4 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AppCenter
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
@ -6,6 +7,7 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/AppCenter
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Просмотреть файл

@ -1,3 +1,4 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
@ -6,4 +7,5 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Просмотреть файл

@ -1,3 +1,4 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
@ -6,4 +7,5 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Просмотреть файл

@ -1,3 +1,4 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/AppCenter/AppCenter-SDK-Apple/iOS"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
@ -6,4 +7,5 @@ PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES

Просмотреть файл

@ -25,7 +25,6 @@ class ColorTests: XCTestCase {
/// - Dark mode:
/// - Background: shade30
/// - Foreground: tint40
@available(iOS 13.0, *)
func testAvatarColorsMatch() {
let lightModeTraitCollection = UITraitCollection(userInterfaceStyle: .light)
let darkModeTraitCollection = UITraitCollection(userInterfaceStyle: .dark)

Просмотреть файл

@ -1099,7 +1099,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1240;
ORGANIZATIONNAME = "Microsoft Corporation";
TargetAttributes = {
8FD01165228A820600D25925 = {
@ -1650,6 +1650,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 53FC90F525673626008A06FD /* FluentUI_release.xcconfig */;
buildSettings = {
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
};
name = Dogfood;
};
@ -1671,6 +1672,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 53FC90F625673626008A06FD /* FluentUI_debug.xcconfig */;
buildSettings = {
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
};
name = Debug;
};
@ -1678,6 +1680,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 53FC90F525673626008A06FD /* FluentUI_release.xcconfig */;
buildSettings = {
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
};
name = Release;
};

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1120"
LastUpgradeVersion = "1240"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

Просмотреть файл

@ -307,9 +307,8 @@ open class BadgeView: UIView {
super.init(frame: .zero)
backgroundView.layer.cornerRadius = Constants.backgroundCornerRadius
if #available(iOS 13.0, *) {
backgroundView.layer.cornerCurve = .continuous
}
backgroundView.layer.cornerCurve = .continuous
addSubview(backgroundView)
label.lineBreakMode = .byTruncatingMiddle

Просмотреть файл

@ -268,19 +268,18 @@ open class CardView: UIView {
heightConstraint.constant = height
}
if #available(iOS 13, *) {
if previousTraitCollection.hasDifferentColorAppearance(comparedTo: traitCollection) {
// Update border color
switch colorStyle {
case .appColor:
if let window = window {
layer.borderColor = UIColor(light: Colors.primaryTint30(for: window), dark: .clear).cgColor
}
case .neutral:
layer.borderColor = Constants.defaultBorderColor.cgColor
case .custom:
layer.borderColor = customBorderColor.cgColor
if previousTraitCollection.hasDifferentColorAppearance(comparedTo: traitCollection) {
// Update border color
switch colorStyle {
case .appColor:
if let window = window {
layer.borderColor = UIColor(light: Colors.primaryTint30(for: window), dark: .clear).cgColor
}
case .neutral:
layer.borderColor = Constants.defaultBorderColor.cgColor
case .custom:
layer.borderColor = customBorderColor.cgColor
}
}
}

Просмотреть файл

@ -16,9 +16,7 @@ class CommandBarButtonGroupView: UIView {
clipsToBounds = true
layer.cornerRadius = CommandBarButtonGroupView.cornerRadius
if #available(iOS 13, *) {
layer.cornerCurve = .continuous
}
layer.cornerCurve = .continuous
configureHierarchy()
applyInsets()

Просмотреть файл

@ -125,10 +125,9 @@ open class ActivityIndicatorView: UIView, ActivityViewAnimating {
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if #available(iOS 13, *) {
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
setupLoaderLayer()
}
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
setupLoaderLayer()
}
}

Просмотреть файл

@ -203,9 +203,7 @@ open class Button: UIButton {
open func initialize() {
layer.cornerRadius = style.cornerRadius
if #available(iOS 13.0, *) {
layer.cornerCurve = .continuous
}
layer.cornerCurve = .continuous
titleLabel?.font = style.titleFont
titleLabel?.adjustsFontForContentSizeCategory = true
@ -214,10 +212,9 @@ open class Button: UIButton {
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if #available(iOS 13, *) {
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
updateBorderColor()
}
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
updateBorderColor()
}
}

Просмотреть файл

@ -73,10 +73,9 @@ open class IndeterminateProgressBarView: UIView, ActivityViewAnimating {
public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if #available(iOS 13, *) {
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
updateColors()
}
if previousTraitCollection?.userInterfaceStyle != traitCollection.userInterfaceStyle {
updateColors()
}
}

Просмотреть файл

@ -104,9 +104,6 @@ open class Label: UILabel {
adjustsFontForContentSizeCategory = true
NotificationCenter.default.addObserver(self, selector: #selector(handleContentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
if #available(iOS 13, *) { } else {
NotificationCenter.default.addObserver(self, selector: #selector(handleDarkerSystemColorsStatusDidChange), name: UIAccessibility.darkerSystemColorsStatusDidChangeNotification, object: nil)
}
}
private func updateFont() {
@ -130,8 +127,4 @@ open class Label: UILabel {
updateFont()
}
}
@objc private func handleDarkerSystemColorsStatusDidChange() {
updateTextColor()
}
}

Просмотреть файл

@ -212,9 +212,8 @@ open class SearchBar: UIView {
textField.enablesReturnKeyAutomatically = true
textField.accessibilityTraits = .searchField
textField.addTarget(self, action: #selector(searchTextFieldValueDidChange(_:)), for: .editingChanged)
if #available(iOS 13, *) {
textField.showsLargeContentViewer = true
}
textField.showsLargeContentViewer = true
return textField
}()
@ -260,10 +259,7 @@ open class SearchBar: UIView {
button.setTitle("Common.Cancel".localized, for: .normal)
button.addTarget(self, action: #selector(SearchBar.cancelButtonTapped(sender:)), for: .touchUpInside)
button.alpha = 0.0
if #available(iOS 13, *) {
button.showsLargeContentViewer = true
}
button.showsLargeContentViewer = true
if #available(iOS 13.4, *) {
// Workaround check for beta iOS versions missing the Pointer Interactions API
@ -369,9 +365,7 @@ open class SearchBar: UIView {
// MARK: - Layout Construction
private func setupLayout() {
if #available(iOS 13, *) {
addInteraction(UILargeContentViewerInteraction())
}
addInteraction(UILargeContentViewerInteraction())
// Autolayout is more efficent if all constraints are activated simultaneously
var constraints = [NSLayoutConstraint]()

Просмотреть файл

@ -155,17 +155,15 @@ open class SegmentedControl: UIControl {
private let backgroundView: UIView = {
let view = UIView()
if #available(iOS 13.0, *) {
view.layer.cornerCurve = .continuous
}
view.layer.cornerCurve = .continuous
return view
}()
private var buttons = [SegmentedControlButton]()
private let selectionView: UIView = {
let view = UIView()
if #available(iOS 13.0, *) {
view.layer.cornerCurve = .continuous
}
view.layer.cornerCurve = .continuous
return view
}()
private let bottomSeparator = Separator()

Просмотреть файл

@ -183,11 +183,9 @@ open class TwoLineTitleView: UIView {
titleButton.accessibilityTraits = [.staticText, .header]
subtitleButton.accessibilityTraits = [.staticText, .header]
if #available(iOS 13, *) {
addInteraction(UILargeContentViewerInteraction())
titleButtonLabel.showsLargeContentViewer = true
subtitleButtonLabel.showsLargeContentViewer = true
}
addInteraction(UILargeContentViewerInteraction())
titleButtonLabel.showsLargeContentViewer = true
subtitleButtonLabel.showsLargeContentViewer = true
}
public required init?(coder aDecoder: NSCoder) {

Просмотреть файл

@ -488,9 +488,7 @@ open class DrawerController: UIViewController {
open override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = backgroundColor
if #available(iOS 13.0, *) {
view.layer.cornerCurve = .continuous
}
view.layer.cornerCurve = .continuous
view.isAccessibilityElement = false
containerView.translatesAutoresizingMaskIntoConstraints = false
@ -976,9 +974,9 @@ extension DrawerController: UIViewControllerTransitioningDelegate {
switch presentationStyle(for: source) {
case .slideover:
let direction = presentationDirection(for: source.view)
if #available(iOS 13.0, *) {
useNavigationBarBackgroundColor = (direction.isVertical && source.traitCollection.userInterfaceLevel == .elevated)
}
useNavigationBarBackgroundColor = (direction.isVertical && source.traitCollection.userInterfaceLevel == .elevated)
let drawerPresentationController = DrawerPresentationController(presentedViewController: presented,
presentingViewController: presenting,
source: source,

Просмотреть файл

@ -13,13 +13,7 @@ import UIKit
/// Returns self on iOS 13 and later. For older iOS versions returns self for Regular Contrast mode or a specific color for Increased Contrast mode if it's defined either for this color or for one of its ancestors.
var current: UIColor {
if #available(iOS 13, *) {
return self
}
if !UIAccessibility.isDarkerSystemColorsEnabled {
return self
}
return lightHighContrast ?? light?.current ?? self
return self
}
private var light: UIColor? {
@ -40,36 +34,27 @@ import UIKit
}
convenience init(light: UIColor, lightHighContrast: UIColor? = nil, lightElevated: UIColor? = nil, lightElevatedHighContrast: UIColor? = nil, dark: UIColor? = nil, darkHighContrast: UIColor? = nil, darkElevated: UIColor? = nil, darkElevatedHighContrast: UIColor? = nil) {
if #available(iOS 13, *) {
self.init { traits -> UIColor in
let getColorForContrast = { (default: UIColor?, highContrast: UIColor?) -> UIColor? in
if traits.accessibilityContrast == .high, let color = highContrast {
return color
}
return `default`
}
let getColor = { (default: UIColor?, highContrast: UIColor?, elevated: UIColor?, elevatedHighContrast: UIColor?) -> UIColor? in
if traits.userInterfaceLevel == .elevated,
let color = getColorForContrast(elevated, elevatedHighContrast) {
return color
}
return getColorForContrast(`default`, highContrast)
}
if traits.userInterfaceStyle == .dark,
let color = getColor(dark, darkHighContrast, darkElevated, darkElevatedHighContrast) {
self.init { traits -> UIColor in
let getColorForContrast = { (default: UIColor?, highContrast: UIColor?) -> UIColor? in
if traits.accessibilityContrast == .high, let color = highContrast {
return color
}
return getColor(light, lightHighContrast, lightElevated, lightElevatedHighContrast)!
return `default`
}
return
}
self.init(cgColor: light.cgColor)
self.light = light
if let lightHighContrast = lightHighContrast {
self.lightHighContrast = lightHighContrast
let getColor = { (default: UIColor?, highContrast: UIColor?, elevated: UIColor?, elevatedHighContrast: UIColor?) -> UIColor? in
if traits.userInterfaceLevel == .elevated,
let color = getColorForContrast(elevated, elevatedHighContrast) {
return color
}
return getColorForContrast(`default`, highContrast)
}
if traits.userInterfaceStyle == .dark,
let color = getColor(dark, darkHighContrast, darkElevated, darkElevatedHighContrast) {
return color
}
return getColor(light, lightHighContrast, lightElevated, lightElevatedHighContrast)!
}
}
}

Просмотреть файл

@ -14,17 +14,6 @@ import UIKit
}
@objc func image(withPrimaryColor primaryColor: UIColor) -> UIImage {
if #available(iOS 13.0, *) {
return self.withTintColor(primaryColor, renderingMode: .alwaysOriginal)
} else {
let size = self.size
let renderer = UIGraphicsImageRenderer(size: size)
let coloredImage = renderer.image { (context) in
primaryColor.setFill()
context.fill(CGRect(origin: .zero, size: size))
self.draw(at: .zero, blendMode: .destinationIn, alpha: 1.0)
}
return coloredImage.withRenderingMode(.alwaysOriginal)
}
return self.withTintColor(primaryColor, renderingMode: .alwaysOriginal)
}
}

Просмотреть файл

@ -77,9 +77,7 @@ class HUDView: UIView {
backgroundColor = Colors.HUD.background
layer.cornerRadius = Constants.backgroundCornerRadius
layer.masksToBounds = true
if #available(iOS 13.0, *) {
layer.cornerCurve = .continuous
}
layer.cornerCurve = .continuous
container.addArrangedSubview(indicatorView)

Просмотреть файл

@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.28</string>
<string>0.2.0</string>
<key>CFBundleVersion</key>
<string>0.1.28</string>
<string>0.2.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>

Просмотреть файл

@ -309,9 +309,7 @@ open class NavigationBar: UINavigationBar {
setupContentStackView()
contentStackView.isLayoutMarginsRelativeArrangement = true
updateContentStackViewMargins(forExpandedContent: true)
if #available(iOS 13, *) {
contentStackView.addInteraction(UILargeContentViewerInteraction())
}
contentStackView.addInteraction(UILargeContentViewerInteraction())
//leftBarButtonItemsStackView: layout priorities are slightly lower to make sure titleView has the highest priority in horizontal spacing
contentStackView.addArrangedSubview(leftBarButtonItemsStackView)
@ -612,15 +610,14 @@ open class NavigationBar: UINavigationBar {
button.accessibilityIdentifier = item.accessibilityIdentifier
button.accessibilityLabel = item.accessibilityLabel
button.accessibilityHint = item.accessibilityHint
if #available(iOS 13, *) {
button.showsLargeContentViewer = true
if let customLargeContentSizeImage = item.largeContentSizeImage {
button.largeContentImage = customLargeContentSizeImage
}
button.showsLargeContentViewer = true
if item.title == nil {
button.largeContentTitle = item.accessibilityLabel
}
if let customLargeContentSizeImage = item.largeContentSizeImage {
button.largeContentImage = customLargeContentSizeImage
}
if item.title == nil {
button.largeContentTitle = item.accessibilityLabel
}
if #available(iOS 13.4, *) {

Просмотреть файл

@ -157,11 +157,7 @@ class ShyHeaderView: UIView {
private var needsShadow: Bool {
switch navigationBarShadow {
case .automatic:
var needsShadow = navigationBarStyle == .system
if #available(iOS 13, *) {
needsShadow = needsShadow && traitCollection.userInterfaceStyle != .dark
}
return needsShadow
return navigationBarStyle == .system && traitCollection.userInterfaceStyle != .dark
case .alwaysHidden:
return false
}
@ -194,9 +190,7 @@ class ShyHeaderView: UIView {
addSubview(contentStackView)
contentStackView.fitIntoSuperview(usingConstraints: true)
updateContentInsets()
if #available(iOS 13, *) {
contentStackView.addInteraction(UILargeContentViewerInteraction())
}
contentStackView.addInteraction(UILargeContentViewerInteraction())
}
private func initShadow() {

Просмотреть файл

@ -200,9 +200,7 @@ class LargeTitleView: UIView {
tapGesture.addTarget(self, action: #selector(LargeTitleView.handleTitleViewTapped(sender:)))
addGestureRecognizer(tapGesture)
if #available(iOS 13, *) {
titleButton.showsLargeContentViewer = true
}
titleButton.showsLargeContentViewer = true
updateAvatarViewPointerInteraction()
}

Просмотреть файл

@ -520,9 +520,8 @@ open class NotificationView: UIView {
private func updateForStyle() {
clipsToBounds = !style.needsSeparator
layer.cornerRadius = style.cornerRadius
if #available(iOS 13.0, *) {
layer.cornerCurve = .continuous
}
layer.cornerCurve = .continuous
separator.isHidden = !style.needsSeparator
updateWindowSpecificColors()

Просмотреть файл

@ -90,11 +90,9 @@ open class PillButton: UIButton {
layer.cornerRadius = PillButton.cornerRadius
clipsToBounds = true
if #available(iOS 13, *) {
layer.cornerCurve = .continuous
largeContentTitle = titleLabel?.text
showsLargeContentViewer = true
}
layer.cornerCurve = .continuous
largeContentTitle = titleLabel?.text
showsLargeContentViewer = true
contentEdgeInsets = UIEdgeInsets(top: Constants.topInset,
left: Constants.horizontalInset,

Просмотреть файл

@ -422,9 +422,8 @@ open class PillButtonBar: UIScrollView {
showsVerticalScrollIndicator = false
showsHorizontalScrollIndicator = false
if #available(iOS 13, *) {
addInteraction(UILargeContentViewerInteraction())
}
addInteraction(UILargeContentViewerInteraction())
}
private func setupStackView() {

Просмотреть файл

@ -120,9 +120,7 @@ open class SideTabBar: UIView {
addSubview(topStackView)
addSubview(bottomStackView)
if #available(iOS 13, *) {
addInteraction(UILargeContentViewerInteraction())
}
addInteraction(UILargeContentViewerInteraction())
accessibilityTraits = .tabBar
@ -164,9 +162,7 @@ open class SideTabBar: UIView {
private let backgroundView: UIVisualEffectView = {
var style = UIBlurEffect.Style.regular
if #available(iOS 13, *) {
style = .systemChromeMaterial
}
style = .systemChromeMaterial
return UIVisualEffectView(effect: UIBlurEffect(style: style))
}()

Просмотреть файл

@ -75,12 +75,10 @@ class TabBarItemView: UIView {
isAccessibilityElement = true
updateAccessibilityLabel()
if #available(iOS 13, *) {
self.largeContentImage = item.largeContentImage ?? item.image
largeContentTitle = item.title
showsLargeContentViewer = true
scalesLargeContentImage = true
}
self.largeContentImage = item.largeContentImage ?? item.image
largeContentTitle = item.title
showsLargeContentViewer = true
scalesLargeContentImage = true
NSLayoutConstraint.activate([
container.centerXAnchor.constraint(equalTo: centerXAnchor),

Просмотреть файл

@ -97,9 +97,7 @@ open class TabBarView: UIView {
topBorderLine.leadingAnchor.constraint(equalTo: leadingAnchor),
topBorderLine.trailingAnchor.constraint(equalTo: trailingAnchor)])
if #available(iOS 13, *) {
addInteraction(UILargeContentViewerInteraction())
}
addInteraction(UILargeContentViewerInteraction())
accessibilityTraits = .tabBar
updateHeight()
@ -139,9 +137,8 @@ open class TabBarView: UIView {
private let backgroundView: UIVisualEffectView = {
var style = UIBlurEffect.Style.regular
if #available(iOS 13, *) {
style = .systemChromeMaterial
}
style = .systemChromeMaterial
return UIVisualEffectView(effect: UIBlurEffect(style: style))
}()

Просмотреть файл

@ -171,10 +171,7 @@ open class TableViewCellFileAccessoryView: UIView {
private lazy var actionsStackView: UIStackView = {
let stackView = createHorizontalStackView()
if #available(iOS 13, *) {
stackView.addInteraction(UILargeContentViewerInteraction())
}
stackView.addInteraction(UILargeContentViewerInteraction())
return stackView
}()
@ -500,11 +497,9 @@ private class FileAccessoryViewActionView: UIButton {
heightAnchor.constraint(greaterThanOrEqualToConstant: FileAccessoryViewActionView.size.height)
])
if #available(iOS 13, *) {
showsLargeContentViewer = true
scalesLargeContentImage = true
largeContentTitle = action.title
}
showsLargeContentViewer = true
scalesLargeContentImage = true
largeContentTitle = action.title
if #available(iOS 13.4, *) {
// Workaround check for beta iOS versions missing the Pointer Interactions API

Просмотреть файл

@ -66,9 +66,8 @@ class TooltipView: UIView {
private let backgroundView: UIView = {
let view = UIView()
view.layer.cornerRadius = backgroundCornerRadius
if #available(iOS 13.0, *) {
view.layer.cornerCurve = .continuous
}
view.layer.cornerCurve = .continuous
return view
}()

Просмотреть файл

@ -45,7 +45,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES
IPHONEOS_DEPLOYMENT_TARGET = 11.0
IPHONEOS_DEPLOYMENT_TARGET = 13.0
SDKROOT = iphoneos
TARGETED_DEVICE_FAMILY = 1,2
VERSIONING_SYSTEM = apple-generic

Просмотреть файл

@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.28</string>
<string>0.2.0</string>
<key>CFBundleVersion</key>
<string>0.1.28</string>
<string>0.2.0</string>
</dict>
</plist>

Просмотреть файл

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.28</string>
<string>0.2.0</string>
<key>CFBundleVersion</key>
<string>17</string>
<string>18</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSMainNibFile</key>