Open ppamorim opened 4 years ago
Do you think that the materialShowcase.show()
function was called too early that the target view had not laid out in UI yet?
So, it was null at that time.
@quangctkm9207 button
has been created and added as subview in the function loadView()
by code and materialShowcase.show()
was called in the viewDidAppear(_ animated: Bool)
method. I know I know, very strange.
Yes. It is quite strange because it happened randomly.
@quangctkm9207 I think the only way to sort this out is to rewrite the instances and use UIView?
instead of UIView!
.
That would be a good suggestion. Based on your tests, how often does the crash occur?
/// Sets a UITableViewCell as target
@objc public func setTargetView(tableViewCell: UITableViewCell) {
targetView = tableViewCell.contentView
// for tableViewCell, we do not need target holder (circle view)
// therefore, set its radius = 0
targetHolderRadius = 0
}
/// Sets a UICollectionViewCell as target
@objc public func setTargetView(collectionViewCell: UICollectionViewCell) {
targetView = collectionViewCell
// for collectionViewCell, we do not need target holder (circle view)
// therefore, set its radius = 0
targetHolderRadius = 0
}
Hey, i wanted to show the showcase on a UIBarButtonItem and i ran into this crash. The reason is here:
if let view = (barButtonItem.value(forKey: "view") as? UIView)?.subviews.first { targetView = view }
view cannot be casted to UIView so this fails and targetView never get initialized. I solved this by setting a custom view(UIButton) to the UIBarButtonItem
Hi, I was testing my app on the simulator and this happened:
To start the showcase it's calling:
Version: 0.7.1