appending ChipIconButton to TextFIeld

163 Views Asked by At

I am using cosmicmind Material Swift and am trying to insert contact chips into a text field. I am using the native ContactsUI picker presented modally for a user to select the contacts to send a message to. I am retrieving their display name and storing it as the title for the ChipIconButton:

open func prepareChipIconButton(contactDisplayName:string)  {
    let icon = UIImage.profile! //added an extension to UIImage to user Material person icon for this
    let button = ChipIconButton(image:icon, title: contactDisplayName)
    peopleToSendMessageToTextField.text!.appending(button)//ERROR
}

The error is obviously: Cannot convert value of type 'ChipIconButton' to expected argument type 'String'

I have to append rather than set equals to of course because if a user selects multiple contacts. Either way this will not allow me to insert a ChipIconButton which inherits from Button.

The desired appearance is to ultimately look like this: enter image description here

0

There are 0 best solutions below