Skip to content

Commit bee85d4

Browse files
badrinathvmBadarinath Venkatnarayansetty
and
Badarinath Venkatnarayansetty
authored
Task/adopt stepperview styling (#68)
* Implementation of rounded lines and life cycle status for each of the steps * Swift lint configuraation for implicit getter and empty enum arguments * Added Lifecycle tab and corrected comments * Added more examples for life style * Updated jazzy documentation for 1.6.0 * Pictorial representation of lien customizations and life cycle events * Updates to jazzy docs Co-authored-by: Badarinath Venkatnarayansetty <[email protected]>
1 parent a60fde9 commit bee85d4

File tree

144 files changed

+3221
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+3221
-719
lines changed

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
disabled_rules: # rule identifiers to exclude from running
22
- trailing_whitespace
33
- colon
4+
- implicit_getter
5+
- empty_enum_arguments
46
opt_in_rules: # some rules are only opt-in
57
# Find all the available rules by running: swiftlint rules
68
- trailing_semicolon

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- SnapshotTesting (1.7.2)
3-
- StepperView (1.5.5)
3+
- StepperView (1.5.6)
44

55
DEPENDENCIES:
66
- SnapshotTesting (~> 1.7.2)
@@ -16,8 +16,8 @@ EXTERNAL SOURCES:
1616

1717
SPEC CHECKSUMS:
1818
SnapshotTesting: 8caa6661fea7c8019d5b46de77c16bab99c36c5c
19-
StepperView: cad8dbf2a2abf72518db38583c97a75546d3229c
19+
StepperView: d21adb48db4689804dddd2f2e436447ffe97e3c0
2020

2121
PODFILE CHECKSUM: 8b713604471a4b42c3cfe96f708359ac25857036
2222

23-
COCOAPODS: 1.10.0
23+
COCOAPODS: 1.10.1

Example/Pods/Local Podspecs/StepperView.podspec.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 479 additions & 463 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/StepperView-iOS/StepperView-iOS-Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/StepperView-watchOS/StepperView-watchOS-Info.plist

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/StepperView.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
1B4874DB2467B56900B253C6 /* WatchExampleView1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DA2467B56900B253C6 /* WatchExampleView1.swift */; };
2121
1B4874DD2467B59400B253C6 /* WatchExampleView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DC2467B59400B253C6 /* WatchExampleView2.swift */; };
2222
1B4874DF2467B70600B253C6 /* WatchExampleView3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DE2467B70600B253C6 /* WatchExampleView3.swift */; };
23+
1B4E325426190E39008DB900 /* ExampleView11.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4E325326190E38008DB900 /* ExampleView11.swift */; };
2324
1BA768E225ACC05E00E36EB3 /* ExampleView10.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */; };
2425
1BA9B80C2447DCC8007A6BB9 /* ExampleView5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA9B80B2447DCC8007A6BB9 /* ExampleView5.swift */; };
2526
1BC9B648248D820A0012F8AC /* ExampleView9.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC9B647248D82090012F8AC /* ExampleView9.swift */; };
@@ -120,6 +121,7 @@
120121
1B4874DA2467B56900B253C6 /* WatchExampleView1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView1.swift; sourceTree = "<group>"; };
121122
1B4874DC2467B59400B253C6 /* WatchExampleView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView2.swift; sourceTree = "<group>"; };
122123
1B4874DE2467B70600B253C6 /* WatchExampleView3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView3.swift; sourceTree = "<group>"; };
124+
1B4E325326190E38008DB900 /* ExampleView11.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView11.swift; sourceTree = "<group>"; };
123125
1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView10.swift; sourceTree = "<group>"; };
124126
1BA9B80B2447DCC8007A6BB9 /* ExampleView5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView5.swift; sourceTree = "<group>"; };
125127
1BC9B647248D82090012F8AC /* ExampleView9.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView9.swift; sourceTree = "<group>"; };
@@ -275,6 +277,7 @@
275277
1B4355C02471D25C0005D2BA /* ExampleView8.swift */,
276278
1BC9B647248D82090012F8AC /* ExampleView9.swift */,
277279
1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */,
280+
1B4E325326190E38008DB900 /* ExampleView11.swift */,
278281
);
279282
name = View;
280283
sourceTree = "<group>";
@@ -727,6 +730,7 @@
727730
1BD7CB74244102C700F17698 /* ExampleView4.swift in Sources */,
728731
1BD7CB76244103A100F17698 /* ExampleView.swift in Sources */,
729732
1BF00787244A48A700DE5BF9 /* StepTextView.swift in Sources */,
733+
1B4E325426190E39008DB900 /* ExampleView11.swift in Sources */,
730734
1BD0BED32469C574005CE5FE /* ExampleView7.swift in Sources */,
731735
1BD42F2624552D3F008D4DAB /* ExampleView6.swift in Sources */,
732736
1BD7CB70243FCD4800F17698 /* ImageTextRowView.swift in Sources */,

Example/StepperView/ExampleView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import StepperView
1313
struct ExampleView: View {
1414
var body: some View {
1515
TabView {
16-
// Example5 is commeneted as it's known issue of GeometryReader breaking only on simulator on Xcode 11.4+ onwards,
17-
// However this works perfectly on real device and on Xcode >= 11.2 && <= 11.3, feel free to uncomment and test it out.
1816
ExampleView5()
1917
.tabItem { Text("Horizontal") .foregroundColor(Color.black) }
20-
ExampleView2()
21-
.tabItem { Text("Usecase") .foregroundColor(Color.black) }
18+
ExampleView11()
19+
.tabItem { Text("LifeCycle") .foregroundColor(Color.black) }
20+
// ExampleView2()
21+
// .tabItem { Text("Usecase") .foregroundColor(Color.black) }
2222
ExampleView3()
2323
.tabItem { Text("Card") .foregroundColor(Color.black) }
2424
ExampleView6()
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
//
2+
// ExampleView11.swift
3+
// StepperView_Example
4+
//
5+
// Created by Venkatnarayansetty, Badarinath on 4/3/21.
6+
// Copyright © 2021 CocoaPods. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
import UIKit
11+
import StepperView
12+
13+
let customGreen = UIColor(red: 0.00, green: 0.80, blue: 0.66, alpha: 1.00)
14+
15+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
16+
struct ExampleView11: View {
17+
let cells = [ CustomStepTextView(text: "Basic Details"),
18+
CustomStepTextView(text: "Company Details"),
19+
CustomStepTextView(text: "Subscription plan"),
20+
CustomStepTextView(text: "Payment details")
21+
]
22+
23+
//Custom Indicators to point.
24+
let indicators = [
25+
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()),
26+
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()),
27+
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView()),
28+
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView())
29+
]
30+
31+
var body: some View {
32+
VStack(alignment: .leading, spacing: 10) {
33+
StepperView()
34+
.addSteps([
35+
CustomStepTextView(text: "Announced"),
36+
CustomStepTextView(text: "Dividend Payment")
37+
])
38+
.indicators([
39+
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
40+
StepperIndicationType.custom(IndicatorImageView(name: "completed"))
41+
])
42+
.lineOptions(StepperLineOptions.custom(4, Color(customGreen)))
43+
.stepLifeCycles([StepLifeCycle.completed, .completed ])
44+
.spacing(50)
45+
46+
Divider()
47+
48+
StepperView()
49+
.addSteps(cells)
50+
.indicators(indicators)
51+
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen)))
52+
.stepLifeCycles([StepLifeCycle.completed, .completed, .pending, .pending])
53+
.spacing(40)
54+
.padding(.leading, 50)
55+
56+
Divider()
57+
58+
StepperView()
59+
.addSteps([
60+
CustomStepTextView(text: "Card details"),
61+
CustomStepTextView(text: "Application review"),
62+
CustomStepTextView(text: "Authenticate OTP"),
63+
CustomStepTextView(text: "Create password")
64+
])
65+
.indicators([
66+
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
67+
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
68+
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
69+
StepperIndicationType.custom(IndicatorImageView(name:"pending"))
70+
])
71+
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen)))
72+
.stepLifeCycles([StepLifeCycle.completed, .completed, .completed, .pending])
73+
.spacing(40)
74+
.padding(.leading, 50)
75+
76+
Spacer()
77+
}
78+
}
79+
}
80+
81+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
82+
struct IndicatorImageView: View {
83+
var name:String
84+
var body: some View {
85+
ZStack {
86+
Circle()
87+
.foregroundColor(Color.white)
88+
.overlay(Image(name)
89+
.resizable()
90+
.frame(width: 30, height: 30))
91+
.frame(width: 40, height: 40)
92+
}
93+
94+
}
95+
}
96+
97+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
98+
struct CustomStepTextView: View {
99+
var text:String
100+
var body: some View {
101+
VStack {
102+
TextView(text: text, font: Font.system(size: 16, weight: Font.Weight.regular))
103+
.foregroundColor(Color.black)
104+
.frame(maxWidth: .infinity, alignment: .leading)
105+
.offset(x: -15)
106+
}
107+
}
108+
}
109+
110+
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
111+
struct ExampleView11_Previews: PreviewProvider {
112+
static var previews: some View {
113+
ExampleView11()
114+
}
115+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info" : {
3-
"version" : 1,
4-
"author" : "xcode"
3+
"author" : "xcode",
4+
"version" : 1
55
}
6-
}
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "tick.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "completed.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "placeholderCircle.svg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)