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
| enum MyEnum { | |
| case StateA | |
| case StateB | |
| } | |
| let enumValueA = MyEnum.StateA | |
| let enumValueB = MyEnum.StateB | |
| if enumValueA == enumValueB { |
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 Cocoa | |
| enum Result { | |
| case Success | |
| case Failure(NSError) | |
| } | |
| func DoTask() -> Result { | |
| return .Failure(NSError.errorWithDomain("Domain", code: 4, userInfo:nil)) | |
| } |
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
| - (BOOL)tableViewDataSource:(DCTTableViewDataSource *)tableViewDataSource shouldReloadRowAtIndexPath:(NSIndexPath *)indexPath { | |
| ISUIssue *issue = [tableViewDataSource objectAtIndexPath:indexPath]; | |
| NSArray *keys = [issue.changedValuesForCurrentEvent allKeys]; | |
| if ([issue.changedValuesForCurrentEvent objectForKey:ISUIssueAttributes.issueID]) return YES; | |
| if ([keys containsObject:ISUIssueAttributes.issueID]) return YES; | |
| if ([keys containsObject:ISUIssueAttributes.title]) return YES; |
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
| appledoc=`which appledoc` | |
| if [ $appledoc ]; then | |
| company="Daniel Tull"; | |
| companyID="uk.co.danieltull"; | |
| companyURL="http://danieltull.co.uk"; | |
| outputPath="/tmp/${PRODUCT_NAME}"; | |
| $appledoc \ |
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)viewDidLayoutSubviews { | |
| [super viewDidLayoutSubviews]; | |
| [self modifyEdgeInsetsOfScrollView:self.tableView]; | |
| [self modifyEdgeInsetsOfScrollView:self.webView.scrollView]; | |
| } | |
| - (void)modifyEdgeInsetsOfScrollView:(UIScrollView *)scrollview { | |
| scrollview.contentInset = [self modifiedEdgeInsets:scrollview.contentInset]; | |
| scrollview.scrollIndicatorInsets = [self modifiedEdgeInsets:scrollview.scrollIndicatorInsets]; | |
| } |
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)checkConnectionWithError:(NSError *)error { | |
| CWDURLSessionManagerState state = CWDURLSessionManagerStateConnected; | |
| NSNumber *errorCode = @(error.code); | |
| if ([[self noInternetErrorCodes] containsObject:errorCode]) | |
| state = CWDURLSessionManagerStateNotConnected; | |
| if (self.state == state) return; |
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
| echo "Starting Tag and upload to TestFlight with configuration: ${CONFIGURATION}" | |
| if [[ ${CONFIGURATION} != "Release" ]]; then | |
| exit | |
| fi | |
| cd ${SRCROOT} | |
| PREVIOUSTAG=`git tag | grep "$s." | sort -r | head -1` | |
| TAG="s.`git log --oneline | wc -l | tr -d ' '`" |
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
| echo "Starting Tag and upload to TestFlight with configuration: ${CONFIGURATION}" | |
| if [[ ${CONFIGURATION} != "Release" ]]; then | |
| exit | |
| fi | |
| cd ${SRCROOT} | |
| PREVIOUSTAG=`git tag | grep "$s." | sort -r | head -1` | |
| TAG="s.`git log --oneline | wc -l | tr -d ' '`" |
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
| fetchRequest.entity = [RNPFeedListEntry entityInManagedObjectContext:self.managedObjectContext]; | |
| // this is the main predicate to get the feed entries that belong to the us | |
| NSPredicate *ownerPredicate = [NSPredicate predicateWithFormat:@"%K == %@ AND %K.%K == %@", | |
| RNPFeedListEntryRelationships.owner, self, RNPFeedListEntryRelationships.feed, | |
| RNPFeedAttributes.action, @(FeedAction_LIKE), self]; | |
| // this is the predicate to check that we have the required item | |
| NSPredicate *itemPopulatedPredicate = [NSPredicate predicateWithFormat:@"(%K.%K == nil) OR (%K.%K != nil)", | |
| RNPFeedListEntryRelationships.feed, RNPFeedAttributes.itemId, | |
| RNPFeedListEntryRelationships.feed, RNPFeedRelationships.item]; | |
| fetchRequest.predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[ownerPredicate, itemPopulatedPredicate]]; |
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
| @protocol SnapshotCancellation | |
| - (void)cancel; | |
| @end | |
| + (id<SnapshotCancellation>)snapshotOfFolder:(NSString*)folder withBlock:(void(^)(Snapshot* shot))block { | |
| Snapshot* s = [[Snapshot alloc] initWithFolder:folder]; | |
| [s scanWithCompletion:block]; | |
| return s; |