Skip to content

Commit

Permalink
Merge pull request #46 from warchimede/fix/spm
Browse files Browse the repository at this point in the history
Fix: SPM support
  • Loading branch information
warchimede authored Sep 12, 2023
2 parents b8cadea + fe27431 commit 04ddece
Show file tree
Hide file tree
Showing 8 changed files with 313 additions and 331 deletions.
16 changes: 4 additions & 12 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
objects = {

/* Begin PBXBuildFile section */
93360D122AB0C3DC003C0669 /* RangeSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93360D112AB0C3DC003C0669 /* RangeSlider.swift */; };
93C8129D2AAA3F3C005CEA65 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C8129C2AAA3F3C005CEA65 /* AppDelegate.swift */; };
93C8129F2AAA3F3C005CEA65 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C8129E2AAA3F3C005CEA65 /* SceneDelegate.swift */; };
93C812A12AAA3F3C005CEA65 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C812A02AAA3F3C005CEA65 /* ViewController.swift */; };
93C812A42AAA3F3C005CEA65 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 93C812A22AAA3F3C005CEA65 /* Main.storyboard */; };
93C812A62AAA3F3C005CEA65 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 93C812A52AAA3F3C005CEA65 /* Assets.xcassets */; };
93C812A92AAA3F3C005CEA65 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 93C812A72AAA3F3C005CEA65 /* LaunchScreen.storyboard */; };
93C812B62AAA41F4005CEA65 /* WARangeSlider in Frameworks */ = {isa = PBXBuildFile; productRef = 93C812B52AAA41F4005CEA65 /* WARangeSlider */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
93360D112AB0C3DC003C0669 /* RangeSlider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RangeSlider.swift; path = Sources/WARangeSlider/RangeSlider.swift; sourceTree = SOURCE_ROOT; };
93C812992AAA3F3C005CEA65 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
93C8129C2AAA3F3C005CEA65 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
93C8129E2AAA3F3C005CEA65 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -25,15 +26,13 @@
93C812A52AAA3F3C005CEA65 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
93C812A82AAA3F3C005CEA65 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
93C812AA2AAA3F3C005CEA65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
93C812B32AAA40F1005CEA65 /* WARangeSlider */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = WARangeSlider; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
93C812962AAA3F3C005CEA65 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
93C812B62AAA41F4005CEA65 /* WARangeSlider in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -43,7 +42,6 @@
93C812902AAA3F3C005CEA65 = {
isa = PBXGroup;
children = (
93C812B32AAA40F1005CEA65 /* WARangeSlider */,
93C8129B2AAA3F3C005CEA65 /* Example */,
93C8129A2AAA3F3C005CEA65 /* Products */,
93C812B42AAA41F4005CEA65 /* Frameworks */,
Expand All @@ -61,6 +59,7 @@
93C8129B2AAA3F3C005CEA65 /* Example */ = {
isa = PBXGroup;
children = (
93360D112AB0C3DC003C0669 /* RangeSlider.swift */,
93C8129C2AAA3F3C005CEA65 /* AppDelegate.swift */,
93C8129E2AAA3F3C005CEA65 /* SceneDelegate.swift */,
93C812A02AAA3F3C005CEA65 /* ViewController.swift */,
Expand Down Expand Up @@ -96,7 +95,6 @@
);
name = Example;
packageProductDependencies = (
93C812B52AAA41F4005CEA65 /* WARangeSlider */,
);
productName = Example;
productReference = 93C812992AAA3F3C005CEA65 /* Example.app */;
Expand Down Expand Up @@ -153,6 +151,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
93360D122AB0C3DC003C0669 /* RangeSlider.swift in Sources */,
93C812A12AAA3F3C005CEA65 /* ViewController.swift in Sources */,
93C8129D2AAA3F3C005CEA65 /* AppDelegate.swift in Sources */,
93C8129F2AAA3F3C005CEA65 /* SceneDelegate.swift in Sources */,
Expand Down Expand Up @@ -373,13 +372,6 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
93C812B52AAA41F4005CEA65 /* WARangeSlider */ = {
isa = XCSwiftPackageProductDependency;
productName = WARangeSlider;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 93C812912AAA3F3C005CEA65 /* Project object */;
}
4 changes: 2 additions & 2 deletions Example/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D1f-O0-sLQ" customClass="RangeSlider" customModule="WARangeSlider">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D1f-O0-sLQ" customClass="RangeSlider" customModule="Example" customModuleProvider="target">
<rect key="frame" x="59" y="642" width="275" height="30"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="275" id="K9f-CB-Dg6"/>
<constraint firstAttribute="height" constant="30" id="ngR-uE-pdN"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H1O-Qa-jW9" customClass="RangeSlider" customModule="WARangeSlider">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H1O-Qa-jW9" customClass="RangeSlider" customModule="Example" customModuleProvider="target">
<rect key="frame" x="76.666666666666686" y="692" width="240" height="43"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
Expand Down
43 changes: 21 additions & 22 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
import WARangeSlider
import UIKit

class ViewController: UIViewController {
let rangeSlider1 = RangeSlider(frame: CGRect.zero)
let rangeSlider2 = RangeSlider(frame: CGRect.zero)
let rangeSlider1 = RangeSlider(frame: CGRect.zero)
let rangeSlider2 = RangeSlider(frame: CGRect.zero)

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
rangeSlider2.trackHighlightTintColor = UIColor.red
rangeSlider2.curvaceousness = 0.0
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
rangeSlider2.trackHighlightTintColor = UIColor.red
rangeSlider2.curvaceousness = 0.0

view.addSubview(rangeSlider1)
view.addSubview(rangeSlider2)
view.addSubview(rangeSlider1)
view.addSubview(rangeSlider2)

rangeSlider1.addTarget(self, action: #selector(ViewController.rangeSliderValueChanged(_:)), for: .valueChanged)
}
rangeSlider1.addTarget(self, action: #selector(ViewController.rangeSliderValueChanged(_:)), for: .valueChanged)
}

override func viewDidLayoutSubviews() {
let margin: CGFloat = 20.0
let width = view.bounds.width - 2.0 * margin
rangeSlider1.frame = CGRect(x: margin, y: margin + 100, width: width, height: 31.0)
rangeSlider2.frame = CGRect(x: margin + 20, y: 5 * margin + 100,
width: width - 40, height: 40)
}
override func viewDidLayoutSubviews() {
let margin: CGFloat = 20.0
let width = view.bounds.width - 2.0 * margin
rangeSlider1.frame = CGRect(x: margin, y: margin + 100, width: width, height: 31.0)
rangeSlider2.frame = CGRect(x: margin + 20, y: 5 * margin + 100,
width: width - 40, height: 40)
}

@objc func rangeSliderValueChanged(_ rangeSlider: RangeSlider) {
print("Range slider value changed: (\(rangeSlider.lowerValue) , \(rangeSlider.upperValue))")
}
@objc func rangeSliderValueChanged(_ rangeSlider: RangeSlider) {
print("Range slider value changed: (\(rangeSlider.lowerValue) , \(rangeSlider.upperValue))")
}
}
File renamed without changes.
Loading

0 comments on commit 04ddece

Please sign in to comment.