简体   繁体   中英

Type UiViewController does not conform to protocol xxx

I have a delegate method in Objective-C code which need to implement in my project which was earlier in swift 2.3 and worked fine but after upgrading to swift 3.0 it shows error...

Type UiViewController does not conform to protocol xxx

I have tried everything I can think of but it still isn't working.

function in protocol from Objective-C like UITableViewDataSouce has changed to a more swift style eg:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell

has change to

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell just modify to new styled func,the error will be gone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM