Skip to content

Instantly share code, notes, and snippets.

View kimjj81's full-sized avatar

Jeongjin Kim kimjj81

View GitHub Profile
@mikevoyt
mikevoyt / gist:4613982
Last active February 8, 2023 12:52
Example of how to create a pinned header with UICollectionView (i.e., a header that doesn't scroll with the rest of the cells). As simple as possible - assumes a single header, at index path [0,0], to be pinned at the top of the collection view.
//Override UICollectionViewFlowLayout class
@interface FixedHeaderLayout : UICollectionViewFlowLayout
@end
@implementation FixedHeaderLayout
//Override shouldInvalidateLayoutForBoundsChange to require a layout update when we scroll
- (BOOL) shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
return YES;
}
@leighmcculloch
leighmcculloch / NSString_stripHtml.h
Last active February 21, 2018 22:45
NSString + Strip HTML
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
@end