SkeletonView icon indicating copy to clipboard operation
SkeletonView copied to clipboard

code base UI skeleton not working

Open yoonjason opened this issue 2 years ago • 0 comments

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

yoonjason avatar Aug 22 '23 01:08 yoonjason