Re: Set UICollectionView UIScrollViewDelegate delegate
Re: Set UICollectionView UIScrollViewDelegate delegate
- Subject: Re: Set UICollectionView UIScrollViewDelegate delegate
- From: Kyle Sluder <email@hidden>
- Date: Sat, 18 Oct 2014 14:35:28 -0700
On Oct 18, 2014, at 2:22 PM, Mazzaroth M. <email@hidden> wrote:
>
> Hi, I have a parent view controller that has two UICollectionViewController
> subclasses as children in its view controller hierarchy. I'd like to set
> the parentViewController as the Subclass1CollectionViewController and
> Subclass2CollectionViewControllers' .colllectionView UIScrollView delegate.
> However when I set the delegate, the compiler assumes I'm trying to assign
> it as the UICollectionViewDelegate. UICollectionView is a subclass of
> UIScrollView.. how do refer to its scrollview delegate pointer?
There is only one delegate property. UICollectionView redeclares the property it inherits from UIScrollView and retypes it as UICollectionViewDelegate, which extends UIScrollViewDelegate. Any object you assign as the collection view’s delegate *must* conform to UICollectionViewDelegate.
The good news is that every member of UICollectionViewDelegate is optional, so this is a trivial change.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden