GithubHelp home page GithubHelp logo

simpleuilist's Introduction

SimpleUIList

A simple UITableView implementation for SwiftUI.

Description

SimpleUIList is a simple UITableView wrapper designed for usage in SwiftUI, specifically focused in chat applications. This was inspired by multiple issues found while implementing a chat list in SwiftUI, such as starting the list at the bottom for different iOS versions, performance problems and reversing list issues with contextMenu. All of those are solved with SimpleUIList!

Another cool feature is that it maintains the contentOffset when updating the first element of the data in the UITableView (when the list is reversed).

Support: iOS 13+

Usage

To use SimpleUIList, import the module and pass the information you want to display along with the corresponding view.

import SwiftUI 
import SimpleUIList

let myData = [Model1(), Model1(), Model3()]

var body: some View {
    SimpleUIList(myData.reversed()) { item in
        Text("\(item.property)")
    }
    .startAtBottom(true)
    .reverseList(true)
}
  • startAtBottom: This starts the list at the bottom of the UITableView.

  • reverseList: This reverses the order of the elements in the UITableView. This feature is particularly beneficial for a chat application, where you'd want to maintain the scroll position when the keyboard appears (like Telegram, Whatsapp, etc.).

Installation

SimpleUIList is available as a swift package. Add it to your project in Xcode using its GitHub repository url.

https://github.com/dancarvajc/SimpleUIList.git

License

MIT License

Please feel free to contribute and open issues.

simpleuilist's People

Contributors

dancarvajc avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

hauntii

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.