Skip to content

Commit 170de9f

Browse files
release: v1.0.1
1 parent 08d3863 commit 170de9f

7 files changed

Lines changed: 5 additions & 13 deletions

File tree

Sources/LabelButtonKit/Examples/HorizontalStackExampleView.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import SwiftUI
99

1010
public struct HorizontalStackExampleView: View {
1111

12-
// MARK: Properties
13-
12+
// MARK: - Properties
1413
/// This example uses the sizeCategory (dynamicTypeSize) just to show that it can be used outside the LabelButtonListView. LabelButtons already adjust accordingly.
1514
@Environment(\.dynamicTypeSize) var sizeCategory
1615

Sources/LabelButtonKit/Examples/ListExampleView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SwiftUI
99

1010
public struct ListExampleView: View {
1111

12-
// MARK: Properties
12+
// MARK: - Properties
1313
/// Example of changing the value of some variable
1414
@State var result: Int = 0
1515
/// Example of linking a color to the backgroundColor of the LabelButton
@@ -26,6 +26,7 @@ public struct ListExampleView: View {
2626
self._labelButtonExample = StateObject(wrappedValue: labelButtonExample)
2727
}
2828

29+
// MARK: - View
2930
public var body: some View {
3031
VStack {
3132
LabelButtonListView(data: buttons)
@@ -39,6 +40,7 @@ public struct ListExampleView: View {
3940
}
4041
}
4142

43+
// MARK: - Auxiliary Methods
4244
private func createLabels() {
4345

4446
/// Creates the first label

Sources/LabelButtonKit/Examples/SimpleListExampleView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import SwiftUI
1212
*/
1313
public struct SimpleListExampleView: View {
1414

15-
// MARK: Properties
15+
// MARK: - Properties
1616
@State var labelButtons: [LabelButton] = [LabelButton(backgroundColor: .purple.opacity(0.50)), LabelButton(), LabelButton()]
1717

1818
// MARK: - Initializer

Sources/LabelButtonKit/LabelButtonListView.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftUI
1313
public struct LabelButtonListView: View {
1414

1515
// MARK: - Properties
16-
1716
/// The environment object containing the SizeCategory for DynamicType/accessibility purposes
1817
@Environment(\.dynamicTypeSize) var sizeCategory
1918

@@ -32,7 +31,6 @@ public struct LabelButtonListView: View {
3231
}
3332

3433
// MARK: - Initializer
35-
3634
/**
3735
An inlinable public init for this view. Creates a SwiftUIView that consists of a container with LabelButtons.
3836
- parameters:
@@ -54,7 +52,6 @@ public struct LabelButtonListView: View {
5452
}
5553

5654
// MARK: - View
57-
5855
public var body: some View {
5956
// Verifies if it doesn't need the larger content. If it doesn't, creates an HStack. If so, creates a VStack.
6057
if !needsLargerContent {

Sources/LabelButtonKit/LabelButtonView.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftUI
1313
public struct LabelButtonView: View {
1414

1515
// MARK: - Properties
16-
1716
/// The environment object containing the SizeCategory for DynamicType/accessibility purposes
1817
@Environment(\.dynamicTypeSize) var sizeCategory
1918

@@ -31,13 +30,11 @@ public struct LabelButtonView: View {
3130
}
3231

3332
// MARK: - Initializer
34-
3533
public init(label: LabelButton) {
3634
self._label = StateObject(wrappedValue: label)
3735
}
3836

3937
// MARK: - View
40-
4138
public var body: some View {
4239
Button(action: label.action) {
4340
if needsLargerContent {

Sources/LabelButtonKit/Model/LabelButton.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import SwiftUI
1313
public class LabelButton: Labelable, Identifiable, ObservableObject {
1414

1515
// MARK: - Properties
16-
1716
/// The Identifiable protocol conformance
1817
public var id: String = UUID().uuidString
1918
/// A default implementation for tests and previews
@@ -43,7 +42,6 @@ public class LabelButton: Labelable, Identifiable, ObservableObject {
4342
@Published public var action: () -> ()
4443

4544
// MARK: - Initializers
46-
4745
public init(icon: String = String("arrow.triangle.turn.up.right.circle"), text: String = String(localized: "Directions"), textColor: Color = .primary, iconColor: Color = .primary, backgroundColor: Color = Color.secondary.opacity(0.15), colorOpacity: CGFloat = 0.75, cornerRadius: CGFloat = 12, horizontalPadding: CGFloat = 10, verticalPadding: CGFloat = 10, frame: CGSize = CGSize(width: 125, height: 75), action: @escaping () -> () = { }) {
4846

4947
self.icon = icon

Sources/LabelButtonKit/Views/Components/LabelButtonHStackContentView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ struct LabelButtonHStackContentView: View {
2121
@Binding var colorOpacity: CGFloat
2222

2323
// MARK: - Initializer
24-
2524
public init(icon: Binding<String>, text: Binding<String>, iconColor: Binding<Color>, textColor: Binding<Color>, colorOpacity: Binding<CGFloat>) {
2625
self._icon = icon
2726
self._text = text

0 commit comments

Comments
 (0)