RAMReel

1.2.2

:octocat: 🔍 RAMReel is a UI controller that allows you to choose options from a list. Swift UI library made by @Ramotion
Ramotion/reel-search

What's New

2016-05-13T08:12:00Z

header

RAMReel

Swift 2.1 CocoaPods CocoaPods

codebeat badge Travis

Twitter

Controller that allows you to choose options from a list, like in our shot on dribble animated

The iPhone mockup available here.

Requirements

  • iOS 8.0+
  • Swift 2.2

Installation

We recommend using CocoaPods to install our library.

Just put this in your Podfile:

pod 'RAMReel'

Usage

In order to use our control you need to implement the following:

Types

Now you can use those types as generic parameters of type declaration of RAMReel:

RAMReel<CellClass, TextFieldClass, DataSource>

Values

Next you need to create an instance of RAMReel, and for that you need the following:

  • frame: CGRect: Rect, specifying where you want to put the control.
  • dataSource: DataSource: the source of data for the reel.
  • placeholder: String (optional): Placeholder text; by default, an empty string is used.
  • hook: DataSource.ResultType -> Void (optional): Action to perform on element selection, nil by default. You can add additional hooks later, if you need multiple actions performed.

Let's use it to create an instance of RAMReel:

let ramReel = RAMReel<CellClass, TextFieldClass, DataSource>(frame: frame, dataSource: dataSource, placeholder: placeholder, hook: hook)

Putting on the view

And the final step, showing RAMReel on your view:

ramReel.view.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
yourView.addSubview(ramReel.view)

If you have visual problems, try calling prepareForViewing before showing your view.

Like this:

override func viewDidLayoutSubviews() {
	super.viewDidLayoutSubviews()
	ramReel.prepareForViewing()
}

Theming

If you want to change RAMReel look and feel, you can use theming.

To do so, you just to have to implement the Theme protocol in your class/structure and set your RAMReel object's theme property to your theme.

Or you can just use the predefined instance of type RAMTheme.

let textColor: UIColor
let listBackgroundColor: UIColor
let font: UIFont

let theme = RAMTheme(textColor: textColor, listBackgroundColor: listBackgroundColor, font: font)

Docs

CocoaPods

See more at RAMReel docs

About

The project maintained by app development agency Ramotion Inc. See our other open-source projects or hire us to design, develop, and grow your product.

Twitter URL Twitter Follow

Description

  • Swift Tools 3.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Nov 11 2024 06:47:32 GMT-1000 (Hawaii-Aleutian Standard Time)