Open
Conversation
added 2 commits
May 8, 2017 15:34
JonathanYL
suggested changes
May 8, 2017
|
|
||
| // Configure the view for the selected state | ||
| } | ||
|
|
There was a problem hiding this comment.
don't need this functions if you are not doing anything extra with them.
| @property NSString * tweetText; | ||
| @property NSString * urlToImage; | ||
|
|
||
| -(id)initWithName:(NSString *)name_ andtweet:(NSString *)tweet_ andurl:(NSString *)url_; |
| @property (weak, nonatomic) IBOutlet UITableView *tweetsTableView; | ||
| @property (weak, nonatomic) IBOutlet UIImageView *titleImage; | ||
| @property (weak, nonatomic) IBOutlet UIButton *searchButton; | ||
|
|
|
|
||
| - (BOOL)textFieldShouldReturn:(UITextField *)textField { | ||
| [textField resignFirstResponder]; | ||
| if (textField == self.txtboxSearch) { |
There was a problem hiding this comment.
isn't there only 1 textfield? You don't need to do this check if there is.
|
|
||
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
|
|
||
| TweetsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([TweetsTableViewCell class])]; |
| AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration]; | ||
| manager.requestSerializer = [AFJSONRequestSerializer serializer]; | ||
|
|
||
| NSData *plainData = [[NSString stringWithFormat:@"%@:%@", @"CFMvDaHhOCwBeqMlPKDjeBODG", @"rV3L8VRTgCepmbVX25zXsSYPNzfczSv6kyky6AhwuLkr2ETYw1"] dataUsingEncoding:NSUTF8StringEncoding]; |
There was a problem hiding this comment.
probably don't want your authentication credentials in the app.
| // TODO: add error log | ||
| }]; | ||
| cell.username.text = self.users[[indexPath row]]; | ||
| cell.tweet.text = self.tweets[[indexPath row]]; |
There was a problem hiding this comment.
row is a property. So do indexPath.row
|
|
||
| // Change 10.0 to adjust the distance from bottom | ||
| if (maximumOffset - currentOffset <= 10.0) { | ||
| if(_pageAvailable) |
There was a problem hiding this comment.
can get rid of this nested If with (maxiumOffset - currentOffset <= 10.0 && _pageAvailable)
| NSLog(@"Paging more data"); | ||
| //static NSString * const BaseURLString = @"https://api.twitter.com/1.1/search/tweets.json"; | ||
| //TODO: the fetch tweets call is using the base URL without the q=? parameter, you will have to modify the function for this call | ||
| //NSString *FinalURL = [BaseURLString stringByAppendingString:self.nextPageUrl]; |
| } failure:^(NSURLSessionTask *operation, NSError *error) { | ||
| NSLog(@"Error: %@", error); | ||
| }]; | ||
| } |
There was a problem hiding this comment.
Ideally you want to have a manager class that will make the network calls for you. However, this is ok for the project.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So super!