This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(UIImage *)imageWithTint:(UIImage *)image andTintColor:(UIColor *)tintColor { | |
UIImage *imageNew = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:imageNew]; | |
imageView.tintColor = tintColor; | |
UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, NO, 0.0); | |
[imageView.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *tintedImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SomeViewController () | |
// Declare some collection properties to hold the various updates we might get from the NSFetchedResultsControllerDelegate | |
@property (nonatomic, strong) NSMutableIndexSet *deletedSectionIndexes; | |
@property (nonatomic, strong) NSMutableIndexSet *insertedSectionIndexes; | |
@property (nonatomic, strong) NSMutableArray *deletedRowIndexPaths; | |
@property (nonatomic, strong) NSMutableArray *insertedRowIndexPaths; | |
@property (nonatomic, strong) NSMutableArray *updatedRowIndexPaths; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CollectionViewDataSource.swift | |
// Khan Academy | |
// | |
// Created by Andy Matuschak on 10/14/14. | |
// Copyright (c) 2014 Khan Academy. All rights reserved. | |
// | |
import UIKit |