Post

Replies

Boosts

Views

Activity

Reply to SwiftUI 4: Set list background color
FYI: We found a way using Introspect (not sure if in any way legal). However, as Apple Engineers noted, we should not rely on implementation details of a framework. Unfortunately, we are now in the stupid situation of having done exactly that in the past and now having to find a workaround. Otherwise our app looks extremely broken... extension View {     @warn_unqualified_access     @ViewBuilder     func listBackgroundColor(_ color: Color) -> some View {         introspectViewController { inspectSubView($0.view, backgroundColor: .init(color)) }     }     // MARK: Helper     private func inspectSubView(_ view: UIView, backgroundColor: UIColor) {         for subview in view.subviews {             if NSStringFromClass(type(of: subview)).contains("UICollectionViewListLayoutSectionBackgroundColorDecorationView") {                 subview.backgroundColor = backgroundColor                 return             }             inspectSubView(subview, backgroundColor: backgroundColor)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to Can't change List background color in iOS 16
I think Vlad wants to change the whole background not of some cells. We found a way using Introspect. However, we are not sure if this is in any way "legal". extension View {     @warn_unqualified_access     @ViewBuilder     func listBackgroundColor(_ color: Color) -> some View {         introspectViewController { inspectSubView($0.view, backgroundColor: .init(color)) }     }     // MARK: Helper     private func inspectSubView(_ view: UIView, backgroundColor: UIColor) {         for subview in view.subviews {             if NSStringFromClass(type(of: subview)).contains("UICollectionViewListLayoutSectionBackgroundColorDecorationView") {                 subview.backgroundColor = backgroundColor                 return             }             inspectSubView(subview, backgroundColor: backgroundColor)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to SwiftUI 4: Set list background color
Found this note in the lounge: In general, you should not rely on implementation details of a framework (including SwiftUI) to achieve specific behaviors in your apps. The release notes did call out the change in implementation of List since we were aware of developers using UIKit methods to style their Lists in the past. This is a known limitation, but we realize this is a popular request, so rest assured we have noted the feedback here and in the SwiftUI lounge! Hmm.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to SwiftUI NavigationLink not working when I add @Environment(\.dismiss) to my view
I am running into the same issue with iOS 17 and switch from NavigationView to NavigationStack. We are not using NavigationLink but navigationDestination(isPresented:) , but the issue is the same.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to @Environment(\.dismiss) var dismiss - Infinite loop bug.
For me, this issue is present since iOS 17, everything was fine till then. Did Anyone find a solution or workaround?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to SwiftUI Previews in Xcode 14 failed to run with SettingsError: noExecutablePath(IDESwiftPackageStaticLibraryProductBuildable)
Linking against a .dynamic type library may fix the problem, but this is no guarantee. If looking a MSAL, it is defined without a type and thus should work if you trust the statements of some post here. But it does not :(.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Archive with xcodebuild / Xcode 14 and manual signing not possible
FYI: FB11402077
Replies
Boosts
Views
Activity
Aug ’22
Reply to Archive with xcodebuild / Xcode 14 and manual signing not possible
Note: Without signing, everything works as expected. Unfortunately. But that's not what we need.
Replies
Boosts
Views
Activity
Aug ’22
Reply to Xcode 14 resources bundle "CODE_SIGNING_ALLOWED" being set to YES
We are facing the same issue. Where do we set CODE_SIGNING_ALLOWED for packages and not the whole app?
Replies
Boosts
Views
Activity
Aug ’22
Reply to SwiftUI 4: Set list background color
https://developer.apple.com/documentation/swiftui/view/scrollcontentbackground(_:)-8wrn2?changes=latest_beta
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to SwiftUI 4: Set list background color
The approach presented above does not work reliably as the UICollectionViewListLayoutSectionBackgroundColorDecorationView will be re-rendered regardless and independently of the section content. Then the view modification will not be applied.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to SwiftUI 4 List customization
FYI: FB10225556 is my radar regarding this issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to SwiftUI 4 List customization
It is a real pity. With the (understandable) departure of UITableView, an extremely large number of hacks that were in active use to use SwiftUI for productive apps break.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to List Background
With SwiftUI Apple switch from UITableView to a custom implemtation based on UICollectionView. Thus all known workaround do not work anymore. Please file a Radar.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to SwiftUI 4: Set list background color
FYI: We found a way using Introspect (not sure if in any way legal). However, as Apple Engineers noted, we should not rely on implementation details of a framework. Unfortunately, we are now in the stupid situation of having done exactly that in the past and now having to find a workaround. Otherwise our app looks extremely broken... extension View {     @warn_unqualified_access     @ViewBuilder     func listBackgroundColor(_ color: Color) -> some View {         introspectViewController { inspectSubView($0.view, backgroundColor: .init(color)) }     }     // MARK: Helper     private func inspectSubView(_ view: UIView, backgroundColor: UIColor) {         for subview in view.subviews {             if NSStringFromClass(type(of: subview)).contains("UICollectionViewListLayoutSectionBackgroundColorDecorationView") {                 subview.backgroundColor = backgroundColor                 return             }             inspectSubView(subview, backgroundColor: backgroundColor)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Can't change List background color in iOS 16
I think Vlad wants to change the whole background not of some cells. We found a way using Introspect. However, we are not sure if this is in any way "legal". extension View {     @warn_unqualified_access     @ViewBuilder     func listBackgroundColor(_ color: Color) -> some View {         introspectViewController { inspectSubView($0.view, backgroundColor: .init(color)) }     }     // MARK: Helper     private func inspectSubView(_ view: UIView, backgroundColor: UIColor) {         for subview in view.subviews {             if NSStringFromClass(type(of: subview)).contains("UICollectionViewListLayoutSectionBackgroundColorDecorationView") {                 subview.backgroundColor = backgroundColor                 return             }             inspectSubView(subview, backgroundColor: backgroundColor)         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to SwiftUI 4: Set list background color
Found this note in the lounge: In general, you should not rely on implementation details of a framework (including SwiftUI) to achieve specific behaviors in your apps. The release notes did call out the change in implementation of List since we were aware of developers using UIKit methods to style their Lists in the past. This is a known limitation, but we realize this is a popular request, so rest assured we have noted the feedback here and in the SwiftUI lounge! Hmm.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Enum cases with associated values cannot be marked potentially unavailable
Having the same issue with CocoaMQTT. https://github.com/emqx/CocoaMQTT/blob/8be5c863b1f6adca4ce2212085d7473aa9e599f9/Source/CocoaMQTTTypes.swift#L66 Any update on this issue?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21