This file contains 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
These are a few patterns commonly used. | |
1 - Digits only: (\\d+) | |
2 - Names without special characters: ([A-Za-z\\s]+) | |
3 - Email: (([\\w\\.\\-]*?@)([\\w\\.\\-]+)(\\.[a-z]{2,4}) # Incompatible with versions previous to 1.1.2 of NSStringMask | |
4 - Dates: (\\d{2})/(\\d{2})/(\\d{4}) | |
5 - SSN: (\\d{3})-(\\d{2})-(\\d{3}) | |
6 - Telephone: (\\d{3})-(\\d{3})-(\\d{4}) | |
Brasil: |
This file contains 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
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { | |
// show UIActionSheet | |
}]; | |
moreAction.backgroundColor = [UIColor greenColor]; | |
UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Flag" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { | |
// flag the row | |
}]; |
This file contains 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
// | |
// NSOperationQueue+Completion.h | |
// QueueTest | |
// | |
// Created by Artem Stepanenko on 23.11.13. | |
// Copyright (c) 2013 Artem Stepanenko. All rights reserved. | |
// | |
typedef void (^NSOperationQueueCompletion) (void); |
This file contains 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
// | |
// HideableUIView.swift | |
// Albert Bori | |
// | |
// Created by Albert Bori on 5/19/15. | |
// Copyright (c) 2015 Albert Bori under the MIT license. | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// |
This file contains 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 <StoreKit/StoreKit.h> | |
typedef void(^SKRequestCompletion)(SKRequest * request, NSError * error); | |
@interface SKRequest (Blocks) <SKRequestDelegate> | |
- (void) startWithCompletion:(SKRequestCompletion) completion; | |
@end |