reel-search

:octocat: ? RAMReel is a UI controller that allows you to choose options from a list. Swift UI library made by @Ramotion - https://github.com/Ramotion/swift-ui-animation-components-and-libraries

Github stars Tracking Chart


RAMReel

Swift 4.0
CocoaPods
CocoaPods
Carthage compatible
codebeat badge
Travis
Twitter
Donate

Requirements

  • iOS 8.0+
  • Swift 4.0

Installation

We recommend using CocoaPods to install our library.

Just put this in your Podfile:

pod 'RAMReel'

or Carthage users can simply add reel-search to their Cartfile:

github "Ramotion/reel-search"

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)

Adding action hooks

To add extra actions you may append DataSource.ResultType -> Void functions to RAMReel object property hooks:

ramReel.hooks.append { data in
	// your code goes here
}

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

? License

Reel Search is released under the MIT license.
See LICENSE for details.

This library is a part of a selection of our best UI open-source projects.

If you use the open-source library in your project, please make sure to credit and backlink to www.ramotion.com

? Get the Showroom App for iOS to give it a try

Try this UI component and more like this in our iOS app. Contact us if interested.

Main metrics

Overview
Name With OwnerRamotion/reel-search
Primary LanguageSwift
Program languageSwift (Language Count: 3)
Platform
License:MIT License
所有者活动
Created At2015-04-02 08:51:50
Pushed At2020-04-06 06:56:52
Last Commit At2020-04-06 09:56:51
Release Count44
Last Release Name4.1.0 (Posted on 2019-11-12 03:31:33)
First Release Name0.9.0 (Posted on 2015-04-24 18:59:41)
用户参与
Stargazers Count2.5k
Watchers Count53
Fork Count183
Commits Count186
Has Issues Enabled
Issues Count20
Issue Open Count4
Pull Requests Count7
Pull Requests Open Count1
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private