title: How to manually change the selected UIAction inside UIMenu?
body: <p><strong>The Goal:</strong>
  Trying to create a filter selection screen (in a card view) that has UIButtons with UIMenu items attached them.
  When i select any of the filters, and click on the apply filters button, i dismiss the filter view controller and go back to the collection view screen to refresh the data with the filters that were selected.</p>
  <p><strong>The Issue:</strong>
  With the filters already selected, when i want to go back again to change any filters i click on the filters button to open the filters viewcontroller, but obviously none of the UIMenu selections are preserved, as they are reset to the default first index setting.</p>
  <p><strong>How To Solve?:</strong>
  When pass my data back from filterVC to the main list screen, i pass the title of the selected UIMenu. I was thinking that i could pass this back into the filterVC and default the menus to the passed in data, (ie. could search for the title and make it the selected UIAction in the UIMenu), however i cant seem to find a way to manually select which UIAction should be the selected state of the UIMenu!</p>
  <pre><code>    var spaceTypeMenu: UIMenu {
      return UIMenu(title: &quot;Space Type&quot;, image: nil, identifier: nil, options: [], children: spaceTypeMenuItems)
  }
  
      private var spaceTypeMenuItems: [UIAction] {
      return [
          UIAction(title: &quot;All&quot;, handler: { (_) in }),
          UIAction(title: &quot;Meeting Room&quot;, handler: { (_) in }),
          UIAction(title: &quot;Desk&quot;, handler: { (_) in }),
          UIAction(title: &quot;Boardroom&quot;, handler: { (_) in })
      ]
  }
  </code></pre>
  <p>Then the following is Called from viewdidload()</p>
  <pre><code>func createSpaceTypeMenu() {
      spaceTypeButton?.menu = spaceTypeMenu
      spaceTypeButton?.showsMenuAsPrimaryAction = true
  }
  </code></pre>
  <p>After the filters have been selected i pass them back to the previous VC:</p>
  <pre><code>@IBAction func applyFiltersButtonPressed(_ sender: UIButton) {
      self.dismiss(animated: true) {
          let filter = Filters(site: self.siteButton?.titleLabel?.text,
                               spaceType: self.spaceTypeButton?.titleLabel?.text,
                               date: self.datePickerView.datePickerView?.date,
                               duration: self.selectedDuration)
          self.applyFiltersCallback?(filter)
      }
  }
  </code></pre>
  <p>Site, Spacetype, duration are all UIbuttons with a UIMenu for the filter options which are just hardcoded for now as above.</p>
  <p>What i want to happen is that if i selected &quot;Desks&quot; before applyFiltersButtonPressed() was called to dismiss the VC, when i come back to this FiltersVC i want &quot;Desks&quot; to still be selected as the text in the UIbutton and also want the tick to be next to &quot;Desks&quot; and dont want the Menu items to default back to the first option which was &quot;All&quot;.</p>
  <p>Hope that makes sense?</p>