From 9ea5c4e201c0826e11a336fc52ccf71a5d171979 Mon Sep 17 00:00:00 2001 From: SOTSYS216 Date: Tue, 17 Apr 2018 11:19:28 +0530 Subject: [PATCH] Changed access modifiers to allow access of some variable outside of package --- Example/Podfile.lock | 4 ++-- Example/Pods/Local Podspecs/HSRange.podspec.json | 10 +++++----- Example/Pods/Manifest.lock | 4 ++-- .../Pods/Target Support Files/HSRange/Info.plist | 2 +- HSRange.podspec | 2 +- HSRange/Classes/HSRange.swift | 13 +++++++++---- HSRange/Classes/HSRangeConverter.swift | 4 ++-- tag | 0 8 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 tag diff --git a/Example/Podfile.lock b/Example/Podfile.lock index e7631b1..894507d 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - HSRange (0.1.0) + - HSRange (1.0) DEPENDENCIES: - HSRange (from `../`) @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - HSRange: fe5710b005f9ac6d13b3e81a3ca46def1c78580e + HSRange: f4231b2c9a09b9648e58eee717ebb6662837237e PODFILE CHECKSUM: 48b95f6e94d4be717adfd4b7ba0d48085067477f diff --git a/Example/Pods/Local Podspecs/HSRange.podspec.json b/Example/Pods/Local Podspecs/HSRange.podspec.json index 7f9bfd4..24c2dd1 100644 --- a/Example/Pods/Local Podspecs/HSRange.podspec.json +++ b/Example/Pods/Local Podspecs/HSRange.podspec.json @@ -1,8 +1,8 @@ { "name": "HSRange", - "version": "0.1.0", - "summary": "A short description of HSRange.", - "description": "TODO: Add long description of the pod here.", + "version": "1.0", + "summary": "Simple and Elegant Range(A,B) to Range(P,Q) mapper in less then five lines of code.", + "description": "Simple and Elegant Range(A,B) to Range(P,Q) mapper in less then five lines of code.\nE.g. Suppose we have Range(10,90) and Range(20,80),\n Value 60 of Range(10,90) will be mapped to value 57.5 of Range(20,80).", "homepage": "https://github.com/hitendradeveloper/HSRange", "license": { "type": "MIT", @@ -12,8 +12,8 @@ "Hitendra Solanki": "hitendra.developer@gmail.com" }, "source": { - "git": "https://github.com/Hitendra Solanki/HSRange.git", - "tag": "0.1.0" + "git": "https://github.com/hitendradeveloper/HSRange.git", + "tag": "1.0" }, "social_media_url": "https://twitter.com/hitendrahckr", "platforms": { diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index e7631b1..894507d 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,5 +1,5 @@ PODS: - - HSRange (0.1.0) + - HSRange (1.0) DEPENDENCIES: - HSRange (from `../`) @@ -9,7 +9,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - HSRange: fe5710b005f9ac6d13b3e81a3ca46def1c78580e + HSRange: f4231b2c9a09b9648e58eee717ebb6662837237e PODFILE CHECKSUM: 48b95f6e94d4be717adfd4b7ba0d48085067477f diff --git a/Example/Pods/Target Support Files/HSRange/Info.plist b/Example/Pods/Target Support Files/HSRange/Info.plist index 491f1ec..e0632c2 100644 --- a/Example/Pods/Target Support Files/HSRange/Info.plist +++ b/Example/Pods/Target Support Files/HSRange/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.1.2 + 1.1 CFBundleSignature ???? CFBundleVersion diff --git a/HSRange.podspec b/HSRange.podspec index 2519811..b94e429 100644 --- a/HSRange.podspec +++ b/HSRange.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'HSRange' - s.version = '1.0' + s.version = '1.1' s.summary = 'Simple and Elegant Range(A,B) to Range(P,Q) mapper in less then five lines of code.' # This description is used to generate tags and improve search results. diff --git a/HSRange/Classes/HSRange.swift b/HSRange/Classes/HSRange.swift index 096a0e9..bbdfdcf 100644 --- a/HSRange/Classes/HSRange.swift +++ b/HSRange/Classes/HSRange.swift @@ -10,8 +10,8 @@ import Foundation //MARK:- Backbone structure behind the scene public struct HSRange { - var low: Double! - var high: Double! + public var low: Double! + public var high: Double! public init(low: Double, high: Double) { self.low = low @@ -21,10 +21,15 @@ public struct HSRange { //MARK:- Helpers public extension HSRange { - var mid: Double { + //middle value of the range + //e.g. Range(-100,100), this will return 0 + public var mid: Double { return (self.low + self.high)/2.0 } - func innerValue(value: Double) -> Double { + + //this returns the value inside of range + //e.g. Range(-100,100), if you pass -200, this will return -100 + public func innerValue(value: Double) -> Double { return min(max(value,self.low),self.high) } } diff --git a/HSRange/Classes/HSRangeConverter.swift b/HSRange/Classes/HSRangeConverter.swift index 928da0d..411bef2 100644 --- a/HSRange/Classes/HSRangeConverter.swift +++ b/HSRange/Classes/HSRangeConverter.swift @@ -10,8 +10,8 @@ import Foundation //MARK:- Converter public struct HSRangeConverter { - var range1: HSRange! - var range2: HSRange! + public var range1: HSRange! + public var range2: HSRange! public init(range1: HSRange, range2: HSRange) { self.range1 = range1 diff --git a/tag b/tag new file mode 100644 index 0000000..e69de29