🔍 RAMReel is a UI controller that allows you to choose options from a list.

Overview

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

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.



Comments
  • textfield move the position when active

    textfield move the position when active

    I change the position of textfield like this:

    RAMReel(frame: CGRect(origin: CGPoint(x: 0, y: 100), size: CGSize(width: self.view.bounds.width, height: 100.0)), dataSource: dataSource, placeholder: "Start by typing…")

    but when typing... the position goes to bottom...

    opened by albertml 9
  • Tap textField to select (like in the gif) ?

    Tap textField to select (like in the gif) ?

    I love this component, sleek and works awesome; but there is something I don't think is working. In the gif, the user can scroll the collection and tap the textField, so the option shown behind it is selected. It seems at the moment this is not working, so there is no easy way to select the option shown behind the textfield. Furthermore, when I tap done in the keyboard, I only get the textField content; whereas I would expect to get the option that is being "suggested". Is there anyway this functionality might be included again? Or maybe I'm missing the point of the component ;p

    opened by andres-cianio 3
  • Case-insensitive  input matching?

    Case-insensitive input matching?

    I can't seem to figure out how to do case-insensitive input matching. By this, I mean I would like a input of "michael" to show all possible inputs like "Michael". This doesn't have to be added now. I'd at least like to know where is best to make that change.

    opened by Lwdthe1 3
  • Doesn't work with swift 4.1 on xcode

    Doesn't work with swift 4.1 on xcode

    I've been trying to get this plugin in, as well as your one here: https://github.com/Ramotion/animated-tab-bar

    I'm running on Xcode 9.4.1, using Swift 4.1 for my project, and using IOS 11.4. I tried to pull your project here and I get a bunch of compile errors when I try to build the project. I can put screencaps of the errors I'm getting if necessary. Any help is greatly appreciated!

    opened by tnishida1 2
  • [FIX] retain-cycle memory leak issue solved.

    [FIX] retain-cycle memory leak issue solved.

    Some critical closure retain-cycle causing memory leak issues were fixed where scrollDelegate and textFieldTarget capture closure making strong reference.


    To give background story a little in advance, I am using my own customization based on reel-search for application that will be released V1.0 soon :) (named : 'All Dayz') Thank you for the awesome repository and I am very glad to try pull request to this.

    To explain the pull request, I fixed some critical memory leak issues caused by closure memory retain cycle. It can be very easily reproduced if instead of existing sample example using Single ViewController, we use root-navigation controller having ViewController1 and push ViewController2 having reel-search and back to VC1. Using navigation controller, if we test push and pop current single ViewController example, memory is not released after pop. for example, it increases more than like 500MB after push and pop 3 times since data.txt is huge data set. That means, this memory leak issue occurs in real project unavoidably except for the case where we only use single VC app having reel-search.

    Below is the memory leak cases where I push and pop 3 times current reel-search example.

    2018-08-30 00 32 53

    FYI, Memory leak retain cycles cases are categorized as 2 group as below attached : (1) TextFieldTarget, NotificationCallbackWrapper case 2018-08-29 23 33 55

    (2) ScrollDelegate case 2018-08-29 23 11 25

    I resolved these retain cycles and result is below with same test case above. 2018-08-30 00 44 42

    I hope it helps, Thank you!

    opened by boraseoksoon 1
  • ui blocking on textfield entry defects

    ui blocking on textfield entry defects

    so when I type - the keyboard ui blocks self.editingTarget = TextFieldTarget(controlEvents: UIControlEvents.EditingChanged, textField: textField) { if let text = $0.text {

                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0)) {
                   dataFlow.transport(text)
                }
    

    2016-05-03 11:33:56.369 RAMReelExample[346:42807] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release. Stack:( 0 CoreFoundation 0x0000000182c5ae50 + 148 1 libobjc.A.dylib 0x00000001822bff80 objc_exception_throw + 56 2 CoreFoundation 0x0000000182c5ad80 + 0 3 Foundation 0x000000018370bafc + 88 4 Foundation 0x000000018370b9c0 + 56 5 Foundation 0x00000001835911ec + 56 6 Foundation 0x000000018358fa44 + 816 7 Foundation 0x000000018358f5cc + 284 8 Foundation 0x000000018358d1c8 + 228 9 UIKit 0x0000000187ea9958 + 468

    While not an ideal fix for your react pattern - I've hacked around this by doing searching on background thread. But it's not stable in conjunction with scrolling. https://github.com/johndpope/reel-search/commit/bdc6190411cc0b88cb0b774c2aa65b7d00141ba1

    so on closer inspection - you're calling adjustScroll /updateOffset too much

    func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
        scrollTo = scrollView.contentOffset.y
        adjustScroll(scrollView)
    }
    
    func adjustScroll(notification: NSNotification? = nil) {
        collectionView.contentInset = UIEdgeInsetsZero
        collectionLayout.updateInsets()
        self.updateOffset(notification)
    }
    

    which is then calling ->>>>>>

    func updateOffset(notification: NSNotification? = nil) {
            self.collectionView.reloadData() // THIS IS EXPENSIVE 
             self.collectionView.layoutIfNeeded()  // THIS IS EXPENSIVE 
    

    You're effectively reloading the tableview every time the user touches the screen.

    opened by johndpope 1
  • Set selected item index even for the noScroll case.

    Set selected item index even for the noScroll case.

    Sorry, the previous pull request (https://github.com/Ramotion/reel-search/pull/27) did brake selected item functionality. There is no need to scroll, but the selected item still should be set.

    opened by vlondon 0
  • [FIX] in theory, closure container may be deallocated in run-time

    [FIX] in theory, closure container may be deallocated in run-time

    I found out I missed something, There is some possibility, which is in theory, these two closure containers may be possible to be deallocated in run-time because of weak var. I think it'd be better that self should be weak rather than closure container variable itself. So, I tried to trim a bit, keeping same execution.

    Thanks!

    opened by boraseoksoon 0
  • Use typed value when no matched value was found

    Use typed value when no matched value was found

    Hello. I have checked your readme page, but did not understand if the following can be implemented with your cute framework.

    I want to create TextField with search, just like your framework does. But if user types value that is not presented in searched results, I want to use it. Can this be done by default?

    Sorry for stupid question. Have not yet tried to implement it, just looking for possible ways to do this.

    opened by DJ-Glock 0
  • WTH?! Check your precendences!

    WTH?! Check your precendences!

    RAMReel/Framework/DataFlow.swift:

    +precedencegroup ComparisonPrecedence {
    +  higherThan: LogicalConjunctionPrecedence
    +}
    
    -infix operator *> { precedence 180 }
    +infix operator *> : ComparisonPrecedence
    

    RAMReel/Framework/TextFieldReactor.swift:

    +precedencegroup ComparisonPrecedence {
    +  higherThan: LogicalConjunctionPrecedence
    +}
    
    -infix operator <&> { precedence 175 }
    +infix operator <&> : ComparisonPrecedence
    

    First: How are those operators became Comparison operators? Second: Comparison operators in Swift 1-2 had precedence 130, defined operators — 180 and 175. 180 > 130 and even 175 > 130. Third: 180 != 175 and 175 != 180. Why in hell they're in same precedence group?

    What has to be done:

    • [x] Rename defined precedence groups, they're definitely not comparison operators.
    • [x] Precedence group of <&> operator has to be higher than Exponentiative (to keep backward compatibility).
    • [x] Precedence group of *> operator has to be higher than precedence group of <&>
    opened by Skogetroll 0
  • Suggestions only below textfield as in Demo gif

    Suggestions only below textfield as in Demo gif

    When using your library with the example it puts the suggestions above, below and in the actual textfield without user interaction.

    Is it possible to configure your library to behave as in the demo gif, so that the user first needs to scroll down to fill the textfield with a suggestion?

    Thanks

    opened by ph1lb4 0
  • would this be possible to be used with with coreLocation Search

    would this be possible to be used with with coreLocation Search

    would this be possible to be used with with coreLocation Search. Because i would be searching for the location instead of having them on a list like in the example. if so please guide me down the right direction.

    opened by ghost 0
  • Cannot use RAMTheme !

    Cannot use RAMTheme !

    Hello,

    I tried to apply theming in the sample project, then Xcode said

    'RAMTheme' initializer is inaccessible due to 'fileprivate' protection level

    `let textColor: UIColor = .white let listBackgroundColor: UIColor = .blue let font: UIFont = UIFont.systemFont(ofSize: 18)

        ramReel.theme = RAMTheme(textColor: textColor, listBackgroundColor: listBackgroundColor, font: font)`
    
    opened by haithngn 0
Releases(1.2.2)
Owner
Ramotion
UI Engineering, UI/UX Design and Front-End Development Agency
Ramotion
🔍 An elegant search controller which replaces the UISearchController for iOS (iPhone & iPad) .

?? An elegant search controller for iOS. QQ chat room Features Support a variety of hot search style Support a variety of search history style Support

mamba 3.8k Jan 8, 2023
UITextField subclass with autocompletion suggestions list

SearchTextField Overview SearchTextField is a subclass of UITextField, written in Swift that makes really easy the ability to show an autocomplete sug

Alejandro Pasccon 1.1k Dec 28, 2022
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

Vladimir Kokhanevich 95 Nov 24, 2022
Text entry controls which contain a built-in title/label so that you don't have to add a separate title for each field.

FloatLabelFields Overview Installation Via Interface Builder Via Code Credits Additional References Questions Overview FloatLabelFields is the Swift i

Fahim Farook 1.2k Jan 4, 2023
Reel Search is a Swift UI controller that allows you to choose options from a list

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

Ramotion 2.5k Dec 21, 2022
A Swift library to design custom prompts with a great scope of options to choose from.

Installation CocoaPods Install with CocoaPods by adding the following to your Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios,

Gabriel Alvarado 736 Nov 3, 2022
Rock - Paper - Scissors game. CPU gives you a sign and asks to win or lose your move. Than you have to decide witch sign do you choose to score a point

RockPaperScissors 2nd challange from HackingWithSwift.com. The CPU gives you a sign (rock, paper or scissors) and asks you either to win or to lose th

Pavel Surový 0 Nov 27, 2021
🎚️ STDiscreteSlider – slider which allows user to choose value only from predefined set of data.

STDiscreteSlider – slider which allows user to choose value only from predefined set of data. Slider may receive any types of options, you may pass set of integers or strings, or any other type. Written using SwiftUI.

Tamerlan Satualdypov 15 Apr 3, 2022
FileExplorer is a powerful iOS file browser that allows its users to choose and remove files and/or directories

FileExplorer (iOS 9.0+) ?? Project created and maintained by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak). Introduction FileExplorer

Rafał Augustyniak 717 Dec 19, 2022
FileExplorer is a powerful iOS file browser that allows its users to choose and remove files and/or directories

FileExplorer (iOS 9.0+) ?? Project created and maintained by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak). Introduction FileExplorer

Rafał Augustyniak 717 Dec 19, 2022
A controller that uses a UIStackView and view controller composition to display content in a list

StackViewController Overview StackViewController is a Swift framework that simplifies the process of building forms and other static content using UIS

Seed 867 Dec 27, 2022
CarListing app allows user to see list of cars on map as well as in the list

Car Listing CarListing app allows user to see list of cars on map as well as in the list. Features See List of cars on map in the home screen. User ca

Niraj Kumar Jha 0 Oct 13, 2021
Provides a custom presentation modifier that provides more options including full screen presentations. (iOS)

Presentation Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ Provides a custom presentation modifier that provides more

SwiftUI+ 15 Dec 3, 2022
A swift library based on the various options menu in material design in Android

KTOptionMenu Description KTOptionMenu is a swift library based on the various options menu in material design in Android that allows you to easily cre

null 1 Jul 21, 2022
A Swift Recreation of Attach-Detach, with some configurable options

Attach-Detach-Sw A Swift Recreation of Attach-Detach, with some configurable options Usage To use, you'll need to specify if you are attaching or deta

Dabezt 1 Dec 24, 2021
A Swift Recreation of Attach-Detach, with some configurable options

Attach-Detach-Sw A Swift Recreation of Attach-Detach, with some configurable options Usage To use, you'll need to specify if you are attaching or deta

Serena 1 Dec 24, 2021
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options.

SwiftyMarkdown 1.0 SwiftyMarkdown converts Markdown files and strings into NSAttributedStrings using sensible defaults and a Swift-style syntax. It us

Simon Fairbairn 1.5k Dec 22, 2022
URL query encoder with OpenAPI serialization options support

URLQueryEncoder A customizable Swift Encoder that encodes instances of data type

Alexander Grebenyuk 31 Nov 30, 2022
Easily take a photo or video or choose from library

FDTake Easily take a photo or video or choose from library ?? Author's tip jar: https://amazon.com/hz/wishlist/ls/EE78A23EEGQB Usage To run the exampl

William Entriken 322 Nov 30, 2022
Easily take a photo or video or choose from library

FDTake Easily take a photo or video or choose from library ?? Author's tip jar: https://amazon.com/hz/wishlist/ls/EE78A23EEGQB Usage To run the exampl

William Entriken 322 Nov 30, 2022