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
- Host: GitHub
- URL: https://github.com/boraseoksoon/bsfloatlistview
- Owner: boraseoksoon
- License: mit
- Created: 2019-02-10T15:32:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-13T11:11:54.000Z (almost 6 years ago)
- Last Synced: 2025-03-28T03:03:11.770Z (6 months ago)
- Topics: cocoa, cocoa-touch, custom, customui, floating, ios, library, popsup, popup, swift, swift4-2, uicollectionview, uitableview
- Language: Swift
- Size: 244 KB
- Stars: 20
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BSFloatListView
[](https://travis-ci.org/boraseoksoon@gmail.com/BSFloatListView)
[](https://cocoapods.org/pods/BSFloatListView)
[](https://cocoapods.org/pods/BSFloatListView)
[](https://cocoapods.org/pods/BSFloatListView)
![]()
![]()
Click youtube image below to watch BSFloatListView sample in action.
## 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.