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)
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 Multiplexer - referenced API calls and organization
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
- Preserve tab bar background when navigating between views
- onChange deprecations and updates in iOS 17
- Infinite Scrollview with paginated API
- Swift API Calls 1
- Swift API Calls 2
- LazyVStack, VStack and List Performance
- Programmatic toolbar
- Using TabViews
- Debouncing search manually
- Debouncing search with a library
- Custom search input style
- Optimizing work in iOS runtime
- Change background of View
- Dismiss keyboard on scroll
- Supporting different view size (iPad, iPhone, split screen, etc.)
- Perform action when view is within viewport, not naively using
.onAppear
- Vertically center content in ScrollView
- Show duplicate items in ForEach, needed because Are.na API block search could return duplicates
- Custom clip shapes
- Implementing haptics
- Light / Dark / System mode switcher
- Decoding array with multiple object types