0

I need to use ABPeoplePickerView to implement my AddressBook application. the view in IB is like this: enter image description here

and it's like the following after running: enter image description here

I want to delete the search field and add a button(like "add") on the top, but I don't know how to change the view layout. Is there any way to do it?

Marek H
  • 5,173
  • 3
  • 31
  • 42
NOrder
  • 2,483
  • 5
  • 26
  • 44

2 Answers2

1

You can subclass the view to customize it.

Frederik Slijkerman
  • 6,471
  • 28
  • 39
0

This function finds the search field. Hopefully it may point the way for you to proceed.

extension ABPeoplePickerView {
  func searchField () -> NSSearchField?{
    for v in self.subviews[0].subviews {
      if v.isKind(of: NSSearchField.self) { return (v as! NSSearchField) }
    }
    return nil
  }
}
AlexT
  • 596
  • 7
  • 15