HomeiOS DevelopmentStopping iPadOS app from with the ability to create a number of...

Stopping iPadOS app from with the ability to create a number of home windows on iPadOS 26


I am constructing a Multiplatform Apple app, and on iPadOS, I am making an attempt to configure the app in order that the customers cannot create a number of home windows for an app, however can nonetheless freely place the app round.

In contrast to macOS, disabling the power to create new home windows within the menu bar does not eliminate the power to create new home windows.

import SwiftUI

@major
struct MyApp: App {
    
    // Run code to routinely stop the app after closing its window on macOS
    #if os(macOS)
    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    #endif
    

    var physique: some Scene {
        WindowGroup {
            ContentView()
        }.instructions {
            // Disguise the brand new window button
            CommandGroup(changing: CommandGroupPlacement.newItem) {
            }
        }
        #if os(macOS)
        Settings {
            MacSettingsView()
        }
        #endif
        

    }
}

On the iPadOS model, nevertheless, customers can nonetheless create new home windows by tapping on the app icon within the dock and choosing the brand new window button within the high left nook (or by dragging the apps icon from the dock like in earlier variations)

Stopping iPadOS app from with the ability to create a number of home windows on iPadOS 26

Utilizing UIRequiresFullScreen (older plist setting used to disable multitasking options) did not work as all it did was make the app go to a fallback design with a protected zone for the window buttons

iPad Window with safe zone above window

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments