TextFieldClass: Any subclass of UITextField will do.
DataSource: Your type must implement the FlowDataSource protocol, with QueryType being String and ResultType being Renderable and Parsable. Or you can just use our predefined class SimplePrefixQueryDataSource, which has its ResultType set to String.
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.
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)
REEL SEARCH
Reel Search is a Swift UI controller that allows you to choose options from a list
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.
Stay tuned for the latest updates:
RAMReel
Requirements
Installation
We recommend using CocoaPods to install our library.
Just put this in your
Podfile:or Carthage users can simply add
reel-searchto theirCartfile:Usage
In order to use our control you need to implement the following:
Types
CellClass: Your cell class must inherit fromUICollectionViewCelland implement theConfigurableCellprotocol. Or you can just use our predefined classRAMCell.TextFieldClass: Any subclass ofUITextFieldwill do.DataSource: Your type must implement theFlowDataSourceprotocol, withQueryTypebeingStringandResultTypebeingRenderableandParsable. Or you can just use our predefined classSimplePrefixQueryDataSource, which has itsResultTypeset toString.Now you can use those types as generic parameters of type declaration of
RAMReel: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,nilby default. You can add additional hooks later, if you need multiple actions performed.Let’s use it to create an instance of
RAMReel:Adding action hooks
To add extra actions you may append
DataSource.ResultType -> Voidfunctions toRAMReelobject propertyhooks:Putting on the view
And the final step, showing
RAMReelon your view:If you have visual problems, try calling
prepareForViewingbefore showing your view.Like this:
Theming
If you want to change
RAMReellook and feel, you can use theming.To do so, you just to have to implement the
Themeprotocol in your class/structure and set yourRAMReelobject’sthemeproperty to your theme.Or you can just use the predefined instance of type
RAMTheme.Docs
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.