Giter Club home page Giter Club logo

reel-search's Introduction

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.



reel-search's People

Contributors

0ber avatar aleksei1000000 avatar alexmik89 avatar artemkyslicyn avatar boraseoksoon avatar igork-ramotion avatar ikolpachkov avatar juriv avatar ramotiondev avatar ramotionrussell avatar ronnielsen avatar skogetroll avatar vlondon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reel-search's Issues

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.

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...

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)`

improve autosuggestion logic

if there is a suggestion with 2 or more words like "creative director" when you want to enter just "creative" it selects "creative director". To avoid this I suggest to automatically select the word that user enters, and tap on the screen to select autosuggestion

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.

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!

Fatal Error: Index out of range

Hi Team,

I got Fatal Error:

RAMReelExample[6907:71424] [MC] Reading from private effective user settings.
fatal error: Index out of range

screen shot 2017-03-13 at 12 26 17 pm

datasource

this repo is very beautiful but datasource isn`t enough. if you will add id with text for database. I will happy. I tryed this but I couldnt

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.
johndpope@bdc6190

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.

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

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:

  • Rename defined precedence groups, they're definitely not comparison operators.
  • Precedence group of <&> operator has to be higher than Exponentiative (to keep backward compatibility).
  • Precedence group of *> operator has to be higher than precedence group of <&>

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

Swift 3.0 branch

Hi,

How I can use the lib with swift 3.0? The branch "swift-3.0" is empty.

Thank you,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.