You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you can do is modify STXFeedTableViewDataSource, and examine the two methods of UITableViewDataSource protocols tableView:numberOfRowsInSection: and tableView:cellForRowAtIndexPath:.
Here, I always return NUMBER_OF_STATIC_ROWS + commentsCount as the number of rows. You need to retrieve the postItem, check whether there's a photoURL or not. If there's no photo, then you need to use NUMBER_OF_STATIC_ROWS - 1
However, this is still not an elegant solution, because of the number of static rows that's not based on whether a content is available or not. Probably, it's better to create a method to calculate rows based on the properties of the photoItem.
Then at tableView:cellForRowAtIndexPath: you can also do the same checking mechanism on photoItem, and return the appropriate cell for each row.
Also make sure all the tableview datasource and delegate methods are properly checking for the postItem content on each indexPath.
Damn... Can you give me a example what do you mean with creating a method that calculates rows based on the properties? And how to reuse that on the other methods??
What do I have to do to add my own properties or another class to the existing ones post,comments and user. I have a channel class with 3 properties that I have to add also.
thx first for this awesome project!
I would like to hide and move up the text area if there's no Photo. How can I do that?
The text was updated successfully, but these errors were encountered: