Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #10

Merged
merged 4 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# CHANGELOG

## [0.1.1] - 2024-03-17

### Changed
- Updated changelog

## [0.1.0] - 2024-03-17

### Added
- Added new configurations for direction-specific animations
- Refined animation transitions when changing directions for a more fluid user experience
- SliderDelegate now supports Swift Concurrency for asynchronous event handling

### Changed
- Rendering of changes is now synchronized with the GPU using CADisplayLink for smoother visual updates.
- Removed support for Interface Builder to streamline codebase and improve programmability.

## [0.0.9] - 2024-03-14

### Fixed
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@
- Swift 5+

## Preview
<img src="https://github.com/Ramiz69/Slider/blob/master/example.gif" width="200" height="400">
<details>
<summary>Preview</summary>

<img src="Screenshots/leftToRightDefault.png" width="400"/>
<img src="Screenshots/rightToLeftDefault.png" width="400"/>
<img src="Screenshots/leftToRightCustom.png" width="400"/>
<img src="Screenshots/preference.png" width="400"/>
</details>

## Installation

Expand All @@ -29,7 +36,7 @@ Once you have your Swift package set up, adding Slider as a dependency is as eas

```swift
dependencies: [
.package(url: "https://github.com/Ramiz69/Slider.git", .upToNextMajor(from: "0.0.9"))
.package(url: "https://github.com/Ramiz69/Slider.git", .upToNextMajor(from: "0.1.0"))
]
```

Expand Down
2 changes: 1 addition & 1 deletion RKSlider.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = 'RKSlider'
spec.version = '0.0.9'
spec.version = '0.1.1'
spec.summary = 'A CocoaPods library written in Swift'

spec.description = <<-DESC
Expand Down
26 changes: 26 additions & 0 deletions RKSlider/0.1.0/RKSlider.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Pod::Spec.new do |spec|

spec.name = 'RKSlider'
spec.version = '0.1.0'
spec.summary = 'A CocoaPods library written in Swift'

spec.description = <<-DESC
This CocoaPods library helps you create application with the best slider.
DESC

spec.homepage = 'https://github.com/Ramiz69/Slider'

spec.license = 'MIT'

spec.author = { 'Ramiz Kichibekov' => '[email protected]' }
spec.social_media_url = 'https://t.me/Ramiz69'

spec.ios.deployment_target = "14.0"

spec.source = { :git => 'https://github.com/Ramiz69/Slider.git', :tag => spec.version }

spec.swift_version = ['5.0', '5.9']

spec.source_files = 'Sources/*.swift', 'Sources/**/*.swift'

end
Binary file added Screenshots/leftToRightCustom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/leftToRightDefault.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/preference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/rightToLeftDefault.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 48 additions & 12 deletions Slider.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@
4B2EB6F123C1E5AA00FB91AD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B2EB6EF23C1E5AA00FB91AD /* LaunchScreen.storyboard */; };
4B889B692433375D002FCE02 /* CodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B889B682433375D002FCE02 /* CodeViewController.swift */; };
4B889B7624333E7C002FCE02 /* CodeViewController+SliderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B889B7524333E7C002FCE02 /* CodeViewController+SliderDelegate.swift */; };
4B8DAE962BA6925A005CFA82 /* Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAE952BA6925A005CFA82 /* Animation.swift */; };
4B8DAE982BA6956B005CFA82 /* TrackConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAE972BA6956B005CFA82 /* TrackConfiguration.swift */; };
4B8DAE9A2BA696A8005CFA82 /* ThumbConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAE992BA696A8005CFA82 /* ThumbConfiguration.swift */; };
4B8DAE9C2BA69A69005CFA82 /* RangeEndpointsConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAE9B2BA69A69005CFA82 /* RangeEndpointsConfiguration.swift */; };
4B8DAE9F2BA6A056005CFA82 /* PreferenceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAE9E2BA6A056005CFA82 /* PreferenceManager.swift */; };
4B8DAEA12BA6A5E9005CFA82 /* CodeViewController+UIColorPickerViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAEA02BA6A5E9005CFA82 /* CodeViewController+UIColorPickerViewControllerDelegate.swift */; };
4B8DAEA42BA6AE54005CFA82 /* ThumbLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAEA22BA6ACFF005CFA82 /* ThumbLayer.swift */; };
4B8DAEA62BA6B445005CFA82 /* TextLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8DAEA52BA6B445005CFA82 /* TextLayer.swift */; };
4BF628A12BA2B38D0093637E /* HapticConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628922BA2B38D0093637E /* HapticConfiguration.swift */; };
4BF628A22BA2B38D0093637E /* DirectionEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628942BA2B38D0093637E /* DirectionEnum.swift */; };
4BF628A22BA2B38D0093637E /* Direction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628942BA2B38D0093637E /* Direction.swift */; };
4BF628A32BA2B38D0093637E /* Slider+UITouch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628962BA2B38D0093637E /* Slider+UITouch.swift */; };
4BF628A42BA2B38D0093637E /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628972BA2B38D0093637E /* String.swift */; };
4BF628A52BA2B38D0093637E /* Protocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628992BA2B38D0093637E /* Protocols.swift */; };
4BF628A52BA2B38D0093637E /* SliderDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF628992BA2B38D0093637E /* SliderDelegate.swift */; };
4BF628A72BA2B38D0093637E /* Slider.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF6289C2BA2B38D0093637E /* Slider.h */; };
4BF628A82BA2B38D0093637E /* Slider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6289D2BA2B38D0093637E /* Slider.swift */; };
4BF628A92BA2B38D0093637E /* SliderTextLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6289E2BA2B38D0093637E /* SliderTextLayer.swift */; };
4BF628AA2BA2B38D0093637E /* SliderTrackLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF6289F2BA2B38D0093637E /* SliderTrackLayer.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -62,15 +69,22 @@
4B2EB6F223C1E5AA00FB91AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4B889B682433375D002FCE02 /* CodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeViewController.swift; sourceTree = "<group>"; };
4B889B7524333E7C002FCE02 /* CodeViewController+SliderDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CodeViewController+SliderDelegate.swift"; sourceTree = "<group>"; };
4B8DAE952BA6925A005CFA82 /* Animation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animation.swift; sourceTree = "<group>"; };
4B8DAE972BA6956B005CFA82 /* TrackConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackConfiguration.swift; sourceTree = "<group>"; };
4B8DAE992BA696A8005CFA82 /* ThumbConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThumbConfiguration.swift; sourceTree = "<group>"; };
4B8DAE9B2BA69A69005CFA82 /* RangeEndpointsConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RangeEndpointsConfiguration.swift; sourceTree = "<group>"; };
4B8DAE9E2BA6A056005CFA82 /* PreferenceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceManager.swift; sourceTree = "<group>"; };
4B8DAEA02BA6A5E9005CFA82 /* CodeViewController+UIColorPickerViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CodeViewController+UIColorPickerViewControllerDelegate.swift"; sourceTree = "<group>"; };
4B8DAEA22BA6ACFF005CFA82 /* ThumbLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThumbLayer.swift; sourceTree = "<group>"; };
4B8DAEA52BA6B445005CFA82 /* TextLayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLayer.swift; sourceTree = "<group>"; };
4BF628922BA2B38D0093637E /* HapticConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HapticConfiguration.swift; sourceTree = "<group>"; };
4BF628942BA2B38D0093637E /* DirectionEnum.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DirectionEnum.swift; sourceTree = "<group>"; };
4BF628942BA2B38D0093637E /* Direction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Direction.swift; sourceTree = "<group>"; };
4BF628962BA2B38D0093637E /* Slider+UITouch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Slider+UITouch.swift"; sourceTree = "<group>"; };
4BF628972BA2B38D0093637E /* String.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
4BF628992BA2B38D0093637E /* Protocols.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Protocols.swift; sourceTree = "<group>"; };
4BF628992BA2B38D0093637E /* SliderDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderDelegate.swift; sourceTree = "<group>"; };
4BF6289B2BA2B38D0093637E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4BF6289C2BA2B38D0093637E /* Slider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Slider.h; sourceTree = "<group>"; };
4BF6289D2BA2B38D0093637E /* Slider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Slider.swift; sourceTree = "<group>"; };
4BF6289E2BA2B38D0093637E /* SliderTextLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderTextLayer.swift; sourceTree = "<group>"; };
4BF6289F2BA2B38D0093637E /* SliderTrackLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderTrackLayer.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -115,6 +129,7 @@
4B2EB6E323C1E5AA00FB91AD /* Slider_Example */ = {
isa = PBXGroup;
children = (
4B8DAE9D2BA6A04B005CFA82 /* Manager */,
4B889B6A24333B9F002FCE02 /* Application */,
4B889B6B24333BAB002FCE02 /* Flows */,
4B889B6F24333BC8002FCE02 /* Supporting Files */,
Expand Down Expand Up @@ -186,22 +201,35 @@
isa = PBXGroup;
children = (
4B889B7524333E7C002FCE02 /* CodeViewController+SliderDelegate.swift */,
4B8DAEA02BA6A5E9005CFA82 /* CodeViewController+UIColorPickerViewControllerDelegate.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
4B8DAE9D2BA6A04B005CFA82 /* Manager */ = {
isa = PBXGroup;
children = (
4B8DAE9E2BA6A056005CFA82 /* PreferenceManager.swift */,
);
path = Manager;
sourceTree = "<group>";
};
4BF628932BA2B38D0093637E /* Configurations */ = {
isa = PBXGroup;
children = (
4BF628922BA2B38D0093637E /* HapticConfiguration.swift */,
4B8DAE972BA6956B005CFA82 /* TrackConfiguration.swift */,
4B8DAE992BA696A8005CFA82 /* ThumbConfiguration.swift */,
4B8DAE9B2BA69A69005CFA82 /* RangeEndpointsConfiguration.swift */,
);
path = Configurations;
sourceTree = "<group>";
};
4BF628952BA2B38D0093637E /* Enums */ = {
isa = PBXGroup;
children = (
4BF628942BA2B38D0093637E /* DirectionEnum.swift */,
4BF628942BA2B38D0093637E /* Direction.swift */,
4B8DAE952BA6925A005CFA82 /* Animation.swift */,
);
path = Enums;
sourceTree = "<group>";
Expand All @@ -218,7 +246,7 @@
4BF6289A2BA2B38D0093637E /* Protocols */ = {
isa = PBXGroup;
children = (
4BF628992BA2B38D0093637E /* Protocols.swift */,
4BF628992BA2B38D0093637E /* SliderDelegate.swift */,
);
path = Protocols;
sourceTree = "<group>";
Expand All @@ -233,8 +261,9 @@
4BF6289B2BA2B38D0093637E /* Info.plist */,
4BF6289C2BA2B38D0093637E /* Slider.h */,
4BF6289D2BA2B38D0093637E /* Slider.swift */,
4BF6289E2BA2B38D0093637E /* SliderTextLayer.swift */,
4BF6289F2BA2B38D0093637E /* SliderTrackLayer.swift */,
4B8DAEA22BA6ACFF005CFA82 /* ThumbLayer.swift */,
4B8DAEA52BA6B445005CFA82 /* TextLayer.swift */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -358,13 +387,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4BF628A52BA2B38D0093637E /* Protocols.swift in Sources */,
4BF628A52BA2B38D0093637E /* SliderDelegate.swift in Sources */,
4BF628A32BA2B38D0093637E /* Slider+UITouch.swift in Sources */,
4BF628A22BA2B38D0093637E /* DirectionEnum.swift in Sources */,
4BF628A22BA2B38D0093637E /* Direction.swift in Sources */,
4B8DAE9C2BA69A69005CFA82 /* RangeEndpointsConfiguration.swift in Sources */,
4BF628A42BA2B38D0093637E /* String.swift in Sources */,
4BF628A92BA2B38D0093637E /* SliderTextLayer.swift in Sources */,
4B8DAE962BA6925A005CFA82 /* Animation.swift in Sources */,
4B8DAE9A2BA696A8005CFA82 /* ThumbConfiguration.swift in Sources */,
4BF628A82BA2B38D0093637E /* Slider.swift in Sources */,
4B8DAEA62BA6B445005CFA82 /* TextLayer.swift in Sources */,
4BF628AA2BA2B38D0093637E /* SliderTrackLayer.swift in Sources */,
4B8DAE982BA6956B005CFA82 /* TrackConfiguration.swift in Sources */,
4B8DAEA42BA6AE54005CFA82 /* ThumbLayer.swift in Sources */,
4BF628A12BA2B38D0093637E /* HapticConfiguration.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -373,6 +407,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4B8DAE9F2BA6A056005CFA82 /* PreferenceManager.swift in Sources */,
4B8DAEA12BA6A5E9005CFA82 /* CodeViewController+UIColorPickerViewControllerDelegate.swift in Sources */,
4B889B692433375D002FCE02 /* CodeViewController.swift in Sources */,
4B2EB6E523C1E5AA00FB91AD /* AppDelegate.swift in Sources */,
4B889B7624333E7C002FCE02 /* CodeViewController+SliderDelegate.swift in Sources */,
Expand Down
Binary file not shown.
46 changes: 28 additions & 18 deletions Slider_Example/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
//
// AppDelegate.swift
// Slider_Example
//
// Created by Рамиз Кичибеков on 05.01.2020.
// Copyright © 2020 Ramiz Kichibekov. All rights reserved.
// Copyright (c) 2024 Ramiz Kichibekov (https://github.com/ramiz69)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

final class AppDelegate: UIResponder, UIApplicationDelegate {


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}



}

Loading
Loading