Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Crash using NSMutableAttributedString with an HMTL document inside a collection view - iOS 18, XCode 16
We're attempting to upgrade to XCode 16 but are encountering a consistent crash when doing so. The actual exception message comes from the UICollectionView, with this message and stack trace. *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Dequeued view: <Redacted: 0x17831f080; baseClass = UICollectionViewCell; frame = (16 923.667; 408 450); layer = <CALayer: 0x6000004ad680>>; Collection view: <UICollectionView: 0x10ca67000; frame = (0 0; 440 809.667); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000d41e60>; backgroundColor = <UIDynamicProviderColor: 0x600000285640; provider = <__NSMallocBlock__: 0x600000c7aac0>>; layer = <CALayer: 0x600000322400>; contentOffset: {0, 139.66666666666666}; contentSize: {440, 3247.625}; adjustedContentInset: {0, 0, 34, 0}; layout: <UICollectionViewCompositionalLayout: 0x15a8732a0>; dataSource: <_TtGC5UIKit34UICollectionViewDiffableDataSourceOC8Redacted_: 0x60000000ead0>>' *** First throw call stack: ( 0 CoreFoundation 0x00000001804b910c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x0000000180092da8 objc_exception_throw + 72 2 Foundation 0x0000000180e67c70 _userInfoForFileAndLine + 0 3 UIKitCore 0x00000001852348a4 __43-[UICollectionView _updateVisibleCellsNow:]_block_invoke.445 + 136 4 UIKitCore 0x0000000185b2a42c -[_UICollectionViewSubviewManager removeAllDequeuedViewsWithEnumerator:] + 188 5 UIKitCore 0x000000018523436c -[UICollectionView _updateVisibleCellsNow:] + 4000 6 UIKitCore 0x0000000185234288 -[UICollectionView _updateVisibleCellsNow:] + 3772 7 UIKitCore 0x0000000185239174 -[UICollectionView layoutSubviews] + 284 8 UIKitCore 0x00000001860a3418 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2404 9 QuartzCore 0x000000018b335624 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 432 10 QuartzCore 0x000000018b3403f8 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 124 11 QuartzCore 0x000000018b272430 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 464 12 QuartzCore 0x000000018b2a0c70 _ZN2CA11Transaction6commitEv + 652 13 QuartzCore 0x000000018b2a21c4 _ZN2CA11Transaction25flush_as_runloop_observerEb + 68 14 UIKitCore 0x0000000185b302fc _UIApplicationFlushCATransaction + 48 15 UIKitCore 0x0000000185a60eb4 __setupUpdateSequence_block_invoke_2 + 352 16 UIKitCore 0x00000001850a5cec _UIUpdateSequenceRun + 76 17 UIKitCore 0x0000000185a60858 schedulerStepScheduledMainSection + 168 18 UIKitCore 0x0000000185a5fc90 runloopSourceCallback + 80 19 CoreFoundation 0x000000018041d294 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 20 CoreFoundation 0x000000018041d1dc __CFRunLoopDoSource0 + 172 21 CoreFoundation 0x000000018041c99c __CFRunLoopDoSources0 + 324 22 CoreFoundation 0x0000000180416e84 __CFRunLoopRun + 788 23 CoreFoundation 0x00000001804166f4 CFRunLoopRunSpecific + 552 24 UIFoundation 0x0000000184c5c0c0 -[NSHTMLReader _loadUsingWebKit] + 1416 25 UIFoundation 0x0000000184c5cbe8 -[NSHTMLReader attributedString] + 20 26 UIFoundation 0x0000000184bdc3c8 _NSReadAttributedStringFromURLOrDataCommon + 2760 27 UIFoundation 0x0000000184bd82d4 _NSReadAttributedStringFromURLOrData + 180 28 UIFoundation 0x0000000184bd81b8 -[NSAttributedString(NSAttributedStringUIFoundationAdditions) initWithData:options:documentAttributes:error:] + 144 29 Redacted.debug.dylib 0x000000010f53b6d0 $sSo25NSMutableAttributedStringC4data7options18documentAttributesAB10Foundation4DataV_SDySo012NSAttributedC24DocumentReadingOptionKeyaypGSAySo12NSDictionaryCSgGSgtKcfcTO + 204 30 Redacted.debug.dylib 0x000000010f53a984 $sSo25NSMutableAttributedStringC4data7options18documentAttributesAB10Foundation4DataV_SDySo012NSAttributedC24DocumentReadingOptionKeyaypGSAySo12NSDictionaryCSgGSgtKcfC + 76 31 Redacted.debug.dylib 0x000000010f53a860 $sSS8RedactedE20htmlAttributedStringSo09NSMutablecD0CSgyF + 572 32 Redacted.debug.dylib 0x000000010fbddf54 $s8Redacted + 132 33 Redacted.debug.dylib 0x000000010fbde71c $s8Redacted + 196 34 Redacted.dylib 0x000000010f75b1d0 $s8Redacted + 544 35 Redacted.dylib 0x000000010f2ca174 $s8Redacted + 2052 36 Redacted.debug.dylib 0x000000010e7e6884 $s8Redacted 37 Redacted.debug.dylib 0x000000010e7de9f0 $s8Redacted + 2376 38 Redacted.debug.dylib 0x000000010f336820 $s8Redacted 39 UIKitCore 0x0000000184f0c3e8 block_destroy_helper.22 + 18032 40 UIKitCore 0x0000000184f109a4 block_destroy_helper + 11080 41 UIKitCore 0x0000000184f0e810 block_destroy_helper + 2484 42 UIKitCore 0x00000001851aa8f0 -[__UIDiffableDataSource collectionView:cellForItemAtIndexPath:] + 136 libc++abi: terminating due to uncaught exception of type NSException The collection view cell being dequed contains a string that is created from HTML content with NSMutableAttributedString This line is where execution stop data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil ) This code has worked fine for years but now inexplicably is crashing. I've seen various similiar posts related to iOS 18 but none with a resolution
Topic: UI Frameworks SubTopic: UIKit Tags:
3
2
922
Jan ’25
Displaying a toast on successful operation in CarPlay
Hello, Please guide me if there is a way to show a simple toast to a user that the action has been performed. When a user taps on a button, an api returns a status based on which I need to show appropriate message as a toast. Is this possible in CarPlay? If not, why? Please suggest any alternative for this. Awaiting your response Thanks a lot!!
1
0
478
Jan ’25
Unrealistically high snowfall amounts being reported by WeatherKit
I filed FB16332997 about the VERY high snowfall estimates I'm seeing in WeatherKit and iOS Weather. I initially thought something was wrong with my weather app but I verified the numbers with the iOS Weather app and another third party weather app. For Atlanta last week it was saying 7.5" when it ended up being 2" (which I can live with). Two days ago it reported there could be 16" of snow in northern Florida. That's impossible! This morning it was reporting that Niceville could have 6-7" of snow, which would be significantly more than highest amount in recorded history for Florida (where snow is extremely rare). It almost makes me wonder if the liquid precipitation value is actually the snowfall amount in reality. And then that is incorrectly being converted to the snowfall amount.
2
0
465
Jan ’25
https://developer.apple.com/documentation/swiftui/tab/init(value:content:label:)
As per the documentation link, the Tab initializer in SwiftUI should allow supplying a custom view to the Label. However, the colors used within the Label view are not being honored as expected. I attempted to set custom colors in the Label, but they either default to system-defined styles or are ignored entirely. This behavior does not align with my understanding of how custom views should work in SwiftUI's Label. Am I missing a step or configuration here, or is this a bug in the current implementation? struct ContentView: View { @State private var activeTab: TabItem = .homeTab var body: some View { TabView(selection: $activeTab) { ForEach(TabItem.allCases) { tabItem in Tab(value: tabItem) { getView(for: tabItem) } label: { VStack(spacing: 0) { MainTabButtonView( selected: activeTab == tabItem, tabItem: tabItem ) Text(tabItem.title) } } } } } } private extension ContentView { @ViewBuilder func getView(for tabItem: TabItem) -> some View { switch tabItem { case .homeTab: Text("Home") case .searchTab: Text("Search") case .profileTab: Text("Profile") case .moreTab: Text("More") } } } #Preview { ContentView() } enum TabItem: String, Identifiable, Hashable, CaseIterable { case homeTab case searchTab case profileTab case moreTab var tabImage: String { switch self { case .homeTab: "house" case .searchTab: "magnifying-glass" case .profileTab: "biographic" case .moreTab: "hamburger-menu" } } var title: String { switch self { case .homeTab: "Home" case .searchTab: "Search" case .profileTab: "Profile" case .moreTab: "More" } } var id: String { rawValue } } struct MainTabButtonView: View { private let selected: Bool private let tabItem: TabItem init( selected: Bool, tabItem: TabItem ) { self.selected = selected self.tabItem = tabItem } var body: some View { Image(tabItem.tabImage) .renderingMode(.template) .resizable() .aspectRatio(contentMode: .fill) .frame(width: 30, height: 30) .foregroundStyle( selected ? Color.green : Color.orange ) } } Expected Behavior: The custom colors applied within the Label should render as defined. Actual Behavior: The colors are overridden or ignored, defaulting to the system-defined styles. Environment: Xcode Version: Xcode 16.2 iOS: 18.2 Swift Version: Swift 6
2
0
350
Jan ’25
Do not have permission to open the file
In macOS, I am encountering an issue where the system API fails to grant permission to open a file despite enabling the necessary Read/Write permissions within the SandBox. Could you please elucidate the reasons behind this behavior? Thanks! func finderOpenFileSystem(at path: String) { let fileURL = URL(fileURLWithPath: path) guard FileManager.default.fileExists(atPath: path) else { print("Error: File does not exist at path: \(path)") return } let success = NSWorkspace.shared.open(fileURL) if success { print("File opened successfully: \(fileURL)") } else { print("Error: Failed to open file: \(fileURL)") } }
1
0
492
Jan ’25
Problem with connecting the workout data to a SwiftUI View.
Hello. I am building an app that shows my walk workouts and in the detail view I want to show the route I took while walking, similar to that of the Apple Fitness App. There is a problem though, I cannot seem to understand how to connect the @State property workoutLocations array that would be used to draw the route on the map with what I get from the query. The task does successfully fetches the data but then when I try to use it later in a do-catch block nothing happens. What am I missing here? import SwiftUI import MapKit import HealthKit struct DetailView: View { @Environment(HealthKitManager.self) var healthKitManager let workout: HKWorkout @State private var workoutLocations: [CLLocation] = [] var body: some View { ScrollView { //... } .task { guard let store = self.healthKitManager.healthStore else { fatalError("healthStore is nil. App is in invalid state.") } let walkingObjectQuery = HKQuery.predicateForObjects(from: workout) let routeQuery = HKAnchoredObjectQueryDescriptor(predicates: [.workoutRoute(walkingObjectQuery)], anchor: nil) let queryResults = routeQuery.results(for: store) let task = Task { var workoutRouteLocations: [CLLocation] = [] for try await result in queryResults { let routeSamples = result.addedSamples for routeSample in routeSamples { let routeQueryDescriptor = HKWorkoutRouteQueryDescriptor(routeSample) let locations = routeQueryDescriptor.results(for: store) for try await location in locations { workoutRouteLocations.append(location) print(workoutRouteLocations.count) // this prints out the number of locations in the sample. } } } return workoutRouteLocations } do { print(try await task.value.count) // this prints nothing. Therefore if I try to update workoutLocations array from here it would do nothing as well // workoutLocations = try await task.value therefore does nothing and the array just doesn't get populated with the results of the task } catch { print(error) } } } }
2
0
834
Jan ’25
Monitoring of the paste(GUI based) operation
I am working on the EndPoint DLP solution project. So I want to monitor the paste operation peformed by the user. So when he uses the keyboard keys then I can monitor them using the event callback. But if user uses the GUI for pasting the data then how can I monitor that ?
Topic: UI Frameworks SubTopic: General
0
0
226
Jan ’25
How do I pass a binding to a focus state?
In a SwiftUI lab, I was asking about setting the focus state down a view hierarchy. The answer I got was to pass the focus state down the views as a binding. Conceptually, that made sense, so I moved on to other questions. But now that I am trying to implement it, I am having problems. In the parent view, I have something like this: @FocusState private var focusElement: UUID? Then I am setting a property like this in the child view: @Binding var focusedId: UUID? When I try to create the detail view, I'm trying this: DetailView(focusedId: $focusElement) But this doesn't work. The error I get is: Cannot convert value of type 'FocusState<UUID?>.Binding' to expected argument type 'Binding<UUID?>' What is the right way to pass down the focus state to a child view so that it can update back up to the parent view? I am trying to update from one child view, and have a TextField in a sibling view get focus.
2
0
13k
Jan ’25
Unwanted "More" button in tabView when selected tab is in 5th position and beyond
Hello SwiftUI devs, I would like to remove the "More" button that appears in the top left of the screen whenever the selected tab of a tab view is in 5th position and beyond. It ruins the layout. struct ContentView: View { private let tabs = (1...10).map { "\($0)" } @State private var selectedTab: String = "5" var body: some View { TabView(selection: $selectedTab) { ForEach(tabs, id: \.self) { tab in Text("Tab \(tab)") .tabItem { Label("Tab \(tab)", systemImage: "star") } .toolbar(.hidden, for: .tabBar) } } } } At first glance, one easy fix would be to rearrange the tabs list in the ForEach loop, putting the selected tab at the first position. This does the trick BUT we lose the states of the views, which is out of the question in my use-case. Getting rid of the tab view and handling the logic with a simple Switch paired with a state restoration mechanism using SceneStorage or SwiftData is probably possible but sounds like a white elephant compared to finding a solution to remove that "More" button. Thank you
1
1
606
Jan ’25
How to remove margins around built-in views?
I want to have my own background and foreground colors for some views and I am having a bit of trouble. I cannot figure out how to remove the margins around some built-in views. One example is below. The ScrollView portion is always black or white, depending on whether I am I dark mode or not. I've added various colors and borders to see what is going on below. I've also tried adding the modifiers to the Scroll View rather than the TextEditor and it doesn't work at all. If I don't have the .frame modifier on the ScrollView, the TextEditor moves to the top of its frame for some reason. I've played with .contentMargins, .edgeInsets, etc. with no luck How do I get the TextEditor to fill the entire ScrollView without the margin? Thanks! import SwiftUI struct TextEditorView: View { @Binding var editString: String var numberOfLines: Int var lineHeight: CGFloat { UIFont.preferredFont(forTextStyle: .body).lineHeight } var viewHeight: CGFloat { lineHeight * CGFloat(numberOfLines) + 8 } var body: some View { ScrollView([.vertical], showsIndicators: true) { TextEditor(text: $editString) .border(Color.red, width: 5) .foregroundStyle(.yellow) .background(.blue) .frame(minHeight:viewHeight, maxHeight: viewHeight) .scrollContentBackground(.hidden) } .frame(minHeight:viewHeight, maxHeight: viewHeight) } }
0
0
198
Jan ’25
MVVM design and data dependency
According to the MVVM design pattern, one of my views depends on many properties in my model. Can I use logic like @published var model = MyModel()? Will there be a large performance loss? Will the UI be refreshed when other unrelated properties in the model are modified? What is the best practice in this case?
Topic: UI Frameworks SubTopic: General
0
0
248
Jan ’25
Struggling to display DeviceActivityReport view in a widget
I want to add a widget to my app that will display the # of pickups the user has for the day. I have the DeviceActivityReport working in the main app but can't get it to display in the widget since it is not a supported view for widgets. Is there any workaround for getting this view to the widget? I tried converting the DeviceActivityReport view to a UI image thinking maybe that would be a way to use a widget approved view type but ImageRenderer seems to fail to render an image for the view (which is just a Text view). To summarize my questions: Is it possible to display a DeviceActivityReport in a widget? If so, what is the best practice? Is converting the DeviceActivityReport view into an image and displaying that in a widget an option? Here's my attempt to convert the DeviceActivityReport view into a UIImage: import SwiftUI import _DeviceActivity_SwiftUI struct PickupsDeviceActivityReport: View {     @State private var context: DeviceActivityReport.Context = .totalActivity     @State private var renderedImage = Image(systemName: "exclamationmark.triangle")     @Environment(\.displayScale) var displayScale     var body: some View {         renderedImage             .onAppear { render() }             .onChange(of: context) {                 _ in render()             }     }     @MainActor func render() {         let renderer = ImageRenderer(content: DeviceActivityReport(context))         renderer.scale = displayScale         if let uiImage = renderer.uiImage {             renderedImage = Image(uiImage: uiImage)         }     } } Help is appreciated. Thank you.
3
3
1.4k
Jan ’25
Opening recent files from Dock with MacCatalyst app
We are developing an MacOS app from our iOS app using MacCatalyst. If I press long on the app icon on the Dock, a list of recent files appears. If I tap one one of these files nothing happens. I would expect the scene delegate function: func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) would be called but it is not. Can somebody maybe explain what I am missing here? The list of recent files also appears in the Menu under File > Open recent files. There I can tap on a file and it it is opened correctly using the scene delegate method mentioned above. The files can also be opened with the app using the Finder, so the associated file types with the app are correct.
0
0
310
Jan ’25
How to detect if picture-in-picture is hidden at the edge of the device
0 I am developing a custom Picture in Picture (PiP) app that plays videos. The video continues to play even when the app goes to the background, but I would like to be able to get the bool value when the PiP is hidden on the edge, as shown in the attached image. The reason why we need this is because we don't want the user to consume extra network bandwidth, so we want to pause the video when the PiP is hidden on the edge of the screen. Please let me know if this is possible. This can be done in the foreground or in the background.
1
1
271
Jan ’25
SwiftUI scrollTo function stops working if I also use onScrollVisibilityChange
If I use scrollTo on its own, it works fine (actually not fine, it often scrolls to the wrong place with LazyVStack, but thats another topic) However, if I also want to use onScrollVisibilityChange on one of my items in my ForEach and if I do, it just stops working. Everything still fires, but nothing scrolls. This is on the latest macOS, and iOS. WHY? How can I fix this? You can find more details at https://stackoverflow.com/questions/79391208/swiftui-scrollto-function-stops-working-if-i-also-use-onscrollvisibilitychange
Topic: UI Frameworks SubTopic: SwiftUI
1
0
251
Jan ’25
-[CPListItem handler] timeout?
Hi all! Based on documentation: https://developer.apple.com/documentation/carplay/cplistitem/handler If you need to perform asynchronous tasks, dispatch them to a background queue and call the completion closure or completionBlock when they complete. In a normal case, it works perfectly. But, if it takes "too much", for example, 10 seconds (streaming with retries, app business logic), when I call the "completionBlock" inside "handler" doesn't do anything. Exists a timeout in "completionBlock"? Thanks!
2
0
444
Jan ’25
UIDocumentBrowserViewController - adjust order and color of navigation bar items
I'm using UIDocumentBrowserViewController. This view controller automatically creates a TabView with navigation titles and up to two trailing navigation bar items. To visualize this, open the Files app by Apple on an iPhone. I want to do the following: Add a third button and place it farthest on the trailing side. Keep all three buttons blue (the default color), but adjust the color of the navigation title to use the primary text color (it is also currently blue, by default) Button Order If my button is represented by C, then the order from left-to-right or leading-to-trailing should be A B C. I tried to add it by using additionaltrailingnavigationbarbuttonitems: class DocumentBrowserViewController: UIDocumentBrowserViewController, UIDocumentBrowserViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() let button = UIBarButtonItem(...) additionalTrailingNavigationBarButtonItems.append(button) } } This always adds it as the leftmost trailing item. The order when the view loads is C A B, where C represents my button. Here are some things I've tried: Add it in viewWillAppear - same results. Add it in viewDidAppear - same results. Add it using rightBarButtonItems - does not show up at all. insert it at: 0 instead of appending it - same results. Add it with a delay using DispatchQueue.main.async - same results. After some experimentation, I realized that the arrays referenced by additionalTrailingNavigationBarButtons and rightBarButtonItems seem to be empty, other than my own button. This is the case even if the DispatchQueue delay is so long that the view has already rendered and the two default buttons are clearly visible. So I'm not sure how to place my button relative to these, since I can't figure out where they actually are in the view controller's properties. How do I put my button farther to the trailing/right side of these two default buttons? Title Color The navigation titles created by UIDocumentBrowserViewController are blue when not in their inline format. I want them to use the primary text color instead. In viewDidLoad, I could do something like this: UINavigationBar.appearance().tintColor = UIColor.label This will change the title color to white or black, but it will also change the color of the buttons. I've tried various approaches like titleTextAttributes, and none of them seem to work with this view controller. How do I change just the color of the navigation title, and not the color of the navigation bar items?
Topic: UI Frameworks SubTopic: UIKit
0
0
352
Jan ’25
How to remove top space of principal ToolbarItem in sidebarAdaptable TabView
When creating a principal ToolbarItem in a sidebarAdaptable TabView, unwanted space appears at the top. Here's my code: struct ContentView: View { var body: some View { TabView { Tab("Tab", systemImage: "star") { NavigationStack { Text("Hello, World!") .toolbar { ToolbarItem(placement: .principal) { Text("↑ Space") } } .navigationBarTitleDisplayMode(.inline) } } } .tabViewStyle(.sidebarAdaptable) } } I would like to know how to remove this space. Environment: Xcode 16.2.0 iOS 18.2
2
1
327
Jan ’25
Unexpected Insertion of U+2004 (Space) When Using UITextView with Pinyin Input on iOS 18
I encountered an issue with UITextView on iOS 18 where, when typing Pinyin, extra Unicode characters such as U+2004 are inserted unexpectedly. This occurs when using a Chinese input method. Steps to Reproduce: 1. Set up a UITextView with a standard delegate implementation. 2. Use a Pinyin input method to type the character “ㄨ”. 3. Observe that after the character “ㄨ” is typed, extra spaces (U+2004) are inserted automatically between the characters. Code Example: class ViewController: UIViewController { @IBOutlet weak var textView: UITextView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } } extension ViewController: UITextViewDelegate { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { print("shouldChangeTextIn: range \(range)") print("shouldChangeTextIn: replacementText \(text)") return true } func textViewDidChange(_ textView: UITextView) { let currentText = textView.text ?? "" let unicodeValues = currentText.unicodeScalars.map { String(format: "U+%04X", $0.value) }.joined(separator: " ") print("textViewDidChange: textView.text: \(currentText)") print("textViewDidChange: Unicode Scalars: \(unicodeValues)") } } Output: shouldChangeTextIn: range {0, 0} shouldChangeTextIn: replacementText ㄨ textViewDidChange: textView.text: ㄨ textViewDidChange: Unicode Scalars: U+3128 ------------------------ shouldChangeTextIn: range {1, 0} shouldChangeTextIn: replacementText ㄨ textViewDidChange: textView.text: ㄨ ㄨ textViewDidChange: Unicode Scalars: U+3128 U+2004 U+3128 ------------------------ shouldChangeTextIn: range {3, 0} shouldChangeTextIn: replacementText ㄨ textViewDidChange: textView.text: ㄨ ㄨ ㄨ textViewDidChange: Unicode Scalars: U+3128 U+2004 U+3128 U+2004 U+3128 This issue may affect text processing, especially in cases where precise text manipulation is required, such as calculating ranges in shouldChangeTextIn.
5
0
1.1k
Jan ’25
Monintoring Picture in Picture is hide in Device Edge.
I am developing a custom Picture in Picture (PiP) app that plays videos. The video continues to play even when the app goes to the background, but I would like to be able to get the bool value when the PiP is hidden on the edge, as shown in the attached image. The reason why we need this is because we don't want the user to consume extra network bandwidth, so we want to pause the video when the PiP is hidden on the edge of the screen. Please let me know if this is possible. This can be done in the foreground or in the background.
1
0
345
Jan ’25