NavigationSplitView not fully supported on smaller (SE) iPhones

My SwiftUI code runs fine on macOS, iOS(iPad) and larger iPhones, but will not display the detail view on smaller iPhones.

  1. Is there a way to force the smaller iPhones to display the detail view?

And if not,

  1. When I put the App on the Apple store, for sale, will the Apple store be smart enough to flag the App as not appropriate for smaller iPhones, such as the SE (2nd and 3rd gen.) and prevent downloads?

Thanks in advance for any guidance.

There shouldn't be a reason why the code runs differently on a smaller iPhone, so I think it'd be useful to see some code here.

Can you try reducing the problem to a very simple SwiftUI app, where the NavigationSplitView and its sidebar and details views all fit into the ContentView file, hopefully not more than 20-30 lines of code?

If you can, post your code here and we can trying looking into what's gone wrong.

(Also, it'd be be helpful to know whether you're using the device in portrait or landscape orientations, because that does have some impact on whether the device dimensions are reported as "compact" or "regular".)

Can every function of your app be accessed on the smaller screens? If so, then there shouldn't be a problem.

It might help if you could give us a few screenshots to show what you mean.

Please see trivial example of above issue with NavigationSplitView not working on smaller iPhones. Works as expected on iPads and iPhone Pro max, but the detail view does not appear on SE, Xr... and smaller iPhones. Should see a simple parabola on the detail view and the text "This is the sidebar view" in the sidebar. When you run the code, the detail view will appear first on the large iPhones. When you run the code on smaller iPhones, only the sidebar will appear. Thank for taking a look.

//
//  ContentView.swift
//  Trivial plot
//
//  Created on 8/09/23.
//

import SwiftUI
import Charts

let xData = [-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10]
let yData = [100,81,64,49,36,25,16,9,4,1,0,1,4,9,16,25,36,49,64,81,100]

struct ContentView: View {
    var body: some View {
        NavigationSplitView {
            ScrollView {
                Text("This is the sidebar view.")
            } /* End ScrollView */
        } /* End NavigationSplitView */
        
//************************** Detail view here *********************************************
    detail: {
        Chart(0..<xData.count, id: \.self) { index in
                LineMark(
                    x: .value("", xData[index]),
                    y: .value("", yData[index])
                )
            }
            .foregroundStyle(Color(.sRGB, red: 0.999424, green:  0.985554, blue: 0))
            .chartYScale( domain: .automatic(includesZero: false, reversed: false), type: .linear )
            .chartXScale( domain: .automatic(includesZero: false, reversed: false) )
            .chartXAxis { AxisMarks(values: .automatic(desiredCount: 10)) }
        } /* End detail: */
    } /* End of Body: Some View */
} /* End of Struct ContentView */

On smaller phones, NavigationSplitView is collapsed into a stack, showing one view at a time.

https://developer.apple.com/documentation/swiftui/navigationsplitview#Collapsed-split-views

Thank you for the link regarding NavigationSplitViewColumn. Unfortunately, this function is in beta and not available until the release of iOS 17. I may release the App for iPad(iOS) and macOS and re-release for iPhone(iOS) when iOS 17 becomes real.

NavigationSplitView not fully supported on smaller (SE) iPhones
 
 
Q