Skip to content

Commit

Permalink
Add Swift Package Manager support
Browse files Browse the repository at this point in the history
  • Loading branch information
batanus authored Jul 11, 2023
2 parents 7963427 + 9d5142e commit 2c1a65a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ DerivedData
*.hmap
*.ipa

# Swift Package Manager
.swiftpm

# Bundler
.bundle

Expand Down
2 changes: 2 additions & 0 deletions DMScrollBar/DMScrollBarConfiguration.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import UIKit

extension DMScrollBar {
public struct Configuration: Equatable {
/// Indicates if the scrollbar should always be visible
Expand Down
2 changes: 2 additions & 0 deletions DMScrollBar/ScrollBarIndicator.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import UIKit

final class ScrollBarIndicator: UIView {
private var indicatorImageWidthConstraint: NSLayoutConstraint?
private var indicatorImageHeightConstraint: NSLayoutConstraint?
Expand Down
2 changes: 2 additions & 0 deletions DMScrollBar/ScrollBarInfoView.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import UIKit

final class ScrollBarInfoView: UIView {
private let offsetLabel = UILabel()

Expand Down
2 changes: 2 additions & 0 deletions DMScrollBar/Utils/Configuration+Utils.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import UIKit

extension DMScrollBar.Configuration.RoundedCorners.Corner {
var cornerMask: CACornerMask {
switch self {
Expand Down
2 changes: 1 addition & 1 deletion DMScrollBar/Utils/ConvenienceFunctions.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
import UIKit

func interval<T: Comparable>(_ minimum: T, _ num: T, _ maximum: T) -> T {
return min(maximum, max(minimum, num))
Expand Down
2 changes: 2 additions & 0 deletions DMScrollBar/Utils/Sequence+Utils.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import UIKit

extension Sequence where Element == DMScrollBar.Configuration.RoundedCorners.Corner {
var cornerMask: CACornerMask {
CACornerMask(map(\.cornerMask))
Expand Down
19 changes: 19 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// swift-tools-version:5.7
import PackageDescription

let package = Package(
name: "DMScrollBar",
platforms: [.iOS(.v14)],
products: [
.library(
name: "DMScrollBar",
targets: ["DMScrollBar"]
)
],
targets: [
.target(
name: "DMScrollBar",
path: "DMScrollBar"
)
]
)

0 comments on commit 2c1a65a

Please sign in to comment.