Beginner Swift But there's only a lot of Swift's cell created with Xib, and that's not what I want. Today, I got a code that doesn't have to be written xib pure code.
Custom cell
Here's the controller.
Exception to say a little lazy loading
Lazy Loading of OC
@property (nonatomic, Strong) Nsmutablearray * DATASOURCE;
-(Nsmutablearray *) DataSource {
if (!_datasource) {
_datasource = [Nsmutablearray array];
}
return _datasource;
}
Swift, that's what I wrote.
Lazy Loading
Lazy var players:[string] = {
var temporaryplayers = [String] ()
Temporaryplayers.append ("test2")//assignment operation
Temporaryplayers.append ("Just won't sleep at the World Cup to see a deep understanding of Cuona is considered a skill tested")//assignment operation
Return temporaryplayers
}()
This blog is well written: http://www.cnblogs.com/QianChia/p/5777421.html#undefined
Swift's pure code creates a cell