An open API service indexing awesome lists of open source software.

https://github.com/boraseoksoon/bsfloatlistview

Boring floating list view
https://github.com/boraseoksoon/bsfloatlistview

cocoa cocoa-touch custom customui floating ios library popsup popup swift swift4-2 uicollectionview uitableview

Last synced: 6 months ago
JSON representation

Boring floating list view

Awesome Lists containing this project

README

          

# BSFloatListView

[![CI Status](https://img.shields.io/travis/boraseoksoon@gmail.com/BSFloatListView.svg?style=flat)](https://travis-ci.org/boraseoksoon@gmail.com/BSFloatListView)
[![Version](https://img.shields.io/cocoapods/v/BSFloatListView.svg?style=flat)](https://cocoapods.org/pods/BSFloatListView)
[![License](https://img.shields.io/cocoapods/l/BSFloatListView.svg?style=flat)](https://cocoapods.org/pods/BSFloatListView)
[![Platform](https://img.shields.io/cocoapods/p/BSFloatListView.svg?style=flat)](https://cocoapods.org/pods/BSFloatListView)






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.

```Swift
/**
* 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.

```Swift
override func viewDidLoad() {
super.viewDidLoad()

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

```



That's all! Just enjoy BSFloatListView! :)

## Installation

BSFloatListView is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'BSFloatListView'
```

## Author

boraseoksoon@gmail.com

## License

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