-3

I have begun to try to use MessageKit from the Firebase Chat tutorial that uses MessageKit so far. I have come across this error that does not appear inside the tutorial project. When I try to use the code from the tutorial project I am getting this error and am not sure how to solve it.

Argument labels '(type:)' do not match any available overloads

let cameraItem = UIBarButtonItem(type: .system)
Lukas Bimba
  • 817
  • 14
  • 35
  • 3
    Please ⌃⌘-click on the symbol to see the header file where the `init` methods are declared or retype *UIBarButtonItem(* and use code completion. It also could be a custom extension providing this `init` method. – vadian Nov 19 '18 at 16:42

1 Answers1

0

You cannot create an UIBarButtonItem like that because it's not part of the documentation. Here is the official documentation of UIBarButtonItem with different initialisers.

If you want to create a UIBarButtonItem with default system items:

UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: Selector("handleCancel")

Here is a list of all UIBarButtonItem.SystemItem that you can use to create a UIBarButtonItem

You can also create a UIBarButtonItem with different data, like images, text etc... Take a look at this page

Julien Kode
  • 5,010
  • 21
  • 36