Latest 0.0.4
Homepage https://github.com/jack45j/Toppon
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

A lightweight Scroll-To button for iOS UIScrollView, UITabelView, UITextView. Toppon is a subclass of UIButton. Its not only a Scroll-To button but a fully customizable UIButton.

Preview

Features

  • Lightweight
  • Present with different animations.
  • Multiple display modes.
  • Set whatever positions you want.
  • Customizable button icon.
  • Multiple delegate methods.

Installation


CocoaPods

For Swift 4.0

pod 'Toppon'
Manual

Simply copy files in sources folder into your project.

How to use


Initial a Toppon button.

init(initPosition: CGPoint?, size: Int, normalIcon: String?)

Use properties to configure Toppoon

var destPosition: CGPoint? = CGPoint(x:0, y:0)
var presentMode: PresentMode = .always
var scollMode: ScrollMode = .top

Link Toppon to a UIScrollView or its subclass like UITableView and UITextView.

public func linkedTo(UIScrollView: UIScrollView)
Delegate methods
optional func TopponInitiated()
optional func TopponDidPressed()
optional func TopponWillPresent()
optional func TopponWillDismiss()
Present and Dismiss

Call present and dismiss methods when you need it.

public func present()
public func dismiss()
For Example

You can present and dismiss Toppon button in your ScrollViewDelegate.

if scrollview.contentOffset.y >= 30 {
toppon.present()
} else {
toppon.dismiss()
}

License

Toppon is released under the MIT license.
See LICENSE for details.

Author

This project is still work in progress.
Feel free to contact me.
Benson Lin

What features are going to release.

1) Support storyboard
2) Optimize methods and animations
3) Add a Label above/under Toppon button

Latest podspec

{
    "name": "Toppon",
    "version": "0.0.4",
    "summary": "A lightweight Scroll-To button for iOS UIScrollView",
    "swift_version": "4.0",
    "description": "A lightweight Scroll-To button for iOS UIScrollView, UITableView, UITextView. Toppon is a subclass of UIButton. Toppon not only a can be a Scroll-To button but a fully customizable UIButton.",
    "homepage": "https://github.com/jack45j/Toppon",
    "license": "MIT",
    "authors": {
        "jack45j": "[email protected]"
    },
    "social_media_url": "https://www.facebook.com/profile.php?id=100000238070025",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/jack45j/Toppon.git",
        "tag": "0.0.4"
    },
    "source_files": "Sources/*.swift",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This