Permalink
Browse files

Add new labels to iOS demo app interface

  • Loading branch information...
1 parent e3c68c3 commit 156af1a3ad446ae881dac373183f3ab87ca162eb @vtourraine vtourraine committed Apr 9, 2013
@@ -18,4 +18,24 @@
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
+@property (weak, nonatomic) IBOutlet UILabel *altmetricIdentifierLabel;
+@property (weak, nonatomic) IBOutlet UILabel *DOILabel;
+@property (weak, nonatomic) IBOutlet UILabel *arXivLabel;
+@property (weak, nonatomic) IBOutlet UILabel *NLMIdentifierLabel;
+@property (weak, nonatomic) IBOutlet UILabel *pubMedIdentifierLabel;
+@property (weak, nonatomic) IBOutlet UILabel *ADSBibcodeLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *journalLabel;
+@property (weak, nonatomic) IBOutlet UILabel *publishedOnLabel;
+@property (weak, nonatomic) IBOutlet UILabel *lastUpdatedLabel;
+@property (weak, nonatomic) IBOutlet UILabel *addedOnLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *articleURLLabel;
+@property (weak, nonatomic) IBOutlet UILabel *detailsURLLabel;
+
+@property (weak, nonatomic) IBOutlet UILabel *tweetersLabel;
+@property (weak, nonatomic) IBOutlet UILabel *facebookUsersLabel;
+@property (weak, nonatomic) IBOutlet UILabel *scienceBlogsLabel;
+@property (weak, nonatomic) IBOutlet UILabel *googlePlusLabel;
+
@end
@@ -22,6 +22,8 @@ @implementation SZNArticleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
+ ((UIScrollView *)self.view).alwaysBounceVertical = YES;
+ ((UIScrollView *)self.view).contentSize = CGSizeMake(self.view.frame.size.width, self.googlePlusLabel.frame.origin.y + 70);
[self configureViewWithArticle:self.article];
}
@@ -34,8 +36,30 @@ - (void)setArticle:(SZNAltmetricArticle *)article
- (void)configureViewWithArticle:(SZNAltmetricArticle *)article
{
self.titleLabel.text = self.article.title;
- self.scoreLabel.text = [self.article.score stringValue];
[self.imageView setImageWithURL:self.article.imageLargeURL];
+ self.scoreLabel.text = [self.article.score stringValue];
+ self.altmetricIdentifierLabel.text = article.identifier;
+ self.DOILabel.text = article.DOI;
+ self.arXivLabel.text = article.arXiv;
+ self.NLMIdentifierLabel.text = article.NLMIdentifier;
+ self.pubMedIdentifierLabel.text = article.pubMedIdentifier;
+ self.ADSBibcodeLabel.text = article.ADSBibcode;
+ self.journalLabel.text = article.journal;
+
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+ dateFormatter.dateStyle = NSDateFormatterLongStyle;
+ dateFormatter.doesRelativeDateFormatting = YES;
+ self.publishedOnLabel.text = [dateFormatter stringFromDate:article.publishedOn];
+ self.lastUpdatedLabel.text = [dateFormatter stringFromDate:article.lastUpdated];
+ self.addedOnLabel.text = [dateFormatter stringFromDate:article.addedOn];
+
+ self.articleURLLabel.text = [article.articleURL absoluteString];
+ self.detailsURLLabel.text = [article.detailsURL absoluteString];
+
+ self.tweetersLabel.text = [article.citedByTweetersCount stringValue];
+ self.facebookUsersLabel.text = [article.citedByFacebookWallsCount stringValue];
+ self.scienceBlogsLabel.text = [article.citedByFeedsCount stringValue];
+ self.googlePlusLabel.text = [article.citedByGooglePlusCount stringValue];
}
@end
Oops, something went wrong.

0 comments on commit 156af1a

Please sign in to comment.