All Projects → Chris-Perkins → Numericaltextentry

Chris-Perkins / Numericaltextentry

Licence: mit
An iOS library for beautiful number entry fields. iPad friendly. Written in Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Numericaltextentry

Knphotobrowser
📷 图片 || 视频 浏览器(本地和网络) , UIViewController + CollectionView , 完美适配 iPhone 以及 iPad ,屏幕旋转功能 , 适配SDWebImage 5.0
Stars: ✭ 296 (+1750%)
Mutual labels:  iphone, ipad, pod
Xhlaunchad
🔥The screen opening advertising solutions - 开屏广告、启动广告解决方案-支持静态/动态图片广告,mp4视频广告,全屏/半屏广告、兼容iPhone/iPad. 【 Github下载不了/下载慢 可以访问国内下载地址: https://gitee.com/CoderZhuXH/XHLaunchAd】
Stars: ✭ 3,578 (+22262.5%)
Mutual labels:  iphone, ipad, pod
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (+543.75%)
Mutual labels:  iphone, ipad, cocoapod
jyutping
Cantonese Jyutping Keyboard for iOS. 粵語粵拼輸入法鍵盤
Stars: ✭ 23 (+43.75%)
Mutual labels:  keyboard, iphone, ipad
Yampa
Functional Reactive Programming domain-specific language embedded in Haskell, for programming efficient hybrid (mixed discrete-time and continuous-time) systems.
Stars: ✭ 294 (+1737.5%)
Mutual labels:  iphone, ipad
Chat Sdk Ios
Chat SDK iOS - Open Source Mobile Messenger
Stars: ✭ 813 (+4981.25%)
Mutual labels:  iphone, ipad
Acejump
🅰️ single character search, select, and jump
Stars: ✭ 786 (+4812.5%)
Mutual labels:  keyboard, text
Blear
iOS app that transforms your photos into stunning blurry wallpapers for your device
Stars: ✭ 311 (+1843.75%)
Mutual labels:  iphone, ipad
Open Source Xamarin Apps
📱 Collaborative List of Open Source Xamarin Apps
Stars: ✭ 318 (+1887.5%)
Mutual labels:  iphone, ipad
Blockparty
Ad Blocker App for iOS, macOS
Stars: ✭ 722 (+4412.5%)
Mutual labels:  iphone, ipad
Hackers
Hackers is an elegant iOS app for reading Hacker News written in Swift.
Stars: ✭ 513 (+3106.25%)
Mutual labels:  iphone, ipad
Chatsecure Ios
ChatSecure is a free and open source encrypted chat client for iOS that supports OTR and OMEMO encryption over XMPP.
Stars: ✭ 3,044 (+18925%)
Mutual labels:  iphone, ipad
Showtime
The easiest way to show off your iOS taps and gestures for demos and videos.
Stars: ✭ 281 (+1656.25%)
Mutual labels:  iphone, ipad
Ipa Server
Upload and install IPA in web.
Stars: ✭ 392 (+2350%)
Mutual labels:  iphone, ipad
Assistantkit
Easy way to detect iOS device properties, OS versions and work with screen sizes. Powered by Swift.
Stars: ✭ 569 (+3456.25%)
Mutual labels:  iphone, ipad
Instagram stories
Inspired by Instagram Stories functionality. This source is similar to Instagram Stories, which is having both image and video support.
Stars: ✭ 275 (+1618.75%)
Mutual labels:  iphone, ipad
Localradio
📻 LocalRadio is "Radio for Cord-Cutters" – a Software-Defined Radio (SDR) app for your Mac and mobile devices. With an inexpensive RTL-SDR USB device, LocalRadio provides a casual, home-based radio listening experience for your favorite local frequencies - FM broadcasts/free music/news/sports/weather/public safety & aviation scanner/etc.
Stars: ✭ 269 (+1581.25%)
Mutual labels:  iphone, ipad
Alsystemutilities
THIS REPO IS NO LONGER MAINTAINED! Check https://github.com/andrealufino/Luminous. This library provides a list of 80 methods to get every kind of system information!
Stars: ✭ 644 (+3925%)
Mutual labels:  iphone, ipad
Pushok
PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)
Stars: ✭ 260 (+1525%)
Mutual labels:  iphone, ipad
Readinglist
📚 📱 Reading List - an iOS app to track personal reading lists
Stars: ✭ 266 (+1562.5%)
Mutual labels:  iphone, ipad

NumericTextEntry is a powerful, extensible library made for your application's numeric entry needs.

Available NumberDisplayer components:

  UIFittedFlatNumberDisplayer     UIFloatingDecimalNumberDisplayer      UIFlatNumberDisplayer      
Custom Keyboard Disable Floats 

Features

✅ Highly extensible
✅ iPad friendly--uses a purely numeric keyboard
✅ Locale-safe; don't worry about different localization issues
✅ Display Numbers using 3 built-in NumberDisplayers (or your own!)
✅ Displayers with dynamic-sizing text to always fit your view
✅ Injectable NumberFormatter for custom number formatting
✅ Set a maximum value for numeric text
✅ Ability to hide decimals for text that can be represented by an Int
✅ Built-in beautiful, custom keyboard
✅ Define whether float values are allowed

Installation

  1. Install CocoaPods

  2. Add this repo to your Podfile

    target 'Example' do
    	# IMPORTANT: Make sure use_frameworks! is included at the top of the file
    	use_frameworks!
    
    	pod 'NumericalTextEntry'
    end
    
  3. Run pod install in the podfile directory from your terminal

  4. Open up the .xcworkspace that CocoaPods created

  5. Done!

How Do I Work With It?

NumericalTextEntry is intended to be very extensible. Despite its extensibility, NumericalTextEntry is very easy to work with.

Basics

To create a numeric text entry field: let numberField = UINumberEntryField()

To get the different values in the number field:

let userInputValue = numberField.rawValue
let numericValue = numberField.doubleValue
let displayedValue = numberField.displayedStringValue

Customization

The following values are customizable for UINumberEntryFields:

// Cap the maximum value for entry to 987.2 (default  9_999_999_999_999.99; exceeding the default value may cause formatting errors due to double-precision.)
numberField.maximumValue = 987.2

// Set the starting value for the number field
numberField.startingValue = 37.2

// Determines if decimals should not be in the displayedString if the number can be represented by an integer 
// e.g.: rawValue: "23" - formattedNumber: "23.00" - displayedNumber: "23")
// e.g. 2: rawValue: "23.0" - formattedNumber: "23.00" - displayedNumber: "23.00"
numberField.hideDecimalsIfIntegerValue = false

// Change the number formatter for the view
numberField.numberFormatter = userDefinedNumberFormatter

// Change the number displayer.
numberField.numberDisplayer = UIFloatingDecimalNumberDisplayer()
numberField.numberDisplayer = UIFlatNumberDisplayer()
numberField.numberDisplayer = UIFittedFlatNumberDisplayer()

// NumberDisplayer customization: both the UIFloatingDecimalNumberDisplayer and UIFittedFlatNumberDisplayer have toggleable animations.
let numberDisplayer = UIFittedFlatNumberDisplayer()
numberDisplayer.animated = false

// Custom fonts and text colors are available for every number displayer as well!
let numberDisplayer = UIFittedFlatNumberDisplay(withFont: customFont, withTextColor: UIColor.red)

Want to disallow float values? Simply inject a NumberFormatter that doesn't allow floats!

let numberFormatter = NumberFormatter()
numberFormatter.allowsFloats = false
numberField.numberFormatter = numberFormatter

Custom NumberDisplayers

Want to create your own NumberDisplayer? Follow this simple protocol!

/// A protocol used to display numbers
public protocol UINumberDisplayer {
    /// Displays the provided value.
    ///
    /// - Parameters:
    ///   - stringToDisplay: The complete string to display.
    ///   - rawValue: The raw value of the string to display (not formatted)
    ///   - numberFormatter: The formatter used to generate the stringToDisplay
    ///   - view: The view where the value should be displayed in
    /// - Returns: The views that were created to hold the displayed value.
    func displayValue(_ stringToDisplay: String, withRawString rawString: String,
                      numberFormatter: NumberFormatter, inView view: UIView) -> [UIView]
}

Component Diagram

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 10.0 is required.

Documentation

Read the docs

Author

Ya Boi

License

NumericalTextEntry is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].