Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iOS deployment targets to 15.1 #1849

Merged
merged 4 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Backpack-Common.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Pod::Spec.new do |s|
s.ios.resource_bundle = {
'Icons' => 'Backpack-Common/Icons/Assets/*'
}
s.ios.deployment_target = '14.0'
s.ios.deployment_target = '15.1'
s.source_files = 'Backpack-Common/**/*.swift'
s.exclude_files = 'Backpack-Common/Tests/**/*.swift'
s.requires_arc = true
Expand Down
2 changes: 1 addition & 1 deletion Backpack-Fonts/Backpack-Fonts.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Pod::Spec.new do |spec|
spec.author = {
'Backpack Design System' => '[email protected]'
}
spec.ios.deployment_target = '14.0'
spec.ios.deployment_target = '15.1'
spec.source = {
git: 'https://github.com/Skyscanner/backpack-ios.git', tag: spec.version.to_s
}
Expand Down
2 changes: 1 addition & 1 deletion Backpack-SwiftUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.source = {
git: 'https://github.com/Skyscanner/backpack-ios.git', tag: s.version.to_s
}
s.ios.deployment_target = '14.0'
s.ios.deployment_target = '15.1'
s.source_files = 'Backpack-SwiftUI/*/Classes/**/*.swift'

s.dependency 'Backpack-Common'
Expand Down
2 changes: 1 addition & 1 deletion Backpack.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.source = {
git: 'https://github.com/Skyscanner/backpack-ios.git', tag: s.version.to_s
}
s.ios.deployment_target = '14.0'
s.ios.deployment_target = '15.1'
s.source_files = 'Backpack/Backpack.h', 'Backpack/Common.h', 'Backpack/*/Classes/**/*.{h,m,swift}'
s.exclude_files = 'Backpack/Tests/**'
s.public_header_files = 'Backpack/Backpack.h', 'Backpack/*/Classes/**/*.h'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ final class BPKFloatingPanelController: FloatingPanelController {
}

override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
if #available(iOS 13.0, *) {
if self.traitCollection.userInterfaceStyle != previousTraitCollection?.userInterfaceStyle {
guard let bottomSection = bottomSectionViewController else { return }
addTopShadow(to: bottomSection)
}
if self.traitCollection.userInterfaceStyle != previousTraitCollection?.userInterfaceStyle {
guard let bottomSection = bottomSectionViewController else { return }
addTopShadow(to: bottomSection)
}
}
}
Expand Down
36 changes: 17 additions & 19 deletions Backpack/Color/Classes/Generated/BPKColor.m
Original file line number Diff line number Diff line change
Expand Up @@ -551,27 +551,25 @@ + (NSString *)cacheKeyForColor:(UIColor *)color {

+ (UIColor *)dynamicColorWithLightVariant:(UIColor *)lightVariant darkVariant:(UIColor *)darkVariant {
#if __BPK_DARK_MODE_SUPPORTED
if (@available(iOS 13.0, *)) {
NSString *cacheKey = [NSString stringWithFormat:@"%@_%@", [self cacheKeyForColor:lightVariant], [self cacheKeyForColor:darkVariant]];
UIColor *potentialCacheHit = [[self dynamicColorsCache] objectForKey:cacheKey];

if (potentialCacheHit) {
return potentialCacheHit;
}

UIColor *newDynamicColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
return darkVariant;
} else {
return lightVariant;
}
}];

[[self dynamicColorsCache] setObject:newDynamicColor forKey:cacheKey];
return newDynamicColor;
NSString *cacheKey = [NSString stringWithFormat:@"%@_%@", [self cacheKeyForColor:lightVariant], [self cacheKeyForColor:darkVariant]];
UIColor *potentialCacheHit = [[self dynamicColorsCache] objectForKey:cacheKey];

if (potentialCacheHit) {
return potentialCacheHit;
}

UIColor *newDynamicColor = [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) {
if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
return darkVariant;
} else {
return lightVariant;
}
}];

[[self dynamicColorsCache] setObject:newDynamicColor forKey:cacheKey];
return newDynamicColor;
#endif
return lightVariant;
return lightVariant;
}

@end
Expand Down
24 changes: 10 additions & 14 deletions Example/Backpack Screenshot/SnapshotHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,16 @@ open class Snapshot: NSObject {
}

class func fixLandscapeOrientation(image: UIImage) -> UIImage {
#if os(watchOS)
return image
#else
if #available(iOS 10.0, *) {
let format = UIGraphicsImageRendererFormat()
format.scale = image.scale
let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
return renderer.image { context in
image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
}
} else {
return image
}
#endif
#if os(watchOS)
return image
#else
let format = UIGraphicsImageRendererFormat()
format.scale = image.scale
let renderer = UIGraphicsImageRenderer(size: image.size, format: format)
return renderer.image { context in
image.draw(in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height))
}
#endif
}

class func waitForLoadingIndicatorToDisappear(within timeout: TimeInterval) {
Expand Down
16 changes: 8 additions & 8 deletions Example/Backpack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand Down Expand Up @@ -2004,7 +2004,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand Down Expand Up @@ -2033,7 +2033,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = NO;
INFOPLIST_FILE = "Backpack/Backpack-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
MODULE_NAME = ExampleApp;
Expand Down Expand Up @@ -2067,7 +2067,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = NO;
INFOPLIST_FILE = "Backpack/Backpack-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
MODULE_NAME = ExampleApp;
Expand All @@ -2093,7 +2093,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Backpack Screenshot/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -2122,7 +2122,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Backpack Screenshot/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -2153,7 +2153,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Backpack NativeUITests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -2187,7 +2187,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "Backpack NativeUITests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ class TappableLinkLabelsViewController: UIViewController, BPKTappableLinkLabelDe
}

func isAlternateStyleWithLightMode() -> Bool {
#if swift(>=4.2)
if #available(iOS 13.0, *) {
return style == .alternate && traitCollection.userInterfaceStyle == .light
}

#endif
return true
style == .alternate && traitCollection.userInterfaceStyle == .light
}
}
4 changes: 2 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://cdn.cocoapods.org/'

platform :ios, '14.0'
platform :ios, '15.1'
use_frameworks!
ensure_bundler! '> 2.0'

Expand All @@ -25,7 +25,7 @@ post_install do |installer|
puts 'Removing static analyzer support'
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1'
end

if target.name == "FSCalendar"
Expand Down
12 changes: 6 additions & 6 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
AppCenter: 87ef6eefd8ade4df59e88951288587429f3dd2a5
Backpack: e5f5dca8cef64bd1626b21fee94e06a3dbef60ee
Backpack-Common: cd375986447ca5f60fda52609fd6e1eccecfdc45
Backpack-Fonts: 89f9d18aeeb0f6fb026e301261d3af3ee6a8ec6d
Backpack-SwiftUI: f3a7d7bce777f1bfaf70dbfd9d6b7d101d0263ec
Backpack: 6ea2b8690a1ac4e10a1bc19c84e9106acdfe2c02
Backpack-Common: 9a47d236de2f7fea7366f7a893423b8375ee7a39
Backpack-Fonts: 8d10ac600d738cb7ae6e49fee969800c2db51f6b
Backpack-SwiftUI: f1d0e98dc0beb0f0a44178796aae6c407fb9d7d3
FloatingPanel: 3cee815e9ded75b632543fa73ab655a1ef941452
FSCalendar: 2d1d0d9398f12d439f55c1fe0f01525b151b8260
MBProgressHUD: 3ee5efcc380f6a79a7cc9b363dd669c5e1ae7406
Expand All @@ -93,6 +93,6 @@ SPEC CHECKSUMS:
SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52
TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656

PODFILE CHECKSUM: 2bf9f0ac06a0705cb6f41d0ac9f14da7a4f5abce
PODFILE CHECKSUM: db90d722d21004d77a9d6cf29da110b644239024

COCOAPODS: 1.13.0
COCOAPODS: 1.14.3
Loading