-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edgar Žigis
committed
Aug 23, 2019
1 parent
968697e
commit a9a7538
Showing
28 changed files
with
2,103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
GaugeSlider.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
GaugeSlider.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+43 KB
...oj/project.xcworkspace/xcuserdata/edgaraszigis.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
99 changes: 99 additions & 0 deletions
99
GaugeSlider.xcodeproj/xcshareddata/xcschemes/GaugeSlider.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1030" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051384623106DF50055FD0B" | ||
BuildableName = "GaugeSlider.framework" | ||
BlueprintName = "GaugeSlider" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051384F23106DF50055FD0B" | ||
BuildableName = "GaugeSliderTests.xctest" | ||
BlueprintName = "GaugeSliderTests" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051384623106DF50055FD0B" | ||
BuildableName = "GaugeSlider.framework" | ||
BlueprintName = "GaugeSlider" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051384623106DF50055FD0B" | ||
BuildableName = "GaugeSlider.framework" | ||
BlueprintName = "GaugeSlider" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051384623106DF50055FD0B" | ||
BuildableName = "GaugeSlider.framework" | ||
BlueprintName = "GaugeSlider" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
91 changes: 91 additions & 0 deletions
91
GaugeSlider.xcodeproj/xcshareddata/xcschemes/GaugeSliderTest.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1030" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051386D231075790055FD0B" | ||
BuildableName = "GaugeSliderTest.app" | ||
BlueprintName = "GaugeSliderTest" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051386D231075790055FD0B" | ||
BuildableName = "GaugeSliderTest.app" | ||
BlueprintName = "GaugeSliderTest" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051386D231075790055FD0B" | ||
BuildableName = "GaugeSliderTest.app" | ||
BlueprintName = "GaugeSliderTest" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "C051386D231075790055FD0B" | ||
BuildableName = "GaugeSliderTest.app" | ||
BlueprintName = "GaugeSliderTest" | ||
ReferencedContainer = "container:GaugeSlider.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
37 changes: 37 additions & 0 deletions
37
GaugeSlider.xcodeproj/xcuserdata/edgaraszigis.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>GaugeSlider.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
<key>GaugeSliderTest.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>1</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>C051384623106DF50055FD0B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>C051384F23106DF50055FD0B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>C051386D231075790055FD0B</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// CgPath+Elements.swift | ||
// GaugeSlider | ||
// | ||
// Created by Edgar Žigis on 23/08/2019. | ||
// Copyright © 2019 Edgar Žigis. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension CGPath { | ||
|
||
func forEach(body: @escaping @convention(block) (CGPathElement) -> Void) { | ||
typealias Body = @convention(block) (CGPathElement) -> Void | ||
func callback(info: UnsafeMutableRawPointer?, element: UnsafePointer<CGPathElement>) { | ||
let body = unsafeBitCast(info, to: Body.self) | ||
body(element.pointee) | ||
} | ||
let unsafeBody = unsafeBitCast(body, to: UnsafeMutableRawPointer.self) | ||
self.apply(info: unsafeBody, function: callback) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// ProgressCounter.swift | ||
// GaugeSlider | ||
// | ||
// Created by Edgar Žigis on 23/08/2019. | ||
// Copyright © 2019 Edgar Žigis. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
let kCounterRate = Float(3.0) | ||
|
||
public protocol ProgressCounter { | ||
func update(_ t: CGFloat) -> CGFloat | ||
} | ||
|
||
public class ProgressCounterLinear: ProgressCounter { | ||
public func update(_ t: CGFloat) -> CGFloat { | ||
return t | ||
} | ||
} | ||
|
||
public class ProgressCounterEaseIn: ProgressCounter { | ||
public func update(_ t: CGFloat) -> CGFloat { | ||
return CGFloat(powf(Float(t), kCounterRate)) | ||
} | ||
} | ||
|
||
public class ProgressCounterEaseOut: ProgressCounter { | ||
public func update(_ t: CGFloat) -> CGFloat { | ||
return CGFloat(1.0 - powf(Float(1.0 - t), kCounterRate)) | ||
} | ||
} | ||
|
||
public class ProgressCounterEaseInOut: ProgressCounter { | ||
public func update(_ t: CGFloat) -> CGFloat { | ||
let newt: CGFloat = 2 * t | ||
if newt < 1 { | ||
return CGFloat(0.5 * powf (Float(newt), kCounterRate)) | ||
} else { | ||
return CGFloat(0.5 * (2.0 - powf(Float(2.0 - newt), kCounterRate))) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// UIBezierPath+FirstPoint.swift | ||
// GaugeSlider | ||
// | ||
// Created by Edgar Žigis on 23/08/2019. | ||
// Copyright © 2019 Edgar Žigis. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIBezierPath { | ||
|
||
func firstPoint() -> CGPoint? { | ||
var firstPoint: CGPoint? = nil | ||
cgPath.forEach { element in | ||
guard firstPoint == nil else { return } | ||
assert(element.type == .moveToPoint, "Expected the first point to be a move") | ||
firstPoint = element.points.pointee | ||
} | ||
return firstPoint | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// GaugeSlider.h | ||
// GaugeSlider | ||
// | ||
// Created by Edgar Žigis on 23/08/2019. | ||
// Copyright © 2019 Edgar Žigis. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
//! Project version number for GaugeSlider. | ||
FOUNDATION_EXPORT double GaugeSliderVersionNumber; | ||
|
||
//! Project version string for GaugeSlider. | ||
FOUNDATION_EXPORT const unsigned char GaugeSliderVersionString[]; | ||
|
||
// In this header, you should import all the public headers of your framework using statements like #import <GaugeSlider/PublicHeader.h> | ||
|
||
|
Oops, something went wrong.