Skip to content

Commit 93d4f11

Browse files
committed
Prepare for making repo public
1 parent 861f7c1 commit 93d4f11

20 files changed

+67
-80
lines changed

.github/workflows/validate.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ on: [push]
33
jobs:
44
run-tests:
55
name: Test
6-
runs-on: [self-hosted, macOS, arm64e]
7-
defaults:
8-
run:
9-
shell: "/usr/bin/arch -arch arm64e /bin/bash {0}"
6+
runs-on: macos-13
107
strategy:
118
matrix:
9+
xcode: [14.3.1, 15.0.1]
1210
destination:
1311
[
14-
'platform=iOS Simulator,name=iPhone 12 Pro',
12+
'platform=iOS Simulator,name=iPhone 14 Pro',
1513
]
1614
steps:
1715
- name: Checkout Repo
1816
uses: actions/checkout@v2
19-
- name: Generate Xcodeproj
20-
run: swift package generate-xcodeproj
17+
- name: Setup Xcode
18+
run: sudo xcode-select -s "/Applications/Xcode_${xcode}.app/Contents/Developer"
19+
env:
20+
xcode: ${{ matrix.xcode }}
2121
- name: Run Tests
22-
run: xcodebuild test -scheme DSKit-Package -destination "${destination}"
22+
run: xcodebuild test -scheme DSKit -destination "${destination}"
2323
env:
2424
destination: ${{ matrix.destination }}

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 fabiandoublesymmetry <fabian@doublesymmetry.com>
1+
Copyright (c) 2023 Double Symmetry GmbH <oss@doublesymmetry.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DSKit
22

3-
## Requirements
3+
A collection of helpers across the Swift Language, UIKit and SwiftUI.
44

55
## Installation
66

@@ -9,22 +9,16 @@ Swift Package Manager is a tool for managing the distribution of Swift code. It
99
To integrate DSKit into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift:
1010

1111
dependencies: [
12-
.package(url: "git@github.com:DoubleSymmetry/DSKit.git", .upToNextMajor(from: "0.0.1"))
12+
.package(url: "https://github.com/doublesymmetry/DSKit.git", .upToNextMajor(from: "0.0.1"))
1313
]
1414

15-
Make sure you are having a SSH key of type RSA.
16-
Be aware that DSKit is a private Repository.
15+
## Overview of Package
1716

18-
## Creating a new version
19-
20-
To create a new version, follow these steps:
21-
1. Tag latest commit with the new version number, e.g. **0.1.3**.
22-
2. Publish the tag.
23-
3. In a project that uses DSKit, have SPM try to update the dependency.
17+
_Coming later!_
2418

2519
## Author
2620

27-
fabiandoublesymmetry, fabian@doublesymmetry.com
21+
Double Symmetry GmbH, oss@doublesymmetry.com
2822

2923
## License
3024

Sources/DSKit/Applicable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public extension Applicable {
2222
///
2323
/// - Parameter closure: A closure with self as argument.
2424
/// - Returns: self
25-
public func apply(closure: Closure1<Self>) -> Self {
25+
func apply(closure: Closure1<Self>) -> Self {
2626
closure(self)
2727
return self
2828
}

Sources/DSKit/Collection+SafeAccess.swift.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public extension Collection {
1616
/// // this will assign nil to the variable, because the index is not within the bounds of the array.
1717
/// let supportingActor = cast[safe: 4]
1818
/// ```
19-
public subscript (safe index: Index) -> Element? {
19+
subscript (safe index: Index) -> Element? {
2020
return indices.contains(index) ? self[index] : nil
2121
}
2222
}

Sources/DSKit/String+HtmlAttributedString.swift Sources/DSKit/UIKit/String+HtmlAttributedString.swift

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// DSKit
44
//
55
// Created by Fabian Sulzbacher on 24.05.22.
6-
// Copyright © 2022 Double Symmetry GmbH. All rights reserved.
76
//
87

98
import Foundation
File renamed without changes.

Sources/DSKit/UIScrollView+scrollToBottom.swift Sources/DSKit/UIKit/UIScrollView+scrollToBottom.swift

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// DSKit
44
//
55
// Created by Jules on 23.06.22.
6-
// Copyright © 2022 Double Symmetry GmbH. All rights reserved.
76
//
87

98
import UIKit.UIScrollView

Sources/DSKit/GradientLayer.swift Sources/DSKit/UIKit/UIView/Gradient/GradientLayer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// GradientLayer.swift
33
// DSKit
44
//
5-
// Created by Fabian
5+
// Created by Fabian Sulzbacher
66
//
77

88
import Foundation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//
2+
// UIView+TapGestureRecognizer.swift
3+
// DSKit
4+
//
5+
// Created by David Chavez on 01.03.22.
6+
//
7+
8+
import UIKit
9+
10+
extension UIView {
11+
// Enum to define associated object keys
12+
private enum AssociatedObjectKeys {
13+
static var tapGestureRecognizer = "DS_TapGestureRecognizerKey"
14+
}
15+
16+
// Type alias for the tap gesture action
17+
private typealias TapAction = (() -> Void)?
18+
19+
// Computed property for the tap gesture action
20+
private var tapAction: TapAction? {
21+
get {
22+
return objc_getAssociatedObject(self, &AssociatedObjectKeys.tapGestureRecognizer) as? TapAction
23+
}
24+
set {
25+
if let newValue = newValue {
26+
objc_setAssociatedObject(self, &AssociatedObjectKeys.tapGestureRecognizer, newValue, .OBJC_ASSOCIATION_RETAIN)
27+
}
28+
}
29+
}
30+
31+
// Adds a tap gesture recognizer to the view
32+
@objc public func onTapGesture(perform action: @escaping () -> Void) {
33+
isUserInteractionEnabled = true
34+
tapAction = action
35+
36+
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(handleTapGesture))
37+
addGestureRecognizer(tapGestureRecognizer)
38+
}
39+
40+
// Handles the tap gesture
41+
@objc private func handleTapGesture(sender: UITapGestureRecognizer) {
42+
if let action = tapAction {
43+
action?()
44+
} else {
45+
print("No action")
46+
}
47+
}
48+
}

Sources/DSKit/UIView+TapGestureRecognizer.swift

-53
This file was deleted.

Tests/DSKitTests/ApplyTests.swift Tests/DSKitTests/ApplicableTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//
2-
// ApplyTests.swift
2+
// ApplicableTests.swift
33
//
44
//
55
// Created by Fabian Sulzbacher on 29.04.21.
66
//
77
import XCTest
88
@testable import DSKit
99

10-
final class ApplyTests: XCTestCase {
10+
final class ApplicableTests: XCTestCase {
1111
func testApplyBackgroundColor() {
1212
let redView = UIView().apply {
1313
$0.backgroundColor = .red

0 commit comments

Comments
 (0)