Auto-implement Swift protocol methods in Xcode

NB: This answer is true for Xcode before version 9; in Version 9 Apple added the ability to automatically fix up missing protocol methods; see Guy Daher’s answer. I just created an iOS project, and headed into my UIViewController.swift file. There I declared that it implemented UITableViewDelegate: class ViewController: UIViewController, UITableViewDelegate { Now when I … Read more

tableView:indexPathForCell returns nil

It could be that the cell is not visible at this moment. tableView:indexPathForCell returns nil in this situation. I solved this using indexPathForRowAtPoint this method works even if the cell is not visible. The code: UITableViewCell *cell = textField.superview.superview; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:cell.center];

Can someone explain what a wire-level protocol is?

I wouldn’t say that something uses a wire-level protocol or doesn’t – I’d talk about which wire-level protocol it uses. Basically, if something’s communicating with a remote machine (even conceptually) then there’s some data going across the network connection (the wire). The description of that data is the “wire-level protocol”. Even within that, you would … Read more

Are binary protocols dead? [closed]

You Just Can’t Beat the Binary Binary protocols will always be more space efficient than text protocols. Even as internet speeds drastically increase, so does the amount and complexity of information we wish to convey. The text protocols you reference are outstanding in terms of standardization, flexibility and ease of use. However, there will always … Read more