My question is if when using a search bar and scope buttons you can change the position of the scope buttons? For instance, scope buttons automatically appear below the search bar but I require them to be placed above the search bar, is this doable? Thanks.
Replies
Even though I have never used it, have a look at this property
positionAdjustment(for:)
Parameters
icon
An icon identifier constant.
Return Value
The position adjustment for the icon identified by icon.
Discussion
The offset is used to adjust the position of an icon within the search text field.
Look at example here:
h ttps://stackoverflow.com/questions/36576041/change-uisearchbar-magnify-icon-color-and-position
You could also subclass ; do not try to access undocumented properties (see here h ttps://www.reddit.com/r/swift/comments/2uklld/accessing_private_properties_of_uitextfield_in/)
I couldn't have found any properties or methods to move scopeBar elsewhere. You may need to place your own UISegmentedControl and make it work together with the UISearchBar.