Skip to content

Commit

Permalink
updated variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Slone committed Jun 7, 2023
1 parent da53fa8 commit 37f5356
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class CarouselCollectionViewCell: UICollectionViewCell {}
collectionView.register(
CarouselCollectionViewCell.self,
forCellWithReuseIdentifier: CarouselCollectionViewCell.reuseID
forCellWithReuseIdentifier: CarouselCollectionViewCell.reuseIdentifier
)
```
4 changes: 2 additions & 2 deletions Sources/ReuseIdentifier/ReuseIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
/// @ReuseIdentifier
/// class CarouselCollectionViewCell: UICollectionViewCell {}
///
/// CarouselCollectionViewCell.reuseID
/// CarouselCollectionViewCell.reuseIdentifier
///
/// produces a static String,`CarouselCollectionViewCell`
@attached(member, names: named(reuseID))
@attached(member, names: named(reuseIdentifier))
public macro ReuseIdentifier() = #externalMacro(module: "ReuseIdentifierMacros", type: "ReuseIdentifierMacro")
2 changes: 1 addition & 1 deletion Sources/ReuseIdentifierClient/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import ReuseIdentifier
@ReuseIdentifier
class CarouselCollectionViewCell {}

let reuseID = CarouselCollectionViewCell.reuseID
let reuseID = CarouselCollectionViewCell.reuseIdentifier
2 changes: 1 addition & 1 deletion Sources/ReuseIdentifierMacros/ReuseIdentifierMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public struct ReuseIdentifierMacro: MemberMacro {
throw ReuseIdentifierError.onlyApplicableToClass
}

let reuseID = try VariableDeclSyntax("static var reuseID: String") {
let reuseID = try VariableDeclSyntax("static var reuseIdentifier: String") {
StringLiteralExprSyntax(content: classDecl.identifier.text)
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/ReuseIdentifierTests/ReuseIdentifierTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class ReuseIdentifierTests: XCTestCase {
expandedSource: """
class CarouselCollectionViewCell {
static var reuseID: String {
static var reuseIdentifier: String {
"CarouselCollectionViewCell"
}
}
Expand Down

0 comments on commit 37f5356

Please sign in to comment.