Skip to content

Commit 06cb74f

Browse files
committed
Initial commit
0 parents  commit 06cb74f

File tree

10 files changed

+180
-0
lines changed

10 files changed

+180
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

LICENSE.txt

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
BLUE HUSKY LICENSE 0 - PUBLIC DOMAIN - OPUS 7
2+
3+
0: LAYMAN'S TERMS
4+
This section is meant to explain the purpose of this License in Layman's
5+
terms, and should thusly never be seen as legally binding. This disclaimer does
6+
not apply to further sections of this License.
7+
8+
1. This is no one's product and is in the public domain
9+
2. You're not responsible for any bad things that might happen because someone
10+
used this product
11+
3. If you use someone else's stuff, it's still theirs
12+
13+
14+
1: DECLARATION OF CREATION
15+
This product was made by Ben Leggiero in 2019
16+
17+
Ben Leggiero may be reached at BenLeggiero@Gmail.com
18+
19+
20+
2: DEFINITIONS
21+
- "License": this text.
22+
- "Product": the product with which this License was distributed, and any
23+
assets necessary for its use.
24+
- "Licensor": any entity or entities involved in distribution of the Product
25+
and of this License.
26+
27+
28+
3: NOTICE OF PERMISSIONS
29+
1. Permission is hereby granted to any entity obtaining a copy of the Product,
30+
to use, copy, modify, redistribute, sublicense, sell copies of, and/or
31+
otherwise handle the Product, and to permit entities to whom the Product is
32+
furnished to also do so, given the following conditions are obeyed:
33+
a. The above copyright notice and this permission notice shall be included
34+
in all copies and/or substantial portions of the Product.
35+
b. This License shall be blatantly provided, unmodified, along with the
36+
Product.
37+
2. The Licensor reserves the right to edit this License at any time under the
38+
terms of BH-1-PS, given the following conditions are obeyed:
39+
a. The Licensor agrees to increment the Opus number of this License to
40+
correspond with version changes.
41+
b. The Licensor agrees to never publish two or more versions of this License
42+
under the same Opus number.
43+
c. The Licensor agrees to notify the License's original author of any
44+
changes made to the License. If such author is not reasonably accessible,
45+
the Licensor agrees to notify any known authors which have previously
46+
contributed to the License.
47+
48+
49+
4: REFUSAL OF OWNERSHIP
50+
The Licensor hereby refuses ownership, both fully and partially, of the
51+
Product, and agrees to continue to refuse ownership so long as this License is
52+
provided with the Product.
53+
54+
If any part of the Product is covered under copyright, trademark,
55+
intellectual property, or any other form of ownership, to the Licensors or any
56+
other entity, this License shall not invalidate that ownership in any way.
57+
58+
59+
5: ACCORDANCE WITH THE LAW
60+
The terms that make up the whole and parts of this License shall not apply
61+
where local, state, provincial, federal, national, or any other law prohibits
62+
such terms.
63+
64+
65+
6: DISCLAIMER
66+
THE PRODUCT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67+
IMPLIED. IN NO EVENT SHALL THE CREATOR OR LICENSORS BE LIABLE FOR ANY CLAIM,
68+
DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR
69+
OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE PRODUCT OR THE USE
70+
OR OTHER DEALINGS IN OR WITH THE PRODUCT.

Package.swift

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// swift-tools-version:5.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "PropertyWrapper Protocol",
8+
products: [
9+
// Products define the executables and libraries produced by a package, and make them visible to other packages.
10+
.library(
11+
name: "PropertyWrapper Protocol",
12+
targets: ["PropertyWrapper Protocol"]),
13+
],
14+
dependencies: [
15+
// Dependencies declare other packages that this package depends on.
16+
// .package(url: /* package url */, from: "1.0.0"),
17+
],
18+
targets: [
19+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
20+
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
21+
.target(
22+
name: "PropertyWrapper Protocol",
23+
dependencies: []),
24+
.testTarget(
25+
name: "PropertyWrapper ProtocolTests",
26+
dependencies: ["PropertyWrapper Protocol"]),
27+
]
28+
)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# `PropertyWrapper` Protocol #
2+
3+
Swift 5.1 introduced the wonderful `@propertyWrapper` feature, but unfortunately it's a little difficult to genericize.
4+
5+
Conform to this protocol to use any property wrapper type more generically.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// PropertyWrapper_Protocol.swift
3+
// PropertyWrapper Protocol
4+
//
5+
// Created by Ben Leggiero on 2019-09-23.
6+
// Copyright © 2019 Ben Leggiero BH-0-PD
7+
//
8+
9+
/// Conform to this protocol to use any property wrapper type more generically.
10+
public protocol PropertyWrapper {
11+
12+
/// The type of value this property wrapper wraps
13+
associatedtype WrappedValue
14+
15+
/// The value this property wrapper wraps
16+
var wrappedValue: WrappedValue { get }
17+
}
18+
19+
20+
21+
/// Like `PropertyWrapper`, but explicitly calling out mutability.
22+
///
23+
/// Note that this is not _required_ for mutable property wrappers, but it will allow consumers to
24+
/// more easily interact with your property wrapper.
25+
public protocol MutablePropertyWrapper: PropertyWrapper {
26+
27+
/// The value this property wrapper wraps
28+
var wrappedValue: WrappedValue { get set }
29+
}

Tests/LinuxMain.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import XCTest
2+
3+
import PropertyWrapper_ProtocolTests
4+
5+
var tests = [XCTestCaseEntry]()
6+
tests += PropertyWrapper_ProtocolTests.allTests()
7+
XCTMain(tests)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import XCTest
2+
@testable import PropertyWrapper_Protocol
3+
4+
final class PropertyWrapper_ProtocolTests: XCTestCase {
5+
func testTodo() {
6+
// No tests I can think of 🤷🏽‍♂️
7+
}
8+
9+
static var allTests = [
10+
("testTodo", testTodo),
11+
]
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import XCTest
2+
3+
#if !canImport(ObjectiveC)
4+
public func allTests() -> [XCTestCaseEntry] {
5+
return [
6+
testCase(PropertyWrapper_ProtocolTests.allTests),
7+
]
8+
}
9+
#endif

0 commit comments

Comments
 (0)