Posts

Post not yet marked as solved
14 Replies
9.2k Views
HiI have a UICollectionView. I have set the class to be PortfolioCollectionViewCell, which Xcode finds an puts in, but when I ask the class: let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) / print("class =", String(describing: type(of: cell)))it tells me class = UICollectionViewCellI had tried to move Main.storyboard to the top of Project Navigator, but it disappeared and I drag-dropped it back into the project, and had to set the TargetMembership. I deleted and recreated this collection view cell. But it is ignoring the class type I have set.What could be the cause of this? (XCode Version 9.0 beta 3 9M174d)---Mark
Posted
by logistes.
Last updated
.
Post marked as solved
2 Replies
1.7k Views
HiI want to add an init function to a UIViewController to ensure that a property that I require is always going to be set. The code is this:class XBSelectRecord: UIViewController { convenience init(labelXXX: String?) { self.init(nibName: "XBSelectRecord", bundle: nil) ! Ambiguous reference to member 'init(labelXXX:)' self.heading = labelXXX } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") }Clearly that should not be ambiguous. Can anyone explain what I am doing wrong here?TIAMark
Posted
by logistes.
Last updated
.