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
extension String { | |
/// Finds matching groups and replace them with a template using an intuitive API. | |
/// | |
/// This example will go through an input string and replace all occurrences of "MyGreatBrand" with "**MyGreatBrand**". | |
/// | |
/// let regex = try! NSRegularExpression(pattern: #"(MyGreatBrand)"#) // Matches all occurrences of MyGreatBrand | |
/// someMarkdownDocument.replaceGroups(matching: regex, with: #"**$1**"#) // Surround all matches with **, formatting as bold text in markdown. | |
/// print(someMarkdownDocument) | |
/// | |
/// - Parameters: |
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
var configuration = PHPickerConfiguration() | |
configuration.filter = .images | |
configuration.selectionLimit = 0 | |
let picker = PHPickerViewController(configuration: configuration) | |
picker.delegate = self | |
present(picker, animated: true) |
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
<code_scheme name="Default" version="173"> | |
<option name="RIGHT_MARGIN" value="100" /> | |
<AndroidXmlCodeStyleSettings> | |
<option name="USE_CUSTOM_SETTINGS" value="true" /> | |
</AndroidXmlCodeStyleSettings> | |
<JavaCodeStyleSettings> | |
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> | |
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> | |
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | |
<value /> |
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
/** | |
* @Credits: paiego | |
* @Description: edited paiego's code to adapt to my use (error animation feedback) | |
* @See: http://stackoverflow.com/a/9753948/4075379 | |
*/ | |
- (CAAnimation *)shakeAnimation { | |
CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; | |
CGFloat wobbleAngle = 0.06f; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 "TableDelegate.h" | |
//adicionar antes do último @end | |
#pragma mark - IBActions - | |
- (IBAction)itemPressed:(TableDelegate*)sender { | |
TableData *data = sender.selectedData; | |
UIAlertController *alert = [UIAlertController alertControllerWithTitle:data.title message: |
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
//TableCoordinator.h | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface TableCoordinator : NSObject | |
@property (nonatomic, strong) IBOutlet UITableView *tableView; | |
- (void)reloadData:(NSArray *)data; |
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
//TableDelegate.h | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface TableDelegate : UIControl <UITableViewDelegate> | |
@property (nonatomic, strong) NSArray *data; | |
@property (readonly) id selectedData; |
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
//TableDataSource.h | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> | |
@interface TableDataSource : NSObject<UITableViewDataSource> | |
@property (nonatomic, strong) NSArray *data; | |
@end |
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
- (void)reloadData { | |
[self.refreshControl beginRefreshing]; | |
[self.dataManager getData:^(NSArray *json) { | |
//converte os objetos do servidor no nosso modelo de objetos | |
NSMutableArray *items = [NSMutableArray array]; | |
for (NSDictionary *jsonItem in json) { | |
TableData *item = [[TableData alloc] initWithJSON:jsonItem]; | |
item.position = [NSNumber numberWithInteger:[json indexOfObject:jsonItem]+1]; |