Latest 0.1.2
Homepage https://github.com/boraseoksoon/BSFloatListView
License MIT
Platforms ios 10.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

BSFloatListView
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.

Latest podspec

{
    "name": "BSFloatListView",
    "version": "0.1.2",
    "summary": "BSFloatListView: Amazing Floating List View?",
    "description": "BSFloatListView may be amazing floating list view that works like a charm!",
    "homepage": "https://github.com/boraseoksoon/BSFloatListView",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/boraseoksoon/BSFloatListView.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.2",
    "source_files": "BSFloatListView/Classes/**/*",
    "frameworks": "UIKit",
    "resources": [
        "BSFloatListView/Assets/*.xib"
    ],
    "resource_bundles": {
        "BSFloatListView": [
            "BSFloatListView/Assets/*"
        ]
    }
}

Pin It on Pinterest

Share This