Skip to content

Commit

Permalink
Revert workaround for iOS 18 beta 5 SwiftUI crash (#4173)
Browse files Browse the repository at this point in the history
The issue has been fixed in iOS 18.1 beta 2 / iOS 18 beta 6.

Original PR: #4154
  • Loading branch information
MarkVillacampa authored Aug 12, 2024
1 parent 52022a4 commit 8cf0e98
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions RevenueCatUI/Modifiers/ViewExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ extension View {

}

private var isIOSVersionWithCrash: Bool = {
// There is a bug in iOS 18 beta 5 (as of writing, future versions unconfirmed) that causes a crash.
// This has been reported to Apple as FB14699941.
// Until this is fixed, we're rolling back to pre-iOS 16 behavior for this view.
// More information and discussion here: https://github.com/RevenueCat/purchases-ios/issues/4150
let iOSVersionWithCrash = OperatingSystemVersion(majorVersion: 18, minorVersion: 0, patchVersion: 0)
return ProcessInfo.processInfo.isOperatingSystemAtLeast(iOSVersionWithCrash)
}()

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
extension View {

Expand Down Expand Up @@ -97,7 +88,7 @@ extension View {
// @PublicForExternalTesting
func scrollableIfNecessary(_ axis: Axis = .vertical, enabled: Bool = true) -> some View {
if enabled {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *), !isIOSVersionWithCrash {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
ViewThatFits(in: axis.scrollViewAxis) {
self

Expand All @@ -118,7 +109,7 @@ extension View {
@ViewBuilder
func scrollableIfNecessaryWhenAvailable(_ axis: Axis = .vertical, enabled: Bool = true) -> some View {
if enabled {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *), !isIOSVersionWithCrash {
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *) {
ViewThatFits(in: axis.scrollViewAxis) {
self

Expand Down

0 comments on commit 8cf0e98

Please sign in to comment.