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
| - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| TagCollectionViewCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; | |
| [cell.tagNameButton setFrame:CGRectMake(10,0,200, 100)]; | |
| return cell; | |
| } |
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
| - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| TagCollectionViewCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; | |
| [cell.tagNameButton setTitle:@"Test" forState:UIControlStateNormal]; | |
| cell.backgroundColor = [UIColor redColor]; | |
| cell.tagNameButton.titleLabel.text = @"Test"; | |
| // UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, 20)]; | |
| // [button setTitle:@"OtherTest" forState:UIControlStateNormal]; | |
| // [cell.contentView addSubview:button]; | |
| // Those commented lines works |
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
| alert.addAction(UIAlertAction(title: "fdafd", style: UIAlertActionStyle.Default, handler: { (whatever) -> Void in | |
| doSomething() | |
| })) |
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
| #define URL_STRING @"http://mydomain.com/nextEvents" | |
| NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:URL_STRING]]; | |
| [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
| if (!connectionError && data) { | |
| NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:0 error: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
| [message.image getDataInBackgroundWithBlock:^(NSData *data, NSError *error) { | |
| image = [UIImage imageWithData:data]; | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| cell.photoImageView.image = image; //this not | |
| [self.cameraButton setBackgroundImage:image forState:UIControlStateNormal]; //this changes | |
| }); | |
| }]; | |
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
| - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| //some code | |
| [message.image getDataInBackgroundWithBlock:^(NSData *data, NSError *error) { | |
| image = [UIImage imageWithData:data]; | |
| cell.photoImageView.image = image; //This doesnt get update. but i cant reload this indexPath cause i will create a infinite loop; | |
| self.testImageView.image = image; //This get update. | |
| }]; | |
| //other code |
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
| NSMutableArray *CustomClassArray = //Objects of type array | |
| class CustomClass : Object | |
| { | |
| @property NSString *objectID; | |
| } | |
| NSMutableArray *filteredArray = [NSMutableArray new]; |
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
| NSInteger item = [self.collectionView numberOfItemsInSection:0] - 1; | |
| NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:0]; | |
| [self.collectionView reloadItemsAtIndexPaths:@[indexPath]]; |
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
| NSDate *date = [NSDate date]; | |
| NSCalendar *calendar = [NSCalendar currentCalendar]; | |
| NSInteger comps = (NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit); | |
| NSDateComponents *dateComponents = [calendar components:comps | |
| fromDate: date]; | |
| NSDate *finalDate = [calendar dateFromComponents:dateComponents]; | |
| NSLog(@"FINAL DATE %@",finalDate); | |
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
| [~/desktop/test] git:master $ cat file | |
| modified by newBranch | |
| [~/desktop/test] git:master $ ls | |
| file | |
| [~/desktop/test] git:master $ git checkout newBranch | |
| M file | |
| Switched to branch 'newBranch' | |
| [~/desktop/test] git:newBranch $ ls | |
| file | |
| [~/desktop/test] git:newBranch $ echo "test" > anotherFile |