GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - litso/Sections: Library for partitioning data suitable for TableViews

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
Example
Example
 
 
Sources/Sections
Sources/Sections
 
 
Tests/SectionsTests
Tests/SectionsTests
 
 
.gitignore
.gitignore
 
 
.ruby-version
.ruby-version
 
 
.swiftlint.yml
.swiftlint.yml
 
 
.travis.yml
.travis.yml
 
 
Dangerfile.swift
Dangerfile.swift
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE
LICENSE
 
 
Mintfile
Mintfile
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 
Sections.podspec
Sections.podspec
 
 

Repository files navigation

Sections

CI Status Version License Platform

Example

To run the example project, clone the repo and open Example/Sections.xcodeproj in Xcode. It references the local Sections Swift package directly, so there is nothing else to install.

Requirements

  • Swift 6.0 or newer
  • iOS 13 or newer
  • macOS 10.15 or newer

Usage

Section stores application-level metadata for a table or collection-view section. Item values only need to conform to Identifiable; they do not need to conform to Hashable.

enum ProfileSectionID: Hashable {
    case friends
}

struct Friend {
    let id: String
    let name: String
}

enum Item: Identifiable {
    case friend(Friend)

    var id: String {
        switch self {
        case .friend(let friend):
            return friend.id
        }
    }
}

let friends = [Friend(id: "alice", name: "Alice")]
let section: Section<ProfileSectionID, Item> = Section(
    .friends,
    title: "Friends",
    items: friends.map(Item.friend)
)

Section and item identifiers must be unique when constructing a SectionBuilder result so it can be used safely with diffable snapshots.

Installation

Sections is available through CocoaPods or SPM.

Author

Robert Manson, [email protected]

License

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

About

Library for partitioning data suitable for TableViews

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.