Skip to content

Commit 37f5356

Browse files
author
Daniel Slone
committed
updated variable naming
1 parent da53fa8 commit 37f5356

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class CarouselCollectionViewCell: UICollectionViewCell {}
1212
1313
collectionView.register(
1414
CarouselCollectionViewCell.self,
15-
forCellWithReuseIdentifier: CarouselCollectionViewCell.reuseID
15+
forCellWithReuseIdentifier: CarouselCollectionViewCell.reuseIdentifier
1616
)
1717
```

Sources/ReuseIdentifier/ReuseIdentifier.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
/// @ReuseIdentifier
55
/// class CarouselCollectionViewCell: UICollectionViewCell {}
66
///
7-
/// CarouselCollectionViewCell.reuseID
7+
/// CarouselCollectionViewCell.reuseIdentifier
88
///
99
/// produces a static String,`CarouselCollectionViewCell`
10-
@attached(member, names: named(reuseID))
10+
@attached(member, names: named(reuseIdentifier))
1111
public macro ReuseIdentifier() = #externalMacro(module: "ReuseIdentifierMacros", type: "ReuseIdentifierMacro")

Sources/ReuseIdentifierClient/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import ReuseIdentifier
33
@ReuseIdentifier
44
class CarouselCollectionViewCell {}
55

6-
let reuseID = CarouselCollectionViewCell.reuseID
6+
let reuseID = CarouselCollectionViewCell.reuseIdentifier

Sources/ReuseIdentifierMacros/ReuseIdentifierMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public struct ReuseIdentifierMacro: MemberMacro {
2323
throw ReuseIdentifierError.onlyApplicableToClass
2424
}
2525

26-
let reuseID = try VariableDeclSyntax("static var reuseID: String") {
26+
let reuseID = try VariableDeclSyntax("static var reuseIdentifier: String") {
2727
StringLiteralExprSyntax(content: classDecl.identifier.text)
2828
}
2929

Tests/ReuseIdentifierTests/ReuseIdentifierTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class ReuseIdentifierTests: XCTestCase {
1818
expandedSource: """
1919
2020
class CarouselCollectionViewCell {
21-
static var reuseID: String {
21+
static var reuseIdentifier: String {
2222
"CarouselCollectionViewCell"
2323
}
2424
}

0 commit comments

Comments
 (0)