Question: I have an array as such:

```
$d = [
    0 => [
        0 => 'lorem',
        1 => 'dorem',
        3 => '',
        4 => 'ipsum'
    ],
    1 => [
        0 => 'test',
        1 => 'rere',
        3 => '',
        4 => 'youp'
    ]
];

```

My issue is that I need to remove empty values from the array. How would I go about using `array_filter` in removing such empty keys/values from the multidimensional array? I have over 162 sets of arrays totaling 62 each, so this problem is via a large data set.

Answer: 
For some reason on iOS 13 specifically on the iPad in compact traitCollections the call to the delegate to see if it should collapse is happening BEFORE viewDidLoad is called on the UISplitViewController and so when it makes that call, your delegate is not set, and the method never gets called.

If you're creating your splitViewController programmatically this is an easy fix, but if you're using Storyboards not so much. You can work around this by setting your delegate in awakeFromNib() instead of viewDidLoad()

Using your example from the original post, a sample of code would be as follows

```
class SplitViewController: UISplitViewController, UISplitViewControllerDelegate {
    override func awakeFromNib() {
        super.awakeFromNib()
        delegate = self
        preferredDisplayMode = .allVisible
    }

    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController) -> Bool {
        return true
    }
}

```

You'll also want to make sure whatever logic you're using in the collapseSecondary function isn't referencing variables that aren't yet populated since viewDidLoad hasn't been called yet.
```
override func awakeFromNib() {
      super.awakeFromNib()
      splitViewController?.delegate = self
      splitViewController?.preferredDisplayMode = .allVisible
}

//MARK: Split View Controller Delegate
    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
        print("splitview collapse method")
        return false
    }

```

Method is called at launch in Xcode 12.4 on Simulator iPhone, if you set: Storyboard -> Split View Controller -> Style -> Unspecified (Discouraged) not Double Column