LazyHList: Horizontal list with lazy loading with dequeueing

Related tags

Layout LazyHList
Overview

LazyHList

LazyVStack and LazyHStack does load content lazly however they do not use dequeeing logic. If you have thousands of views, SwiftUI will create and keep them all in memory.

LazyHList uses CollectionView under the hood to bring lazy loading and dequeeung into SwiftUI

Installation

Install using Swift Package Manager.

Example of usage

import SwiftUI

struct Model: Identifiable {
    let id: String
    let imageUrl: String = "https://picsum.photos/200"
}

struct HListViewCell : View {

    let model: Model

    init(model: Model) {
        self.model = model
        debugPrint("🟢 Creating cell: \(model.id)")
    }

    var body: some View {
        AsyncImage(url: URL(string: model.imageUrl))
            .frame(width: 100, height: 100)
            .clipped()
    }
}

struct HListView: View {

    private var items: [Model] {
        return (0...200).map { Model(id: $0.description) }
    }

    var body: some View {
            LazyHList(
                items: self.items,
                itemSize: .fixed(.init(width: 100, height: 100)),
                itemSpacing: .init(mainAxisSpacing: 10, crossAxisSpacing: 30),
                cell: HListViewCell.init)
                .frame(height: 100)
    }
}

struct HListView_Previews: PreviewProvider {

    static var previews: some View {
        HListView()
    }
}
You might also like...
A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.

SwiftUIAsyncContentView A SwiftUI view for dynamically rendering content based upon "loading", "error", and "completed" data loading states.. Installa

A horizontal scroll dial like Instagram.
A horizontal scroll dial like Instagram.

HorizontalDial Preview Requirements iOS 8.0+ Swift 5 Storyboard support Installation CocoaPods use_frameworks! pod "HorizontalDial" Manually To instal

UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.
UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.

MultiSlider UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizo

BMPlayer - A video player for iOS, based on AVPlayer, support the horizontal, vertical screen
BMPlayer - A video player for iOS, based on AVPlayer, support the horizontal, vertical screen

A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.

Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

SlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageVi

A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

A fully customizable iOS Horizontal PickerView library, written in pure swift
A fully customizable iOS Horizontal PickerView library, written in pure swift

ADDatePicker is Horizontal Date Picker Library written in Swift Requirements Communication Installation Usage Demo Customization Credits License Requi

A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

The horizontal swiping navigation like on Facebook Messenger.
The horizontal swiping navigation like on Facebook Messenger.

UIMenuScroll UIMenuScroll creating menu how on Facebook Messenger on take photo Installation CocoaPods is a dependency manager for Cocoa projects. You

Easily add vertical and horizontal pull to refresh to any UIScrollView. Can also add multiple pull-to-refesh views at once.

This is a fork from the famous SVPullToRefresh pod with 2 additional functionalities: Can add multiple pull-to-refresh views into one single UIScrollV

A structured vertical/horizontal stack layout
A structured vertical/horizontal stack layout

EEStackLayout A vertical stackview which takes subviews with different widths and adds them to it's rows with paddings, spacings etc. Installation Coc

A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility.
A simple and flexible way to add source of overlapping circular pictures, currently supports horizontal overlapping or distant pictures with great layout flexibility.

THIS PROJECT IS NO LONGER MAINTAINED. STILL ONE ONLY BEST UI SOLUTION FOR UIKIT DEVELOPERS. SOON WILL COME UP WITH SWIFTUI STILL CONTRIBUTORS ARE WELC

App store style horizontal scroll view
App store style horizontal scroll view

ASHorizontalScrollView App store style horizontal scroll view It acts similar to apps sliding behaviours in App store. There are both Objective-C (do

Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.

SlideController is a simple and flexible UI component fully written in Swift. Built using power of generic types, it is a nice alternative to UIPageVi

UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.
UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizontal.

MultiSlider UISlider clone with multiple thumbs and values, range highlight, optional snap intervals, optional value labels, either vertical or horizo

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time
Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time

Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured.

A flexible collection view with proper horizontal layout flow
A flexible collection view with proper horizontal layout flow

FlexCollection A very simple flexible collection view using SwiftUI that automat

Horizontal and Vertical collection view for infinite scrolling that was designed to be used in SwiftUI
Horizontal and Vertical collection view for infinite scrolling that was designed to be used in SwiftUI

InfiniteScroller Example struct ContentView: View { @State var selected: Int = 1 var body: some View { InfiniteScroller(direction: .ve

Swift-HorizontalPickerView - Customizable horizontal picker view component written in Swift for UIKit/iOS

Horizontal Picker View Customizable horizontal picker view component written in

Releases(1.0.0)
Owner
Sezer Tunca
Engineer and contributor
Sezer Tunca
A flexible collection view with proper horizontal layout flow

FlexCollection A very simple flexible collection view using SwiftUI that automat

null 1 Dec 29, 2021
Horizontal and Vertical collection view for infinite scrolling that was designed to be used in SwiftUI

InfiniteScroller Example struct ContentView: View { @State var selected: Int = 1 var body: some View { InfiniteScroller(direction: .ve

Serhii Reznichenko 5 Apr 17, 2022
Circle Loading View Pod

CircleLoadingViewPod Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installati

null 0 Nov 24, 2021
A curated list of Open Source example iOS apps developed in Swift

 A curated list of Open Source example iOS apps developed in Swift. An amazing list for people who are beginners and learning ios development and for ios developers who need any example app or feature.

Jogendra 752 Dec 31, 2022
RMIT SSET Contact List iOS app!

RMIT SSET Contact List "The Contact List is Long, The Circle is Small!" ?? Description This is an iOS application, inspired from the traditional phone

Tom Huynh 3 Nov 17, 2022
Simple App for Creating and maintaining list of goals to be achieved.

Goal-App Simple App for Creating and maintaing list of goals to be acheived. Created while following this desgin: https://dribbble.com/shots/14772731-

Coding Monkey 2 Aug 28, 2022
A iOS SwiftUI framework for displaying data from an api inside a List.

FeedListKit FeedListKit is a high level framework for representing data from an Api inside a SwiftUi List. It automatically handles refreshing and loa

Knoggl 3 Nov 2, 2022
Lazy image loading for SwiftUI

A missing piece in SwiftUI that provides lazy image loading.

Alexander Grebenyuk 9 Dec 26, 2022
Lazy streams in Swift.

Stream This is a Swift microframework providing a lazy Stream<T> type with generic implementations of ==/!= where T: Equatable. Streams are lazily-pop

Antitypical 82 Jan 29, 2022
Easy background refresh registration, scheduling, execution, and completion. BGTaskScheduler for the lazy.

EasyBackgroundRefresh Easy background refresh registration, scheduling, execution, and completion. BGTaskScheduler for the lazy. Usage For fast refres

Yonat Sharon 6 Dec 5, 2022