Skip to content

shubham14896/SGSelectionModal

Repository files navigation

SGSelection Modal

SGSelection Modal is a lightweight framework for Selecting out single/multiple value from a list.

Version Swift 3.0 License Author Shubham Gupta

About

Having trouble selecting out which state/city/{list} user/{entity} belongs to ??? Here's what you need, A lightweight framework built for selecting out a single/multiple values from a list.Built in using UIView, UIAnimations, ScrollView, UIButton.
Initiate a object, add items to object, override closures and you are good to go.

Features

  • Single Select.
  • Dynamic Width.
  • Works on Landscape & Portrait Mode.
  • Initiate with Selected Index.

Requirements

  • iOS 11.0+
  • Xcode 9.0
  • Swift 3.0+

Installation

CocoaPods

Add following pod to project podfile.

  pod ’SGSelectionModal’

Manually

Download following files & add to your project.

  • SGModal.swift.
  • SGModalItem.swift.
  • SGRadioButton.swift.

Usage example

import SGSelectionModal

var selectedIndex: Int = 0

func showModal(){

  let modal = SGModal(title: "Select Country", closeButtonTitle: "Close")
  modal.width = 300
  modal.selectedIndex = selectedIndex
  
      for (index, state) in StateList.states.enumerated() {
              modal.addItem(item: state) {
                  () in
                  print(state)
                  self.selectedIndex = index
              }
       }
       
  modal.show()
}

Preview

Contribute

Any contribution to SGSelection Modal will be appreciated, check the LICENSE file for more info.

Meta

Shubham Gupta – @shubham14896shubham9032@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/shubham14896

About

A lightweight framework built for selecting out a single/multiple values from a list.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published