MonoTouch.UIKit.UICollectionViewDelegate Class
Used to receive notices relating to a MonoTouch.UIKit.UICollectionView.

See Also: UICollectionViewDelegate Members

Syntax

[MonoTouch.Foundation.Model]
[MonoTouch.Foundation.Protocol]
[MonoTouch.Foundation.Register("UICollectionViewDelegate", false)]
[MonoTouch.ObjCRuntime.Availability(Introduced=MonoTouch.ObjCRuntime.Platform.iOS_6_0)]
public class UICollectionViewDelegate : MonoTouch.Foundation.NSObject, IUICollectionViewDelegate, IDisposable

See Also

UICollectionViewSource

Remarks

Methods within MonoTouch.UIKit.UICollectionViewDelegate are called in reaction to events occurring within an associated MonoTouch.UIKit.UICollectionView. To use this class, you must derive from it and override its method to respond to events.

Although MonoTouch.UIKit.UICollectionView is a subtype of MonoTouch.UIKit.UIScrollView, MonoTouch.UIKit.UICollectionViewDelegate is not a subtype of MonoTouch.UIKit.UIScrollViewDelegate. Nonetheless, many of the methods in MonoTouch.UIKit.UICollectionViewDelegate mirror those of MonoTouch.UIKit.UIScrollViewDelegate and application developers may find it useful to consult the documentation of that class for a more detailed discussion of methods relating to scrolling.

The MonoTouch.UIKit.UICollectionViewSource class provides an alternative to this class, combining the MonoTouch.UIKit.UICollectionViewDelegate API and the MonoTouch.UIKit.UICollectionViewDataSource APIs. It is available via the UICollectionView.Source property.

Selecting and Highlighting

Selecting and highlighting in a MonoTouch.UIKit.UICollectionView follows this sequence:

User ActionUICollectionViewDelegate MethodsUICollectionViewCell Properties
Nothing touched

Highlighted == false; Selected == false

Finger down in cell

UICollectionViewDelegate.ShouldHighlightItem is called. If it returns false, processing stops.

UICollectionViewDelegate.ItemHighlighted is called.

Highlighted == true; Selected == false

Finger upUICollectionViewDelegate.ShouldSelectItem is called. If it returns false, processing stops.
UICollectionViewDelegate.ItemSelected is called. UICollectionViewDelegate.ItemUnhighlighted is called.

Highlighted == false; Selected == true

Deselecting a MonoTouch.UIKit.UICollectionViewCell follows a similar sequence:

User ActionUICollectionViewDelegate MethodsUICollectionViewCell Properties
Nothing touched while some MonoTouch.UIKit.UICollectionViewCell is highlighted.

Highlighted == false; Selected == true

Finger taps cell (Deselect gesture)UICollectionViewDelegate.ShouldDeselectItem is called. If it returns false, processing stops.
UICollectionViewDelegate.ItemDeselected is called.

Highlighted == false; Selected == false

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0