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
| #!/bin/sh | |
| # | |
| # SETUP INSTRUCTIONS | |
| #----------------------- | |
| # | |
| # Add this file to a folder called 'scripts' at the same level as your xcodeproj file | |
| # Open XCode | |
| # Select Project on left-hand view | |
| # TARGETS / your target |
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
| - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView | |
| withVelocity:(CGPoint)velocity | |
| targetContentOffset:(CGPoint *)targetContentOffset { | |
| CGPoint point = *targetContentOffset; | |
| // Get point in the Center of the view | |
| CGPoint centerPoint = CGPointMake(point.x + CGRectGetWidth(scrollView.bounds) / 2, point.y); | |
| NSIndexPath *path = [self.collectionView indexPathForItemAtPoint:centerPoint]; |
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
| #!/bin/bash -e | |
| # -------------------------------------------------------- | |
| # Generate app icons and xcassets file from a single image | |
| # Ben Clayton, Calvium Ltd. | |
| # -------------------------------------------------------- | |
| # To use this, place script in `appname` folder inside your project (i.e. the folder that Xcode generates for you containing your source code, it's named after whatever you called the app). | |
| # Create folder there called `RawImages`. | |
| # Source icon should 1024x1024 and be called appIcon.png. If the icon changes, you can just run this again to regenerate everything. | |
| # This script assumes that you have the default setup of an Images.xcassets file containing the AppIcon.appiconset. |
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
| # Check imagemagick is installed | |
| # http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script | |
| command -v convert >/dev/null 2>&1 || { echo >&2 "I require imagemagick but it's not installed. Aborting."; exit 1; } |
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
| // Get visible rows and sort them by row | |
| - (NSArray *)sortedVisibleIndexPaths { | |
| NSArray *visibleItems = [self.collectionView indexPathsForVisibleItems]; | |
| // visible items is NOT SORTED! lol | |
| NSSortDescriptor *rowDescriptor = [[NSSortDescriptor alloc] initWithKey:@"row" ascending:YES]; | |
| NSMutableArray *sortedRows = [[visibleItems sortedArrayUsingDescriptors:@[rowDescriptor]] mutableCopy]; | |
| return sortedRows; | |
| } |
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
| # ignore all warnings from all pods | |
| inhibit_all_warnings! | |
| target :App do | |
| pod 'NSDate+Calendar' | |
| pod 'MagicalRecord', '2.3.0' | |
| pod 'Masonry' | |
| end | |
| target :AppTests, :exclusive => true do |
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
| -com.apple.CoreData.SQLiteIntegrityCheck | |
| 1 | |
| -com.apple.CoreData.ThreadingDebug | |
| 3 | |
| -com.apple.CoreData.SyntaxColoredLogging | |
| 1 | |
| -com.apple.CoreData.SQLDebug | |
| 1 |
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
| #import <XCTest/XCTest.h> | |
| #import <Foundation/Foundation.h> | |
| #import <UIKit/UIKit.h> | |
| /** | |
| Inherit XCTest TestCase classes from this to setup and tearDown a SQLite-backed | |
| MagicalRecord core data stack on each test. | |
| The SQLite file itself will be deleted between runs. |
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
| #import <Foundation/Foundation.h> | |
| #import <UIKit/UIKit.h> | |
| @import CoreData; | |
| typedef NS_ENUM(NSUInteger, FetchResultControllerMode) { | |
| FetchResultsTableViewUpdaterModeMultipleSection, | |
| FetchResultsTableViewUpdaterModeSingleFixedSection | |
| }; |
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
| @import Foundation; | |
| // In-place removal of [NSNull null] values | |
| // Useful when importing into Realm | |
| @interface NSMutableDictionary (BVMNullReplacement) | |
| - (void)bvm_removeNulls; | |
| @end | |
| // In-place removal of [NSNull null] values | |
| // Useful when importing into Realm |