7hacker
7hacker

Reputation: 1978

Unable to set delegate using IB for KASlideShow

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:

  1. Drag an Image View onto the View Controller.
  2. 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!

  3. the class should reference the Protocol delegate example:

    class SlideshowViewController: UIViewController, KASlideShowDelegate

  4. 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

Answers (1)

skwashua
skwashua

Reputation: 1627

On the storyboard, are you setting the class on the ImageView there as well? (not just the outlet)

Change Class Here

Upvotes: 2

Related Questions