herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
139 stars 54 forks source link

Let user select markup type in popup view also on iPhone #376

Open herzbube opened 2 years ago

herzbube commented 2 years ago

When the user wants to select a new type of markup to place on the board, the app currently displays an ItemPickerController. On iPad the resulting view can be displayed in a popover, which is quite nice, but on iPhone the view is displayed similarly to an action sheet, which blocks the view of the entire board.

To add a nice graphical touch the markup type selection should be possible in a popup on iPhone devices as well. Popup meaning here, something similar to an iPad popover. Ideally the solution that is developed should be reusable, at least to some extent, to lay the foundation for a tutorial or help mode.

One problem that still is not solved is: How can user code determine the UIButton that iOS creates to represent a UIBarButtonItem? Popovers on iPad support specifying either a source UIView (useful when the UIButton is known), or a source UIBarButtonItem for the popover. If a UIBarButtonItem is specified then iOS "magically" detects the button that is the source view. So far I have not found an API in UIKit that lets my user code perform the same detection.

herzbube commented 2 years ago

Some general ideas:

Specifically for the markup type: