I was perusing the code of the third-party RESideMenu
framework, and noticed some strange syntax that seemed to work just fine. Here is the confusing bit:
self.tableView = ({
UITableView *tableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain];
tableView.autoresizingMask = mask;
tableView.delegate = self;
tableView.dataSource = self;
tableView.opaque = NO;
tableView.backgroundColor = [UIColor clearColor];
tableView.backgroundView = nil;
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
tableView.bounces = NO;
tableView.scrollsToTop = NO;
tableView;
});
How does this syntax work? I suspect it has something to do with a C-level block scoping, but I have never seen this before. I also considered it may be a new feature with Objc-2.0 literals, but I don't think that is true.
So I guess my question is how does this work/what makes this work?