Description
HSRange is available through CocoaPods.
Simple and Elegant Range(A, B) to Range(P, Q) mapper in less than five lines of code.
pod version 5.0.1 support swift 4 and swift 5 both as well as XCode 9 and XCode 10 both
HSRange alternatives and similar libraries
Based on the "Utility" category.
Alternatively, view HSRange alternatives based on common mentions on social networks and blogs.
-
SwifterSwift
A handy collection of more than 500 native Swift extensions to boost your productivity. -
SwiftGen
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
SwiftGen-Storyboard
The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! -
SwiftLinkPreview
DISCONTINUED. It makes a preview from an URL, grabbing all the information such as title, relevant texts and images. -
Playbook
📘A library for isolated developing UI components and automatically taking snapshots of them. -
BetterSafariView
A better way to present a SFSafariViewController or start a ASWebAuthenticationSession in SwiftUI. -
SwiftPlantUML
A command-line tool and Swift Package for generating class diagrams powered by PlantUML -
Pythonic.swift
DISCONTINUED. Pythonic tool-belt for Swift – a Swift implementation of selected parts of Python standard library.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of HSRange or a related project?
Popular Comparisons
README
HSRange
Description
HSRangeConvertor Simple and Elegant Range[A,B] to Range[P,Q] mapper in less then three lines of code. E.g. Suppose we have Range[10,90] and Range[20,80], Value 60 of Range[10,90] will be mapped to value 57.5 of Range[20,80].
HSColorRangeConvertor Simple and Elegant Range[A,B] to ColorRange[Color1, Color2] mapper in less then five lines of code.
Demo
Example Project
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Swift | XCode | Tag/Pod version |
---|---|---|
4.0 to 5.2 | 9.0 to 11.4.1 | 5.2.0 |
4.0 to 5.0 | 9.0 to 10.2 | 5.0.5 |
5.0 | >= 10.2 | 5.0 |
4.2 - 4.3 | >= 10.0.x to <= 10.1.x | 4.2 |
4.0 - 4.1 | >= 9.x | 1.1 |
3.x | >= 8.x | 1.1 |
How to use HSRange | HSRangeConvertor?
- Create object of HSRangeConverter by passing two object of HSRange
- Object of first range [A,B]
- Object of second range [P,Q]
- Convert your value from one range to other range.
let firstRange = HSRange(low: 10, high: 80)
let secondRange = HSRange(low: 0.5, high: 0.9)
//Step1:
let rangeConverter = HSRangeConverter(range1: firstRange, range2: secondRange)
//Step2:
let valueInFirstRange = rangeConverter.toRange2(of: 45) //this will give 0.7
let valueInSecondRange = rangeConverter.toRange1(of: 0.9) //this will give 80
How to use HSColorRange | HSColorRangeConvertor?
Check the demo project. Its has identical steps as above example, just second range is a range of two colors instead of two double values.
Installation
HSRange is available through CocoaPods. To install it follow below steps.
- simply add the following line to your Podfile:
pod 'HSRange'
- Open terminal, change your current directory to project directory using
cd
. - Install pod.
pod install
Possible Error:
[!] Unable to find a specification for 'HSRange'
Solution:
pod setup
Major Release
pod version 5.2.0 support swift 4 and swift 5 both as well as XCode 9 all version, XCode 10 all version, and XCode 11 all version upto 11.4.1.
Author
Hitendra Solanki, [email protected] | twitter: @hitendrahckr
License
HSRange is available under the MIT license. See the LICENSE file for more info.
*Note that all licence references and agreements mentioned in the HSRange README section above
are relevant to that project's source code only.