•  


GitHub - 2359media/STXDynamicTableView: Rebuilding of Instagram's dynamic table view
Skip to content

2359media/STXDynamicTableView

Repository files navigation

Build Status

STXDynamicTableView

STXDynamicTableView is designed to solve the common use case to display a feed of photos with their corresponding likes, caption, and comments. It's inspired by Instagram feed table view.


Example Project

We're using cocoapods to update the existing 3rd party libraries (Pods) in the sample code:

$ pod install

Then, open STXDynamicTableViewExample.xcworkspace to build and run.


Usage

Import the whole STXDynamicTableView source files into your project, and import the main header file:

 #import "STXDynamicTableView.h"

Supply your table view in the view controller, then set the delegate and data source:

STXFeedTableViewDataSource *dataSource = [[STXFeedTableViewDataSource alloc] initWithController:self tableView:self.tableView];
self.tableView.dataSource = dataSource;
self.tableViewDataSource = dataSource;

STXFeedTableViewDelegate *delegate = [[STXFeedTableViewDelegate alloc] initWithController:self];
self.tableView.delegate = delegate;
self.tableViewDelegate = delegate;

Populate your data models to the table view data source:

NSDictionary *instagramPopularMediaDictionary = jsonObject;
if (instagramPopularMediaDictionary) {
    id data = [instagramPopularMediaDictionary valueForKey:@"data"];
    NSArray *mediaDataArray = data;
    
    NSMutableArray *posts = [NSMutableArray array];
    for (NSDictionary *mediaDictionary in mediaDataArray) {
        STXPost *post = [[STXPost alloc] initWithDictionary:mediaDictionary];
        [posts addObject:post];
    }
    
    self.tableViewDataSource.posts = [posts copy];
    
    [self.tableView reloadData];
}

Your data models need to conform to STXPostItem , STXCommentItem , and STXUserItem to be able to use the built-in table view data source and delegate.


Background

Read Rebuilding Instagram feed table view to understand the challenges, difficulties, and how do we solve the issue of rebuilding the table view style popularized by Instagram app with Auto Layout.


TODO


Disclaimer

STXDynamicTableView is simply a reusable code that you can use in your own project for any purpose as outlined in the LICENSE file. It's not a fully-fledged library, although we're taking steps to go there as time allows.


##Feedback We'd love to hear feedback. Create Github issues, pull requests, or hit us up on Twitter .


Credits

This project uses the following 3rd party libraries:


License

STXDynamicTableView is available under the MIT license. See the LICENSE file for more info.

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본