Skip to content

Instantly share code, notes, and snippets.

View azonov's full-sized avatar

Andrey azonov

  • Т-Банк
  • Russia
View GitHub Profile
public struct Formatters {
public enum DateFormatterType {
case ISO8601
case medium
}
static func string(from date: Date, for type: DateFormatterType) -> String {
return formatter(for: type).string(from: date)
}
po Realm.Configuration.defaultConfiguration.fileURL
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@azonov
azonov / gist:0ed8c433aac661344024
Created December 7, 2015 14:01 — forked from MrRooni/gist:4988922
UITableView and NSFetchedResultsController: Updates Done Right
@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