Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.5k stars 1.1k forks source link

Giving Error: "unrecognized selector sent to instance" if library added using "Tuist framework" #569

Closed dheerajghub closed 1 month ago

dheerajghub commented 1 month ago

Description

I'm using a Tuist framework to modularize my Swift project code, and I've found that even though I've been able to add the skeleton view properly and even able to access its properties and methods, however on runtime it crashes and throws an error.

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

SkeletonView Environment:

SkeletonView version: 1.31.0 Xcode version: 15.0 Swift version: 5.9

Steps to reproduce:

Please replace this with the steps to reproduce the behavior.

  1. added Skeleton view as package dependency using Tuist framework
  2. I've create this title label to which I've added isSkeletonable property and set it to true

let titleLabel: UILabel = {
    let label = UILabel()
    label.translatesAutoresizingMaskIntoConstraints = false
    label.text = "Title"
    label.isSkeletonable = true
    return label
}()
  1. And in viewDidAppear I've added this code:

override func viewDidAppear(_ animated: Bool) {
    titleLabel.showAnimatedSkeleton(usingColor: .red)
    DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
        self.titleLabel.stopSkeletonAnimation()
        self.titleLabel.hideSkeleton(transition: .crossDissolve(0.25))
    }
}

Expected result:

now expected behavior is it should show the skeleton and hide it after 5sec (added delay for testing) NOTE: this works fine if I add SkeletonView as a package dependency separately, not using Tuist

Actual result:

But it is throwing an error attached to the image below

Attachments:

Screenshot 2024-05-24 at 9 28 42 AM
dheerajghub commented 1 month ago

Turns out, i have to configure my xcconfig file in Tuist, sorted now