[Question] Syntax problem?
LavareX opened this issue · comments
What is the syntax of the code?
[self addSubview:({
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, scrollW, scrollH)];
[self addSubviewToScrollView:scrollView];
scrollView.delegate = self;
scrollView.scrollsToTop = NO;
scrollView.pagingEnabled = YES;
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.contentOffset = CGPointMake(scrollW, 0);
scrollView.contentSize = CGSizeMake((self.count + 2) * scrollW, 0);
self.scrollView = scrollView;
})];
C++ Lambda syntax? If remove the self.scrollView = scrollView;
compiler to the error. The return value is not automatically speculated?
In fact, I don't really know its syntax name, I also think it's a lambda syntax. And we have to return a right value in this func:)
For me, self.scrollView = scrollView;
as a return value of the syntax is unfamiliar, can provide information see more? : ]
scrollView;
发自我的 iPhone
在 2016年11月13日,下午5:34,Lavare notifications@github.com 写道:
For me, self.scrollView = scrollView; as a return value of the syntax is unfamiliar, can provide information see more? : ]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.