We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIView that conforms StatefulViewController protocol does not be destroyed.
Here is a StatefulViewControllerDemo.zip to illustrate this issue.
PS: the core code
class StateView: UIView, StatefulViewController { public var defaultLoadingView: UIView? { let defaultView = UIView() defaultView.backgroundColor = UIColor.white let label = UILabel() label.textColor = UIColor.blue label.text = "loading..." defaultView.addSubview(label) label.snp.makeConstraints { (maker) in maker.height.equalTo(20) maker.centerX.equalToSuperview() maker.top.equalToSuperview().offset(160) } return defaultView } public var defaultEmptyView: UIView? { let defaultView = UIView() defaultView.backgroundColor = UIColor.white let label = UILabel() label.textColor = UIColor.blue label.text = "no content" defaultView.addSubview(label) label.snp.makeConstraints { (maker) in maker.height.equalTo(20) maker.centerX.equalToSuperview() maker.top.equalToSuperview().offset(160) } return defaultView } override init(frame: CGRect) { super.init(frame: frame) loadingView = defaultLoadingView emptyView = defaultEmptyView setupInitialViewState() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } // FIXME: StateView cannot be destroyed deinit { print("StateView deinit ...") } func hasContent() -> Bool { return false } }
The text was updated successfully, but these errors were encountered:
Same issue, have you managed to solve it? @YK-Unit
Sorry, something went wrong.
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.
No branches or pull requests
UIView that conforms StatefulViewController protocol does not be destroyed.
Here is a StatefulViewControllerDemo.zip to illustrate this issue.
PS: the core code
The text was updated successfully, but these errors were encountered: