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 - srujanadicharla/SASelectionView: A slide-up view from bottom of the screen displaying multiple rows with the ability to select and search row. This library is written in Swift.

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
Images
Images
 
 
SASelectionView
SASelectionView
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SASelectionView.podspec
SASelectionView.podspec
 
 
_config.yml
_config.yml
 
 

Repository files navigation

SASelectionView

license ios v1.9.3

A lightweight single selection view that slides up from bottom of the screen.

  • Easy to use
  • Sectioned rows
  • Auto adjusting selection view height
  • Auto displying searchbar based on the number of items. (you can hide/show searbar manually too)
  • Gesture control to drag down to dismiss

A list showing cities (rows) of respective states (sections)

Requirements

SASelectionView works on iOS 9 and higher. It depends on the following Apple frameworks, which should already be included with most Xcode templates:

  • Foundation
  • UIKit

Installation

CocoaPods

You can use CocoaPods to install SASelectionView by adding it to your Podfile:

pod 'SASelectionView'

Manually

  • Download and extraxt zip file.
  • Drag and drop Source folder in your project.
  • Done!

Example

import SwiftUI
import SASelectionView

struct ContentView: View {
    
    @State private var selectedText = ""
    
    var body: some View {
        VStack {
            Button(action: {
                self.showSelectionView()
            }) {
                Text("Show List")
            }
            .padding(EdgeInsets(top: 0, leading: 0, bottom: 12, trailing: 0))
            
            Text(selectedText)
        }
        
    }
    
    func showSelectionView() {
        var sections = [SectionItem]()
        sections.append(SectionItem(title: "Texas", options: ["Dallas", "Houston", "Austin", "San Antonio"]))
        sections.append(SectionItem(title: "California", options: ["Los Angeles", "San Francisco", "Sacramento", "San Diago"]))
        sections.append(SectionItem(title: "New York", options: ["New York City", "Albany", "Buffalo"]))
        sections.append(SectionItem(title: "Florida", options: ["Miami", "Orlando", "Jacksonville", "Key West"], disabledIndices: [3:[1,3]]))

        SASelectionView.show(title: "Locations", sections: sections, showSearchBar: true, emptySearchRowTitle: "Item not found. Add this ...", emptyRowHandler: { (notFoundText) in
            print("Not found result: \(notFoundText)")
            self.selectedText = notFoundText
        }) { (section, row, value) in
            self.selectedText = "\(value), \(sections[section].title ?? "")"
        }
    }
}

#if DEBUG
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
#endif

Contribute

If you have feature requests or bug reports, please feel free to help out by sending pull requests or create issues.

License

This code is distributed under the terms and conditions of the MIT license.

About

A slide-up view from bottom of the screen displaying multiple rows with the ability to select and search row. This library is written in Swift.

Topics

actionsheetbottomsheetiosselectionviewswift

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — 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.