Skip to content
New issue

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

code base UI skeleton not working #547

Open
yoonjason opened this issue Aug 22, 2023 · 0 comments
Open

code base UI skeleton not working #547

yoonjason opened this issue Aug 22, 2023 · 0 comments

Comments

@yoonjason
Copy link

yoonjason commented Aug 22, 2023

hi

First I'll show you my code

import snapkit
import Then
import SkeletonView

class BaseViewController: UIViewController {


}

class DoSomethingViewController: BaseViewController {

 private let testLabel: UILabel = .init()

    override func viewDidLoad() {
        super.viewDidLoad()
        setupViews()
        setupLayoutConstraints()
   }

    func setupViews() { 
        testLabel.do {
            $0.text = "terminating with uncaught exception of type NSException"
            $0.textAlignment = .left
            $0.numberOfLines = 0
            view.addSubview($0)
        }
   }

    func setupLayoutConstraints() {
            testLabel.snp.makeConstraints {
            $0.top.equalTo(imageButton).offset(20)
            $0.centerX.equalToSuperview()
            $0.leading.equalToSuperview().offset(10)
            $0.trailing.equalToSuperview().offset(-10)
        }
    }

    override func viewDidLayoutSubviews() {
       super.viewDidLayoutSubviews()
       testLabel.isSkeletonable = true 
       testLabel.showSkeleton()
    }

}

Is there a way to fix the app crashes with the following error?

-[UILabel setIsSkeletonable:]: unrecognized selector sent to instance 0x158708450

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant