Skip to content

Commit 49a42e2

Browse files
authored
Merge pull request #133 from ChaosCoder/main
Allow initialization and addition of AcknowList
2 parents c361ba8 + 3f99775 commit 49a42e2

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Sources/AcknowList/AcknowList.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,20 @@ public struct AcknowList {
3737
Footer text to be displayed below the list of the acknowledgements.
3838
*/
3939
public let footerText: String?
40+
41+
public init(headerText: String? = nil, acknowledgements: [Acknow], footerText: String? = nil) {
42+
self.headerText = headerText
43+
self.acknowledgements = acknowledgements
44+
self.footerText = footerText
45+
}
4046
}
4147

4248
extension AcknowList {
43-
static func +(lhs: AcknowList, rhs: AcknowList) -> AcknowList {
44-
return AcknowList(
45-
headerText: lhs.headerText ?? rhs.headerText,
46-
acknowledgements: lhs.acknowledgements + rhs.acknowledgements,
47-
footerText: lhs.footerText ?? rhs.footerText
48-
)
49-
}
49+
public static func +(lhs: AcknowList, rhs: AcknowList) -> AcknowList {
50+
return AcknowList(
51+
headerText: lhs.headerText ?? rhs.headerText,
52+
acknowledgements: lhs.acknowledgements + rhs.acknowledgements,
53+
footerText: lhs.footerText ?? rhs.footerText
54+
)
55+
}
5056
}

0 commit comments

Comments
 (0)