Reputation: 1978
I am using the KASlideShow pod for Swift. It handles a UIImageView to enable creation of slideshows
I was looking at an example project to learn how to use it .Im also a beginner at Swift
So my idea is this:
Create an outlet from Image View by Ctrl+Drag the Image View object to the VC Swift file and create it of type KASlideShow! example:
@IBOutlet weak var slideshowView: KASlideShow!
the class should reference the Protocol delegate example:
class SlideshowViewController: UIViewController, KASlideShowDelegate
Set the delegate, but how? As I am unable to do this using the Ctrl+Drag mechanism, I just type out
slideshowView.delegate = self
The above bombs with a stack output showing:
2015-11-17 12:10:22.681 Mimi[15268:1084006] -[UIView setDelegate:]: unrecognized selector sent to instance 0x7fc7f2efb2d0
2015-11-17 12:10:22.698 Mimi[15268:1084006] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setDelegate:]: unrecognized selector sent to instance 0x7fc7f2efb2d0'
I know Im missing a small and easy way out of this! Help!
Upvotes: 0
Views: 126
Reputation: 1627
On the storyboard, are you setting the class on the ImageView there as well? (not just the outlet)
Upvotes: 2