GithubHelp home page GithubHelp logo

boraseoksoon / bsfloatlistview Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 7.0 250 KB

Boring floating list view

License: MIT License

Ruby 4.79% Swift 95.21%
floating ios swift swift4-2 library custom uitableview uicollectionview popsup popup

bsfloatlistview's Introduction

BSFloatListView

CI Status Version License Platform



Click youtube image below to watch BSFloatListView sample in action.
BSFloatListView

Example

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

Requirements

iOS 10.0+
Swift 4.2 +

How to use


First things first,
Step 0. import BSFloatListView

Step 1. Create Instance programmatically as an instance variable
Declare and create instance as an instance variable as below.
BSFloatListView is only supported in a programmatical way.

/**
* initiating floatListView instance..
/// Used to create floatList instance from nib file to return.
///
/// - warning:  Mind whether isSticky is true or false will make difference of usage. Check detail in example source.
/// - parameter observedTouchView: a targetView to react on.
/// - parameter dataList: string array to display on the list.
/// - parameter touchDetectionMode: choose recognizer type for either short tap(.short) or long press(.long)
/// - parameter isSticky: if true, rather than floating around, stick to and show floatListView on a given observedTouchView in the first parameter.
/// - returns: BSFloatListView instance
*/

private lazy var floatListView: BSFloatListView = { [unowned self] in
  let floatListView = BSFloatListView.initialization(
    on:
      observedTouchView,  // a view to stick to and to focus on.
    with:
      dataList, // data list to show in the BSFloatListView ["Java", "Swift", "Scala", "Kotlin", "C++", "Clojure"] 
    touchDetectionMode:
      touchDetectionMode, // either .short or .long. if you want long press to invoke BSFloatListView, go for .long.  
    isSticky:
      isSticky // true
    )
    
    /// a closure for which list to choose.
    floatListView.didSelectRowAtClosure = { [unowned self] indexPath in
      print("clicked at : ", indexPath.row)
    }
  return floatListView
}()

isSticky is important.
If isSticky is true, BSFloatListView just keeps staying at CGPoint(x:0, y:0) of observedTouchView you specified regardless of which location a user tapped to use BSFloatListView within the observedTouchView frame.
Otherwise, BSFloatListView just follows a location a user tapped within the observedTouchView frame.

Step 1. In viewDidLoad, apply readyToUse() method to get ready to show BSFloatListView.
Just like below.
override func viewDidLoad() {
  super.viewDidLoad()

  /**
  * Ready to use BSFloatListView
  */
  floatListView.readyToUse()
}

That's all! Just enjoy BSFloatListView! :)

Installation

BSFloatListView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BSFloatListView'

Author

[email protected]

License

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

bsfloatlistview's People

Contributors

boraseoksoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.