Skip to content

Commit

Permalink
Update minimum deployment target to iOS 13.0 / macOS 10.15 (airbnb#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
calda committed Feb 21, 2024
1 parent 7fe8b6f commit 41dfe7b
Show file tree
Hide file tree
Showing 26 changed files with 20 additions and 76 deletions.
12 changes: 6 additions & 6 deletions Lottie.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -4120,7 +4120,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -4197,7 +4197,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
Expand Down Expand Up @@ -4231,7 +4231,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 1.0;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
Expand Down Expand Up @@ -4274,7 +4274,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
};
name = Debug;
};
Expand Down Expand Up @@ -4308,7 +4308,7 @@
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 11.0;
TVOS_DEPLOYMENT_TARGET = 13.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackageDescription
let package = Package(
name: "Lottie",
// Minimum platform versions should be kept in sync with the per-platform targets in Lottie.xcodeproj, lottie-ios.podspec, and lottie-spm's Package.swift
platforms: [.iOS("11.0"), .macOS("10.11"), .tvOS("11.0"), .custom("visionOS", versionString: "1.0")],
platforms: [.iOS("13.0"), .macOS("10.15"), .tvOS("13.0"), .custom("visionOS", versionString: "1.0")],
products: [.library(name: "Lottie", targets: ["Lottie"])],
dependencies: [
.package(url: "https://github.com/airbnb/swift", .upToNextMajor(from: "1.0.1")),
Expand Down
5 changes: 1 addition & 4 deletions Sources/Private/EmbeddedLibraries/EpoxyCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ When doing this, follow these steps:
3. Change all of the `public` symbols defined in this module to instead be `internal`
to prevent Lottie from exposing any EpoxyCore APIs.

4. Add `@available` annotations as necessary so the library compiles
(Lottie has a lower minimum iOS version than EpoxyCore).

5. Namespace any types that conflict with other existing types.
4. Namespace any types that conflict with other existing types.
For example, the EpoxyCore `Entry` type conflicts with the ZipFoundation `Entry` type,
so the EpoxyCore type has been renamed to `EpoxyEntry`.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftUI
/// collection view cells out of automated view controller impression tracking.
///
/// - SeeAlso: `EpoxySwiftUIHostingView`
@available(iOS 13.0, tvOS 13.0, *)
open class EpoxySwiftUIHostingController<Content: View>: UIHostingController<Content> {

// MARK: Lifecycle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ enum SwiftUIHostingViewReuseBehavior: Hashable {

// MARK: - CallbackContextEpoxyModeled

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension CallbackContextEpoxyModeled
where
Self: WillDisplayProviding & DidEndDisplayingProviding,
Expand Down Expand Up @@ -57,7 +56,6 @@ extension CallbackContextEpoxyModeled
/// the API is private and 3) the `_UIHostingView` doesn't not accept setting a new `View` instance.
///
/// - SeeAlso: `EpoxySwiftUIHostingController`
@available(iOS 13.0, tvOS 13.0, *)
final class EpoxySwiftUIHostingView<RootView: View>: UIView, EpoxyableView {

// MARK: Lifecycle
Expand Down Expand Up @@ -347,7 +345,6 @@ extension UIResponder {

/// The object that is used to communicate changes in the root view to the
/// `EpoxySwiftUIHostingController`.
@available(iOS 13.0, tvOS 13.0, *)
final class EpoxyHostingContent<RootView: View>: ObservableObject {

// MARK: Lifecycle
Expand All @@ -365,7 +362,6 @@ final class EpoxyHostingContent<RootView: View>: ObservableObject {

/// The object that is used to communicate values to SwiftUI views within an
/// `EpoxySwiftUIHostingController`, e.g. layout margins.
@available(iOS 13.0, tvOS 13.0, *)
final class EpoxyHostingEnvironment: ObservableObject {
@Published var layoutMargins = EdgeInsets()
@Published var intrinsicContentSizeInvalidator = EpoxyIntrinsicContentSizeInvalidator(invalidate: { })
Expand All @@ -375,7 +371,6 @@ final class EpoxyHostingEnvironment: ObservableObject {

/// The wrapper view that is used to communicate values to SwiftUI views within an
/// `EpoxySwiftUIHostingController`, e.g. layout margins.
@available(iOS 13.0, tvOS 13.0, *)
struct EpoxyHostingWrapper<Content: View>: View {
@ObservedObject var content: EpoxyHostingContent<Content>
@ObservedObject var environment: EpoxyHostingEnvironment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct EpoxyIntrinsicContentSizeInvalidator {

// MARK: - EnvironmentValues

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension EnvironmentValues {
/// A means of invalidating the intrinsic content size of the parent `EpoxySwiftUIHostingView`.
var epoxyIntrinsicContentSizeInvalidator: EpoxyIntrinsicContentSizeInvalidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import SwiftUI

// MARK: - View

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension View {
/// Applies the layout margins from the parent `EpoxySwiftUIHostingView` to this `View`, if there
/// are any.
Expand All @@ -22,7 +21,6 @@ extension View {

// MARK: - EnvironmentValues

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension EnvironmentValues {
/// The layout margins of the parent `EpoxySwiftUIHostingView`, else zero if there is none.
var epoxyLayoutMargins: EdgeInsets {
Expand All @@ -33,7 +31,6 @@ extension EnvironmentValues {

// MARK: - EpoxyLayoutMarginsKey

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
private struct EpoxyLayoutMarginsKey: EnvironmentKey {
static let defaultValue = EdgeInsets()
}
Expand All @@ -42,7 +39,6 @@ private struct EpoxyLayoutMarginsKey: EnvironmentKey {

/// A view modifier that applies the layout margins from an enclosing `EpoxySwiftUIHostingView` to
/// the modified `View`.
@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
private struct EpoxyLayoutMarginsPadding: ViewModifier {
@Environment(\.epoxyLayoutMargins) var epoxyLayoutMargins

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

// MARK: - StyledView

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension StyledView where Self: ContentConfigurableView & BehaviorsConfigurableView {
/// Returns a SwiftUI `View` representing this `EpoxyableView`.
///
Expand Down Expand Up @@ -52,7 +51,6 @@ extension StyledView where Self: ContentConfigurableView & BehaviorsConfigurable
}
}

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension StyledView
where
Self: ContentConfigurableView & BehaviorsConfigurableView,
Expand Down Expand Up @@ -96,7 +94,6 @@ extension StyledView
}
}

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension StyledView
where
Self: ContentConfigurableView & BehaviorsConfigurableView,
Expand Down Expand Up @@ -138,7 +135,6 @@ extension StyledView
}
}

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension StyledView
where
Self: ContentConfigurableView & BehaviorsConfigurableView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftUI
/// `sizeThatFits(…)` method.
///
/// - SeeAlso: ``SwiftUIMeasurementContainer``
@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
protocol MeasuringViewRepresentable: ViewRepresentableType
where
RepresentableViewType == SwiftUIMeasurementContainer<Content>
Expand All @@ -32,7 +31,6 @@ protocol MeasuringViewRepresentable: ViewRepresentableType

// MARK: Extensions

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension MeasuringViewRepresentable {
/// Returns a copy of this view with its sizing strategy updated to the given `sizing` value.
func sizing(_ strategy: SwiftUIMeasurementContainerStrategy) -> Self {
Expand All @@ -45,7 +43,6 @@ extension MeasuringViewRepresentable {
// MARK: Defaults

#if os(iOS) || os(tvOS)
@available(iOS 13.0, tvOS 13.0, *)
extension MeasuringViewRepresentable {
func _overrideSizeThatFits(
_ size: inout CGSize,
Expand Down Expand Up @@ -87,7 +84,6 @@ extension MeasuringViewRepresentable {
}

#elseif os(macOS)
@available(macOS 10.15, *)
extension MeasuringViewRepresentable {
func _overrideSizeThatFits(
_ size: inout CGSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import SwiftUI
/// height through the `SwiftUISizingContext` binding.
///
/// - SeeAlso: ``MeasuringViewRepresentable``
@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
final class SwiftUIMeasurementContainer<Content: ViewType>: ViewType {

// MARK: Lifecycle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SwiftUI
///
/// Includes an optional generic `Storage` value, which can be used to compare old and new values
/// across state changes to prevent redundant view updates.
@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
struct SwiftUIView<Content: ViewType, Storage>: MeasuringViewRepresentable,
UIViewConfiguringSwiftUIView
{
Expand Down Expand Up @@ -51,7 +50,6 @@ struct SwiftUIView<Content: ViewType, Storage>: MeasuringViewRepresentable,

// MARK: UIViewRepresentable

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension SwiftUIView {
func makeCoordinator() -> Coordinator {
Coordinator(storage: storage)
Expand Down Expand Up @@ -98,7 +96,6 @@ extension SwiftUIView {

// MARK: SwiftUIView.ConfigurationContext

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension SwiftUIView {
/// The configuration context that's available to configure the `Content` view whenever the
/// `updateUIView()` method is invoked via a configuration closure.
Expand Down Expand Up @@ -130,7 +127,6 @@ extension SwiftUIView {

// MARK: SwiftUIView.Coordinator

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension SwiftUIView {
/// A coordinator that stores the `storage` associated with this view, enabling the old storage
/// value to be accessed during the `updateUIView(…)`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import SwiftUI

// MARK: - ViewTypeProtocol + swiftUIView

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension ViewTypeProtocol {
/// Returns a SwiftUI `View` representing this `UIView`, constructed with the given `makeView`
/// closure and sized with the given sizing configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import SwiftUI

/// A protocol describing a SwiftUI `View` that can configure its `UIView` content via an array of
/// `configuration` closures.
@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
protocol UIViewConfiguringSwiftUIView: View {
/// The context available to this configuration, which provides the `UIView` instance at a minimum
/// but can include additional context as needed.
Expand All @@ -24,7 +23,6 @@ protocol UIViewConfiguringSwiftUIView: View {

// MARK: Extensions

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension UIViewConfiguringSwiftUIView {
/// Returns a copy of this view updated to have the given closure applied to its represented view
/// whenever it is updated via the `updateUIView(…)` method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ typealias ViewType = UIView

/// The platform's SwiftUI view representable type.
/// Either `UIViewRepresentable` on iOS/tvOS or `NSViewRepresentable` on macOS.
@available(iOS 13.0, tvOS 13.0, *)
typealias ViewRepresentableType = UIViewRepresentable

/// The platform's layout constraint priority type.
/// Either `UILayoutPriority` on iOS/tvOS or `NSLayoutConstraint.Priority` on macOS.
typealias LayoutPriorityType = UILayoutPriority

@available(iOS 13.0, tvOS 13.0, *)
extension ViewRepresentableType {
/// The platform's view type for `ViewRepresentableType`.
/// Either `UIViewType` on iOS/tvOS or `NSViewType` on macOS.
Expand All @@ -35,14 +33,12 @@ typealias ViewType = NSView

/// The platform's SwiftUI view representable type.
/// Either `UIViewRepresentable` on iOS/tvOS, or `NSViewRepresentable` on macOS.
@available(macOS 10.15, *)
typealias ViewRepresentableType = NSViewRepresentable

/// The platform's layout constraint priority type.
/// Either `UILayoutPriority` on iOS/tvOS, or `NSLayoutConstraint.Priority` on macOS.
typealias LayoutPriorityType = NSLayoutConstraint.Priority

@available(macOS 10.15, *)
extension ViewRepresentableType {
/// The platform's view type for `ViewRepresentableType`.
/// Either `UIViewType` on iOS/tvOS or `NSViewType` on macOS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ final class CoreTextRenderLayer: CALayer {
private var needsContentUpdate = false

// Draws Debug colors for the font alignment.
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)
private func drawDebug(_ ctx: CGContext) {
if let font {
let ascent = CTFontGetAscent(font)
Expand Down
8 changes: 3 additions & 5 deletions Sources/Private/Model/DotLottie/DotLottieUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ enum DotLottieUtils {

/// Temp folder to app directory
static var tempDirectoryURL: URL {
if #available(iOS 10.0, macOS 10.12, *) {
return FileManager.default.temporaryDirectory
}
return URL(fileURLWithPath: NSTemporaryDirectory())
FileManager.default.temporaryDirectory
}
}

Expand Down Expand Up @@ -56,7 +53,8 @@ public enum DotLottieError: Error {
case noDataLoaded
/// Asset with this name was not found in the provided bundle.
case assetNotFound(name: String, bundle: Bundle?)
/// Animation loading from asset is not supported on macOS 10.10.
/// Animation loading from asset was not supported on macOS 10.10,
/// but this error is no longer used.
case loadingFromAssetNotSupported

@available(*, deprecated, message: "Unused")
Expand Down
13 changes: 5 additions & 8 deletions Sources/Private/Utility/Extensions/DataExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ extension Data {
throw DotLottieError.assetNotFound(name: assetName, bundle: bundle)
}
#else
if #available(macOS 10.11, *) {
if let asset = NSDataAsset(name: assetName, bundle: bundle) {
self = asset.data
return
} else {
throw DotLottieError.assetNotFound(name: assetName, bundle: bundle)
}
if let asset = NSDataAsset(name: assetName, bundle: bundle) {
self = asset.data
return
} else {
throw DotLottieError.assetNotFound(name: assetName, bundle: bundle)
}
throw DotLottieError.loadingFromAssetNotSupported
#endif
}
}
1 change: 0 additions & 1 deletion Sources/Private/Utility/Helpers/Binding+Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#if canImport(SwiftUI)
import SwiftUI

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension Binding {

/// Helper to transform a `Binding` from one `Value` type to another.
Expand Down
1 change: 0 additions & 1 deletion Sources/Private/Utility/Helpers/View+ValueChanged.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import Combine
import SwiftUI

@available(iOS 13.0, tvOS 13.0, macOS 10.15, *)
extension View {
/// A backwards compatible wrapper for iOS 14 `onChange`
@ViewBuilder
Expand Down
1 change: 0 additions & 1 deletion Sources/Public/Animation/LottieAnimationHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ extension LottieAnimation {
/// - Parameter url: The url to load the animation from.
/// - Parameter animationCache: A cache for holding loaded animations. Defaults to `LottieAnimationCache.shared`. Optional.
///
@available(iOS 13.0, macOS 10.15, tvOS 13.0, *)
public static func loadedFrom(
url: URL,
session: URLSession = .shared,
Expand Down
Loading

0 comments on commit 41dfe7b

Please sign in to comment.