Skip to content

Latest commit

 

History

History
83 lines (67 loc) · 4.29 KB

README.md

File metadata and controls

83 lines (67 loc) · 4.29 KB

Arena SwiftUI App

Notes

Model / Retrieving JSON Logic

Priority of preview: - Title - title - generated_title - Description - description - Image - Image - Content - Source - source.url - source.title

Priority of block preview: - Image - Text Content (need custom view for this) - Attachment - Embed - Put title below block (like in Are.na)

Fetching paginated data:

ScrollView {
    LazyVStack {
        ForEach(...) {
            // more code here...
        }
        .onAppear {
            if item.id == items.last.id { fetchMoreData() }
        }
    }
}
- Wrap your list of items in a lazy view (LazyVGrid, LazyHGrid, etc.)
- Wrap each item in a NavigationLink if you want
- Attach .onAppear modifier to each item, and call loadMore() function when last item is in view (i.e. its ID matches last item in current list of items)

Architecture

MVVM

This project utilizes the MVVM (Model, View, ViewModel) architecture for orchestrating flow of data and maintaining lifecycle of screens.

Most of the data fetching logic can be found in the Data folder, with "data fetcher" classes for each important component used in the app (Are.na channels, blocks, etc.)

Are.na specific resources

Resources

Honestly this is just a running documentation of the basic / slightly more complex things I have to look up to achieve a certain function for the app