Reel Search is a Swift 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
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction ?? Awesome search view, written in Swift 5.0, appears search view like Pinteres

Kyle Yi 1.2k Dec 17, 2022
⚡️ A library of widgets and helpers to build instant-search applications on iOS.

By Algolia. InstantSearch family: InstantSearch iOS | InstantSearch Android | React InstantSearch | InstantSearch.js | Angular InstantSearch | Vue Ins

Algolia 567 Dec 20, 2022
Search jailbreak packages using the Tweakio API, Parcility API or Canister API straight from Cydia, Installer, Sileo and Zebra!

Tweakio Search packages globally directly from your favourite package manager! Works with Cydia, Installer, Zebra and Sileo! How does it work The twea

null 17 Jan 1, 2023
App that uses iTunes Search API with SwiftUI for iOS 15+

ItunesSearchApp App that uses iTunes Search API with SwiftUI for iOS 15+ Documentation iTunes Search API: https://developer.apple.com/library/archive/

Karin Prater 22 Dec 25, 2022
Safari Web Extension to customize your search engine.

Safari Web Extension to customize your search engine. Search queries made from the Safari address bar are appended to the custom search engine URL. No

Marvin Häuser 3 Nov 16, 2022
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 72 Feb 4, 2022
AGCircularPicker is helpful component for creating a controller aimed to manage any calculated parameter

We are pleased to offer you our new free lightweight plugin named AGCircularPicker. AGCircularPicker is helpful for creating a controller aimed to man

Agilie Team 617 Dec 19, 2022
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

Christoffer Winterkvist 246 Dec 28, 2022
A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed flag

HidesNavigationBarWhenPushed A library, which adds the ability to hide navigation bar when view controller is pushed via hidesNavigationBarWhenPushed

Danil Gontovnik 55 Oct 19, 2022
A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI.

A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI. Many of these helpers are useful even in a pure UIKit project.

SwiftUI+ 6 Oct 28, 2022
A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize.

SwiftUI Drawer A SwiftUI bottom-up controller, like in the Maps app. Drag to expand or minimize. Contents Add the Package Basic Usage Examples Credits

Michael Verges 695 Jan 3, 2023
Infinite paging controller, scrolling through contents and title bar scrolls with a delay

PageController PageController is infinite paging controller, scrolling through contents and title bar scrolls with a delay. Then it provide user inter

Hirohisa Kawasaki 408 Nov 28, 2022
Page view controller with bounce effect

BouncyPageViewController Page view controller with bounce effect inspired by motion design by Stan Yakushevish. Quickstart Create a queue of UIViewCon

Bohdan Orlov 843 Oct 17, 2022
iOS custom controller used in Jobandtalent app to present new view controllers as cards

CardStackController iOS custom controller used in the Jobandtalent app to present new view controllers as cards. This controller behaves very similar

jobandtalent 527 Dec 15, 2022
ElongationPreview is an elegant UI push-pop style view controller

ElongationPreview is an elegant UI push-pop style view controller

Ramotion 886 Dec 19, 2022
📖 A simple, highly informative page view controller

TL;DR UIPageViewController done properly. ⭐️ Features Simplified data source management & enhanced delegation. Dynamically insert & remove pages. Infi

UI At Six 1.8k Dec 24, 2022
Pull up controller with multiple sticky points like in iOS Maps

PullUpController Create your own pull up controller with multiple sticky points like in iOS Maps Features Multiple sticky points Landscape support Scr

Mario Iannotta 1.2k Dec 22, 2022
Provides an iOS view controller allowing a user to draw their signature with their finger in a realistic style.

Swift version now available! Mimicking pen-on-paper signatures with a touch screen presents a difficult set of challenges. The rate touch events are e

Uber Open Source 1.3k Jan 6, 2023