Skip to content

Commit

Permalink
Changed access modifiers to allow access of some variable outside of …
Browse files Browse the repository at this point in the history
…package
  • Loading branch information
SOTSYS216 authored and SOTSYS216 committed Apr 17, 2018
1 parent d86b6bc commit 9ea5c4e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- HSRange (0.1.0)
- HSRange (1.0)

DEPENDENCIES:
- HSRange (from `../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
HSRange: fe5710b005f9ac6d13b3e81a3ca46def1c78580e
HSRange: f4231b2c9a09b9648e58eee717ebb6662837237e

PODFILE CHECKSUM: 48b95f6e94d4be717adfd4b7ba0d48085067477f

Expand Down
10 changes: 5 additions & 5 deletions Example/Pods/Local Podspecs/HSRange.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Pods/Target Support Files/HSRange/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion HSRange.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 9 additions & 4 deletions HSRange/Classes/HSRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}
4 changes: 2 additions & 2 deletions HSRange/Classes/HSRangeConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file added tag
Empty file.

0 comments on commit 9ea5c4e

Please sign in to comment.