Skip to content

Commit b14ee84

Browse files
committed
Rename to SetNeedsDisplay
1 parent b713933 commit b14ee84

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
import PackageDescription
55

66
let package = Package(
7-
name: "LayoutInvalidating",
7+
name: "SetNeedsDisplay",
88
products: [
99
.library(
10-
name: "LayoutInvalidating",
11-
targets: ["LayoutInvalidating"]),
10+
name: "SetNeedsDisplay",
11+
targets: ["SetNeedsDisplay"]),
1212
],
1313
dependencies: [],
1414
targets: [
1515
.target(
16-
name: "LayoutInvalidating",
16+
name: "SetNeedsDisplay",
1717
dependencies: []),
1818
.testTarget(
19-
name: "LayoutInvalidatingTests",
20-
dependencies: ["LayoutInvalidating"]),
19+
name: "SetNeedsDisplayTests",
20+
dependencies: ["SetNeedsDisplay"]),
2121
]
2222
)

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# LayoutInvalidating
1+
# SetNeedsDisplay
22

3-
![Tests](https://github.com/b3ll/LayoutInvalidating/workflows/Tests/badge.svg)
3+
![Tests](https://github.com/b3ll/SetNeedsDisplay/workflows/Tests/badge.svg)
44

55
This package provides a property wrapper that can be used on properties for any `NSView` or `UIView` to invalidate the layout whenever the value of said property is changed.
66

77
**Note**: This code contains some private Swift API stuff that powers `@Published` so there's a strong likelyhood this will break in the future.
88

9-
- [Introduction](#layoutinvalidating)
9+
- [Introduction](#SetNeedsDisplay)
1010
- [Usage](#usage)
1111
- [Installation](#installation)
1212
- [Requirements](#requirements)
@@ -23,7 +23,7 @@ Annotate your property of a type that conforms to `Equatable` like so:
2323
class MyView: UIView {
2424

2525
// Anytime someCustomProperty is changed, `-setNeedsLayout` will be called.
26-
@LayoutInvaldating var someCustomProperty: CGFloat = 0.0
26+
@SetNeedsDisplay var someCustomProperty: CGFloat = 0.0
2727

2828
}
2929
```
@@ -35,19 +35,19 @@ class MyView: UIView {
3535
- iOS 13+, macOS 10.15+
3636
- Swift 5.0 or higher
3737

38-
Currently LayoutInvalidating supports Swift Package Manager (or manually adding `LayoutInvalidating.swift` to your project).
38+
Currently SetNeedsDisplay supports Swift Package Manager (or manually adding `SetNeedsDisplay.swift` to your project).
3939

4040
## Swift Package Manager
4141

4242
Add the following to your `Package.swift` (or add it via Xcode's GUI):
4343

4444
```swift
45-
.package(url: "https://github.com/b3ll/LayoutInvalidating", from: "0.0.1")
45+
.package(url: "https://github.com/b3ll/SetNeedsDisplay", from: "0.0.1")
4646
```
4747

4848
# License
4949

50-
LayoutInvalidating is licensed under the [BSD 2-clause license](https://github.com/b3ll/LayoutInvalidating/blob/master/LICENSE).
50+
SetNeedsDisplay is licensed under the [BSD 2-clause license](https://github.com/b3ll/SetNeedsDisplay/blob/master/LICENSE).
5151

5252
# Thanks
5353

Sources/LayoutInvalidating/LayoutInvalidating.swift renamed to Sources/SetNeedsDisplay/SetNeedsDisplay.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import UIKit
88

99
/// A property wrapper for `UIView` or `NSView` (depending on platform) that will invalidate the layout of the view when the property's value is changed to something new.
1010
@propertyWrapper
11-
public final class LayoutInvalidating<Value> where Value: Equatable {
11+
public final class SetNeedsDisplay<Value> where Value: Equatable {
1212

1313
#if os(macOS)
1414
public typealias ViewType = NSView
@@ -19,7 +19,7 @@ public final class LayoutInvalidating<Value> where Value: Equatable {
1919
public static subscript<EnclosingSelf>(
2020
_enclosingInstance observed: EnclosingSelf,
2121
wrapped wrappedKeyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>,
22-
storage storageKeyPath: ReferenceWritableKeyPath<EnclosingSelf, LayoutInvalidating>
22+
storage storageKeyPath: ReferenceWritableKeyPath<EnclosingSelf, SetNeedsDisplay>
2323
) -> Value where EnclosingSelf: ViewType {
2424
get {
2525
return observed[keyPath: storageKeyPath].stored

Tests/LinuxMain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import XCTest
22

3-
import LayoutInvalidatingTests
3+
import SetNeedsDisplayTests
44

55
var tests = [XCTestCaseEntry]()
6-
tests += LayoutInvalidatingTests.allTests()
6+
tests += SetNeedsDisplayTests.allTests()
77
XCTMain(tests)

Tests/LayoutInvalidatingTests/LayoutInvalidatingTests.swift renamed to Tests/SetNeedsDisplayTests/SetNeedsDisplayTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import XCTest
2-
@testable import LayoutInvalidating
2+
@testable import SetNeedsDisplay
33

44
#if os(macOS)
55
import AppKit
66

77
class TestView: NSView {
88

9-
@LayoutInvalidating var testPadding: CGFloat = 0.0
9+
@SetNeedsDisplay var testPadding: CGFloat = 0.0
1010

1111
var layoutWasInvalidated: Bool = false
1212

@@ -30,7 +30,7 @@ import UIKit
3030

3131
class TestView: UIView {
3232

33-
@LayoutInvalidating var testPadding: CGFloat = 0.0
33+
@SetNeedsDisplay var testPadding: CGFloat = 0.0
3434

3535
var layoutWasInvalidated: Bool = false
3636

@@ -49,7 +49,7 @@ class TestView: UIView {
4949
}
5050
#endif
5151

52-
final class LayoutInvalidatingTests: XCTestCase {
52+
final class SetNeedsDisplayTests: XCTestCase {
5353

5454
func testLayoutInvalidation() {
5555
let view = TestView(frame: .zero)

Tests/LayoutInvalidatingTests/XCTestManifests.swift renamed to Tests/SetNeedsDisplayTests/XCTestManifests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import XCTest
33
#if !canImport(ObjectiveC)
44
public func allTests() -> [XCTestCaseEntry] {
55
return [
6-
testCase(LayoutInvalidatingTests.allTests),
6+
testCase(SetNeedsDisplayTests.allTests),
77
]
88
}
99
#endif

0 commit comments

Comments
 (0)