Hi. This looks like a really good tutorial app. From the starter, it doesn’t have the File.swift and Content.swift yet. Do I leave the codegen for both at ‘Class Definition’ and do the ‘Create NSManaged Object subclass …’? I’m not really experienced with Core Data.
Hi Warren, I suggest putting the sub-splitview on the left instead of the right. Much simpler because requires no need to manually manage collapse or separate. Just need to override traits of the child split in the parent split and forward a few things through the child. I could do a tutorial on it?
That’s not an approach I considered taking when constructing the tutorial. It sounds really interesting if it eliminates the need the pile of delegate code required to reconstruct/deconstruct the navigation stacks during trait change.
Im guessing you mean place the folder list (and file list in sub-secondary) in their own split and place that in the primary while the placeholder/editor remains within the main secondary.
I love it when people come up with new ideas for things. Thanks for the suggestion. Id like to see the result if you ever write the tutorial.
Good evening,
I used this tutorial to attempt to make a triple split view (kinda like apple mail) and ran into an issue when adding a UISearchController to the middle view.
everything loads fine and works on all size devices but when you rotate the device the application crashes. The following is output
2019-02-25 18:26:49.304360-0500 MYAPP[16234:1038669] *** Assertion failure in -[UITableView _addScrollViewScrollObserver:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3698.93.8/UIScrollView.m:9243
2019-02-25 18:26:49.319306-0500 MYAPP[16234:1038669] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘ERROR: UIScrollView does not support multiple observers implementing _scrollViewWillEndDraggingWithVelocity:targetContentOffset:’
I am also using a different view for each section not reusing one like the guide.
Not sure how to solve this.
Any help would be great.
Thanks
Thanks for the question. What do you mean you are using a different view for each section. You mean you are not recycling views when the traits change from compact to regular?
Do you get the crash when you add the UISearchController or on a rotate event ?
Warren,
I am using three different view controllers for the three sections instead of reusing one (FileList) like the guide does.
The UISearchController is on the middle viewcontroller and works correctly in any orientation as long as it was loaded in that orientation. As soon as you rotate it crashes with the error from above. If you have not yet navigated to the middle viewcontroller rotation works fine. If you navigate to the third view and rotate it still crashes. Navigating from view 1 to 2 and back to 1 rotating still works.
It feels like if the second view is still in the navigation stack it cannot rotate correctly.
I would examine your lifecycles around viewDidAppear or traitCollectionDidChange to see if you’re getting a double installation of the search controller somewhere.
Possibly also try and isolate the issue to see if it’s related to the split setup or something else.
Possibly tagging the relevant deinit method might shed some light on whether you have a retain loop somewhere too.
I have seen this issue before ( not in the tutorial project ) when working with UISearchController . It wasn’t easy to eradicate.
This tutorials is really very helpful. I have done same thing that you did but I am not able to do multiple splitvc. because this code is to complex for me. can you have simple demo of multiple splitvc ? so I can understand like click on cell it add new ViewController ? Thank You … Sir
Hey, it’s working awesome in Xcode 11. I have a quick question. It’s medatory to add UISplitViewController to UIViewController For Multiple SplitViewController .?
Thanks for trying the tutorial. I can’t do special projects as these projects take a long time to create.
If I understand your second post correctly you are asking if its mandatory to add the sub UISplitViewController to a container UIViewController to have multiple splits. I don’t think so. A split view is a collection of UIViewController and a UISplitViewController is-a UIViewController.