Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds delegate methods for lost focus

  • Loading branch information...
commit 53753d53a50467baec2feba1dd257d446b4bcb4b 1 parent e916b59
Pieter pieteromvlee authored
Showing with 19 additions and 2 deletions.
  1. +14 −0 BCCollectionView.m
  2. +5 −2 BCCollectionViewDelegate.h
14 BCCollectionView.m
View
@@ -584,6 +584,20 @@ - (NSMenu *)menuForEvent:(NSEvent *)anEvent
return nil;
}
+- (BOOL)resignFirstResponder
+{
+ if ([delegate respondsToSelector:@selector(collectionViewLostFirstResponder:)])
+ [delegate collectionViewLostFirstResponder:self];
+ return [super resignFirstResponder];
+}
+
+- (BOOL)becomeFirstResponder
+{
+ if ([delegate respondsToSelector:@selector(collectionViewBecameFirstResponder:)])
+ [delegate collectionViewBecameFirstResponder:self];
+ return [super becomeFirstResponder];
+}
+
- (BOOL)isOpaque
{
return YES;
7 BCCollectionViewDelegate.h
View
@@ -72,6 +72,9 @@ enum {
- (void)colectionViewDidZoom:(BCCollectionView *)collectionView;
//contextual menu
-- (NSMenu *)collectionView:(BCCollectionView *)collectionView menuForItemsAtIndexes:(NSIndexSet *)indexSet
-;
+- (NSMenu *)collectionView:(BCCollectionView *)collectionView menuForItemsAtIndexes:(NSIndexSet *)indexSet;
+
+- (void)collectionViewLostFirstResponder:(BCCollectionView *)collectionView;
+- (void)collectionViewBecameFirstResponder:(BCCollectionView *)collectionView;
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.