The right way to increment/decrement values with a simple gesture on iOS.

Overview

barceloneta

CocoaPods Compatible Awesome PRs Welcome

The right way to increment/decrement values

barceloneta is the right way to increment/decrement values with a simple gesture on iOS

Features

  • Customisation for timer and incremental values
  • Easily customisable
  • Horizontal/vertical mode
  • Looping through values or not
  • Customizable dragging limit
  • Minimal/maximal values
  • Complete Documentation

Requirements

  • Autolayout
  • iOS 9.0+
  • Swift 3.0
  • Xcode 8.0 or higher

Communication

  • If you need help, use Stack Overflow. (Tag '#barceloneta')
  • If you'd like to ask a general question, use Stack Overflow.
  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.
  • If you use the control, contact me to mention your app on this page.

Installation

CocoaPods

Barceloneta is now available on CocoaPods. Simply add the following to your project Podfile, and you'll be good to go.

use_frameworks!

pod 'barceloneta', '~> 1.1'

Carthage

Coming soon

Manually

You can integrate barceloneta into your project manually.

Source File

Simply add the Library/Barceloneta.swift source file directly into your project.


Usage

Enabling the gesture (EASY !)

To enable the gesture, it is required to have :

  • A UIView object
  • A NSLayoutConstraint applied to the view, for the vertical position of the view
  • Timer/Incremental settings
  • A delegate (optional)
//Initialise the gesture
barcelonetaView.loops = true
barcelonetaView.minimumValue = 0.0
barcelonetaView.maximumValue = 50.0
let timerSettings = [
    (range: 0..<70, timer: 0.3, increment: 1.0),
    (range: 70..<120, timer: 0.2, increment: 2.0),
    (range: 120..<500, timer: 0.1, increment: 3.0)
]
barcelonetaView.makeElastic(timerSettings: timerSettings,
                            constraint: myNSLayoutConstraint
                            axis: .vertical,
                            delegate: self)

Configuration

That's where the fun begins. Keep in mind that the goal of this library is only to manage the incrementation of values. The display should be managed by you.

Looping of values

Determines if the values will stop on minimumValue/maximumValue.

If looping is enabled, when the maximum value is reached, it will go back to the mimimum value.

And vice-versa.

barcelonetaView.loops = true/false

Minimum/Maximum values

Determines the limits of the increment

barcelonetaView.minimumValue = 0.0
barcelonetaView.maximumValue = 50.0

Dragging limit

This value defines the dragging limit of your barceloneta object. If the user drags the view higher than this limit, a rubber effect will apply. The view will go up/down slower than your finger.

barcelonetaView.draggingLimit = 50.0

Timer Settings

The timerSettings property is an array of objects, defining the timer interval and incremental value for a specific range. It is required to have at least an object in the timer setting.

Depending on the percentage, the matching settings will be applied.

A drag of 100% corresponds to the draggingLimit.

(range:0..<70, timer: 0.3, increment: 1.0)

This setting says that :

Between 0 and 70%, the timer interval for incrementation is 0.3 seconds, and the value incremented is 1.0.

Crash when running the app ?

If you installed barceloneta via CocoaPods and use it with Storyboard/xib, you may need to set the module :

TODO

  • UI Testing

Known issues

Check the (GitHub issues)

FAQ

Why should I use Barceloneta?

You're looking for an innovative way to increment/decrement values

Special thanks

RuberBandEffect

Contact

Creator

License

Barceloneta is released under the MIT license. See LICENSE for details.

You might also like...
Designed for gesture-driven animations. Fast, simple, & extensible!
Designed for gesture-driven animations. Fast, simple, & extensible!

Yet Another Animation Library Designed for gesture-driven animations. Fast, simple, & extensible! It is written in pure swift 3.1 with protocol orient

Gesture recognizer tool [Swift / iOS]
Gesture recognizer tool [Swift / iOS]

DBPathRecognizer Demo Installation Simply add the file DBPathRecognizer.swift to your project Basic usage Start by creating a new DBPathRecognizer ins

Gesture Control for Safari on iOS and iPadOS
Gesture Control for Safari on iOS and iPadOS

Svadilfari Svadilfari brings Gesture Control for Safari on iPhone/iPad. Features Control Safari with Gestures 10+ Customizable Actions Select Patterns

Hand-gesture recognition on iOS app using CoreML
Hand-gesture recognition on iOS app using CoreML

GestureAI-CoreML-iOS Hand-gesture recognizer using CoreML Demo Screenshots This app is using RNN(Recurrent Neural network) with CoreML on iOS11. The m

Awesome IOS Styling with SwiftUI, Animation, Effects, Gesture ⭐️

Awesome SwiftUI Styling with SwiftUI ⭐️ This repository is dedicated to IOS styling using SwiftUI. (often using Other Libraries.) I started collecting

C4 is an open-source creative coding framework that harnesses the power of native iOS programming with a simplified API that gets you working with media right away. Build artworks, design interfaces and explore new possibilities working with media and interaction. iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!
iOS routing done right. Handles both URL recognition and controller displaying with parsed parameters. All in one line, controller stack preserved automatically!

Developed and Maintained by Ipodishima Founder & CTO at Wasappli Inc. (If you need to develop an app, get in touch with our team!) So what is this lib

Swift interpolation for gesture-driven animations
Swift interpolation for gesture-driven animations

Interpolate Interpolate is a powerful Swift interpolation framework for creating interactive gesture-driven animations. Usage The 🔑 idea of Interpola

🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!
🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!

Hands I have always been interested in how I can improve my memory in addition to reading books, and once I came across an interesting technique relat

TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage
TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage

TextDrawer TextDrawer, is a UIView allows you to add text, with gesture, on UIView, or UIImage. About Annotating Images TextDrawer is the easiest way

One gesture, many actions. An evolution of Pull to Refresh.
One gesture, many actions. An evolution of Pull to Refresh.

MNTPullToReact MNTPullToReact is an extended evolution of the famous Pull to Refresh interaction. The main idea comes from a unique question: can the

A UINavigationController's category to enable fullscreen pop gesture with iOS7+ system style.
A UINavigationController's category to enable fullscreen pop gesture with iOS7+ system style.

FDFullscreenPopGesture An UINavigationController's category to enable fullscreen pop gesture in an iOS7+ system style with AOP. Overview 这个扩展来自 @J_雨 同

Drag gesture modifier to easily apply to any view.

SwiftUIDragModifier A description of this package. This is my first SwiftUI Package. It provides a quick way to make any SwiftUI View draggable. After

Card flip animation by pan gesture.

CardAnimation Design from Dribble. 实现思路在这里。 Two Solutions At the begin, I didn't encapsulate code, @luxorules refactor code into class and improve it

a TableView have thumbnail cell only, and you can use gesture let it expands other expansionView, all diy
a TableView have thumbnail cell only, and you can use gesture let it expands other expansionView, all diy

ZYThumbnailTableView #####可展开型预览TableView,开放接口,完全自由定制 #####An expandable preview TableView, custom-made all the modules completely with open API you c

A non gesture blocking, non clipping by default custom scroll view implementation with example code

A non gesture blocking, non clipping by default custom scroll view implementation with example code

OpenSwiftUIViews - A non gesture blocking, non clipping by default custom scroll view implementation with example code.

OpenSwiftUIViews - A non gesture blocking, non clipping by default custom scroll view implementation with example code.

You can dismiss modal by using gesture
You can dismiss modal by using gesture

RPModalGestureTransition You can dismiss modal by using gesture. Usage 1.Define animation You define animator class inherits UIViewControllerAnimatedT

Allows trendy transitions using swipe gesture such as
Allows trendy transitions using swipe gesture such as "swipe back anywhere".

SwipeTransition allows trendy transitions using swipe gesture such as "swipe back". Try the demo on the web (appetize.io): https://appetize.io/app/peb

Comments
Releases(v1.0.3)
Owner
momo
a mix of design and development.
momo
📷A simple and convenient way to manage your webcam's picture settings, right from your menu bar

Viewfinder A simple and convenient way to manage your webcam's picture settings, right from your menu bar. About • Download • Building from Source • C

Lukas Romsicki 31 Dec 25, 2022
HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values

HexColor is a simple extension that lets you initialize UIColors the way they were meant to be initialized: With hex integer values. Requirem

Tuomas Artman 103 Nov 24, 2022
Creating an iOS Library the Right Way

AppCircleSampleProject Installation Cocoapods AppCircleSampleProject is available through CocoaPods. To install it, simply add the following line to y

Ferhan Akkan 3 Aug 1, 2022
UITextField that support currency in the right way.

PLCurrencyTextField Summary PLCurrencyTextField provides simple and user friendly support for the amount in the currency. Usage To start using the com

Łukasz Śliwiński 96 Nov 14, 2022
Observable is the easiest way to observe values in Swift.

Observable is the easiest way to observe values in Swift. How to Create an Observable and MutableObservable Using MutableObservable you can create and

Robert-Hein Hooijmans 368 Nov 9, 2022
The easiest way to observe values in Swift.

Observable is the easiest way to observe values in Swift. How to Create an Observable and MutableObservable Using MutableObservable you can create and

Robert-Hein Hooijmans 368 Nov 9, 2022
PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture.

PinpointKit is an open-source iOS library in Swift that lets your testers and users send feedback with annotated screenshots using a simple gesture. F

Lickability 1.1k Jan 6, 2023
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
Simple motion detector for ⌚️ (watchOS) shake gesture.

WatchShaker Simple motion detector for ⌚️ (watchOS) shake gesture. WatchShaker is a watchOS helper to get your ⌚️ shake movements Requirements watchOS

Ezequiel França 200 Dec 22, 2022
Simple example of view that appears on tap button and dismiss with swipe gesture.

MenuWithSlide Simple SwiftUI example of how to show side menu with slide effect. On button press - appeares, on background tap or swipe right - dissmi

Evgeny 1 Nov 29, 2021