-1
[self.resultController setCellForRowAtIndexPathCompletion:^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {

}];

This function is defined as follows:

@property (copy) UITableViewCell * (^cellForRowAtIndexPathCompletion)(UITableView *tableView, NSIndexPath *indexPath); 
Paolo
  • 3,825
  • 4
  • 25
  • 41
  • 4
    That's called a "Block" in Objective-C and a "Closure" in Swift in case you were looking for "key word" to improve your search. – Larme Sep 01 '17 at 12:53

1 Answers1

1

This is a closure that can be defined like this:

var cellForRowAtIndexPathCompletion: ((_ tableView: UITableView, _ indexPath: IndexPath) -> UITableViewCell)!
Tamás Sengel
  • 55,884
  • 29
  • 169
  • 223
  • I use it like this:self.resultController.cellForRowAtIndexPathCompletion ((tableView: UITableView, indexPath: IndexPath) -> UITableViewCell)!{ } but have a error : Cannot convert value of type '((UITableView, IndexPath) -> UITableViewCell).Type' to expected argument type '(UITableView?, IndexPath?)' (aka '(Optional, Optional)') – ZureaintC Sep 01 '17 at 13:05
  • You should not use a forced unwrapp (!) on a property unless you are 100% sure it will always be set, or even better, unless it is a IBOutlet – Daniel Sep 01 '17 at 13:24
  • How should I code? – ZureaintC Sep 01 '17 at 13:30