Objective-c the constructor, just return a self. You can initialize anything inside. In Swift's init function, put the super.init in front of you, and then initialize the contents of your code will be an error.
So:
Init (frame:nsrect) { super.init (frame:frame) subviewgroup = Gridviewgroup (Rows:9, Columns:9, gridview:self) }/*** Properties ***/let subviewgroup:gridviewgroup
Is wrong.
What should it be like:
Init (frame:nsrect) { Subviewgroup = Gridviewgroup (Rows:9, Columns:9, gridview:self) super.init (frame:frame) }
Specific to the time of UITableView:
Override Init (Nibname nibnameornil:string?, bundle Nibbundleornil:nsbundle?) { Self.tableview = UITableView (frame:cgrectmake (0, 0, cgrectgetwidth (rect), Cgrectgetheight (rect)), style: Uitableviewstyle.plain) super.init (Nibname:nibnameornil, Bundle:nibbundleornil) Dlog () Self.view.addSubview (self.tableview) self.tableView.delegate = self self.tableView.dataSource = Self Self.tableView.allowsSelection = True }
After Super.init can use self to give delegate, DataSource and so on to assign value.
From objective-c to Swift, you have to be. (iii) sequence of Init