You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UIView that conforms StatefulViewController protocol cannot be destroyed #71
classStateView:UIView,StatefulViewController{publicvardefaultLoadingView:UIView?{letdefaultView=UIView()defaultView.backgroundColor=UIColor.whiteletlabel=UILabel()label.textColor=UIColor.bluelabel.text="loading..."defaultView.addSubview(label)label.snp.makeConstraints{(maker)inmaker.height.equalTo(20)maker.centerX.equalToSuperview()maker.top.equalToSuperview().offset(160)}returndefaultView}publicvardefaultEmptyView:UIView?{letdefaultView=UIView()defaultView.backgroundColor=UIColor.whiteletlabel=UILabel()label.textColor=UIColor.bluelabel.text="no content"defaultView.addSubview(label)label.snp.makeConstraints{(maker)inmaker.height.equalTo(20)maker.centerX.equalToSuperview()maker.top.equalToSuperview().offset(160)}returndefaultView}overrideinit(frame:CGRect){super.init(frame:frame)loadingView=defaultLoadingViewemptyView=defaultEmptyViewsetupInitialViewState()}requiredinit?(coderaDecoder:NSCoder){fatalError("init(coder:) has not been implemented")}
// FIXME: StateView cannot be destroyed
deinit{print("StateView deinit ...")}funchasContent()->Bool{returnfalse}}
Activity
tungdx commentedon May 14, 2019
Same issue, have you managed to solve it? @YK-Unit
YK-Unit commentedon May 18, 2019
Yes, I just solve it now. And I have crated a PR #73. What's more, you can use the StatefulViewControllerDemo_v2.0.0.zip to verify it.