2017-12-01 17 views
3

는 트윗 모델 객체에서 Tweet를 표시하는 tweetView이 있지만, 거기에는 필드 리트 윗을 보여주는하지 않으며 tweetView의 수를 좋아한다.iOS TwitterKit에서 리트 윗 및 유사 카운트를 표시하는 방법? twitterKit에서

cell.tweetView.showActionButtons = true; 

이렇게하면 즐겨 찾기 및 공유에 대한 작업 버튼을 표시 할 수 있습니다. 하지만 각 트윗에 retweet/likes 카운트를 표시하고 싶습니다. 달성하려면 어떻게해야합니까?

답변

0

그냥 일반 UITableViewCell를 서브 클래스와 그것의 내부 TWTRTweetView를 사용합니다. 어느 그것은 본질적으로 유형 TWTRTweetView의 함께 IBOutlet 대신있는 tableview 셀에 그것을 사용하십시오 tweetView 속성이, TWTRTweetTableViewCell이 무엇을 기본적으로.

놓습니다 TWTRTweetView의 상단에 적절한 위치에 like and retweets 카운트에 대한 사용자 지정 레이블입니다. 더 많은 정보를 들어

- (void)configureCell:(TWTRTweet *)tweet{ 
    self.customTweetView.showActionButtons = true; 
    [self.customTweetView configureWithTweet:tweet]; 
    self.likesCount.text = [NSString stringWithFormat:@"%lld", tweet.likeCount]; 
    self.retweetsCount.text = [NSString stringWithFormat:@"%lld", tweet.retweetCount]; 
} 

: check this SO post