Skip to content

Commit

Permalink
Task/adopt stepperview styling (#68)
Browse files Browse the repository at this point in the history
* 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 <Badarinath_Venkatnarayansetty@intuit.com>
  • Loading branch information
badrinathvm and Badarinath Venkatnarayansetty committed Apr 4, 2021
1 parent a60fde9 commit bee85d4
Show file tree
Hide file tree
Showing 144 changed files with 3,221 additions and 719 deletions.
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
- colon
- implicit_getter
- empty_enum_arguments
opt_in_rules: # some rules are only opt-in
# Find all the available rules by running: swiftlint rules
- trailing_semicolon
Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- SnapshotTesting (1.7.2)
- StepperView (1.5.5)
- StepperView (1.5.6)

DEPENDENCIES:
- SnapshotTesting (~> 1.7.2)
Expand All @@ -16,8 +16,8 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
SnapshotTesting: 8caa6661fea7c8019d5b46de77c16bab99c36c5c
StepperView: cad8dbf2a2abf72518db38583c97a75546d3229c
StepperView: d21adb48db4689804dddd2f2e436447ffe97e3c0

PODFILE CHECKSUM: 8b713604471a4b42c3cfe96f708359ac25857036

COCOAPODS: 1.10.0
COCOAPODS: 1.10.1
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/StepperView.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

942 changes: 479 additions & 463 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Example/StepperView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
1B4874DB2467B56900B253C6 /* WatchExampleView1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DA2467B56900B253C6 /* WatchExampleView1.swift */; };
1B4874DD2467B59400B253C6 /* WatchExampleView2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DC2467B59400B253C6 /* WatchExampleView2.swift */; };
1B4874DF2467B70600B253C6 /* WatchExampleView3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4874DE2467B70600B253C6 /* WatchExampleView3.swift */; };
1B4E325426190E39008DB900 /* ExampleView11.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B4E325326190E38008DB900 /* ExampleView11.swift */; };
1BA768E225ACC05E00E36EB3 /* ExampleView10.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */; };
1BA9B80C2447DCC8007A6BB9 /* ExampleView5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BA9B80B2447DCC8007A6BB9 /* ExampleView5.swift */; };
1BC9B648248D820A0012F8AC /* ExampleView9.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BC9B647248D82090012F8AC /* ExampleView9.swift */; };
Expand Down Expand Up @@ -120,6 +121,7 @@
1B4874DA2467B56900B253C6 /* WatchExampleView1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView1.swift; sourceTree = "<group>"; };
1B4874DC2467B59400B253C6 /* WatchExampleView2.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView2.swift; sourceTree = "<group>"; };
1B4874DE2467B70600B253C6 /* WatchExampleView3.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchExampleView3.swift; sourceTree = "<group>"; };
1B4E325326190E38008DB900 /* ExampleView11.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView11.swift; sourceTree = "<group>"; };
1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView10.swift; sourceTree = "<group>"; };
1BA9B80B2447DCC8007A6BB9 /* ExampleView5.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView5.swift; sourceTree = "<group>"; };
1BC9B647248D82090012F8AC /* ExampleView9.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleView9.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -275,6 +277,7 @@
1B4355C02471D25C0005D2BA /* ExampleView8.swift */,
1BC9B647248D82090012F8AC /* ExampleView9.swift */,
1BA768E125ACC05D00E36EB3 /* ExampleView10.swift */,
1B4E325326190E38008DB900 /* ExampleView11.swift */,
);
name = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -727,6 +730,7 @@
1BD7CB74244102C700F17698 /* ExampleView4.swift in Sources */,
1BD7CB76244103A100F17698 /* ExampleView.swift in Sources */,
1BF00787244A48A700DE5BF9 /* StepTextView.swift in Sources */,
1B4E325426190E39008DB900 /* ExampleView11.swift in Sources */,
1BD0BED32469C574005CE5FE /* ExampleView7.swift in Sources */,
1BD42F2624552D3F008D4DAB /* ExampleView6.swift in Sources */,
1BD7CB70243FCD4800F17698 /* ImageTextRowView.swift in Sources */,
Expand Down
8 changes: 4 additions & 4 deletions Example/StepperView/ExampleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import StepperView
struct ExampleView: View {
var body: some View {
TabView {
// Example5 is commeneted as it's known issue of GeometryReader breaking only on simulator on Xcode 11.4+ onwards,
// However this works perfectly on real device and on Xcode >= 11.2 && <= 11.3, feel free to uncomment and test it out.
ExampleView5()
.tabItem { Text("Horizontal") .foregroundColor(Color.black) }
ExampleView2()
.tabItem { Text("Usecase") .foregroundColor(Color.black) }
ExampleView11()
.tabItem { Text("LifeCycle") .foregroundColor(Color.black) }
// ExampleView2()
// .tabItem { Text("Usecase") .foregroundColor(Color.black) }
ExampleView3()
.tabItem { Text("Card") .foregroundColor(Color.black) }
ExampleView6()
Expand Down
115 changes: 115 additions & 0 deletions Example/StepperView/ExampleView11.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
//
// ExampleView11.swift
// StepperView_Example
//
// Created by Venkatnarayansetty, Badarinath on 4/3/21.
// Copyright © 2021 CocoaPods. All rights reserved.
//

import SwiftUI
import UIKit
import StepperView

let customGreen = UIColor(red: 0.00, green: 0.80, blue: 0.66, alpha: 1.00)

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct ExampleView11: View {
let cells = [ CustomStepTextView(text: "Basic Details"),
CustomStepTextView(text: "Company Details"),
CustomStepTextView(text: "Subscription plan"),
CustomStepTextView(text: "Payment details")
]

//Custom Indicators to point.
let indicators = [
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()),
StepperIndicationType.custom(IndicatorImageView(name: "completed").eraseToAnyView()),
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView()),
StepperIndicationType.custom(IndicatorImageView(name:"pending").eraseToAnyView())
]

var body: some View {
VStack(alignment: .leading, spacing: 10) {
StepperView()
.addSteps([
CustomStepTextView(text: "Announced"),
CustomStepTextView(text: "Dividend Payment")
])
.indicators([
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
StepperIndicationType.custom(IndicatorImageView(name: "completed"))
])
.lineOptions(StepperLineOptions.custom(4, Color(customGreen)))
.stepLifeCycles([StepLifeCycle.completed, .completed ])
.spacing(50)

Divider()

StepperView()
.addSteps(cells)
.indicators(indicators)
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen)))
.stepLifeCycles([StepLifeCycle.completed, .completed, .pending, .pending])
.spacing(40)
.padding(.leading, 50)

Divider()

StepperView()
.addSteps([
CustomStepTextView(text: "Card details"),
CustomStepTextView(text: "Application review"),
CustomStepTextView(text: "Authenticate OTP"),
CustomStepTextView(text: "Create password")
])
.indicators([
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
StepperIndicationType.custom(IndicatorImageView(name: "completed")),
StepperIndicationType.custom(IndicatorImageView(name:"pending"))
])
.lineOptions(StepperLineOptions.rounded(4, 8, Color(customGreen)))
.stepLifeCycles([StepLifeCycle.completed, .completed, .completed, .pending])
.spacing(40)
.padding(.leading, 50)

Spacer()
}
}
}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct IndicatorImageView: View {
var name:String
var body: some View {
ZStack {
Circle()
.foregroundColor(Color.white)
.overlay(Image(name)
.resizable()
.frame(width: 30, height: 30))
.frame(width: 40, height: 40)
}

}
}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct CustomStepTextView: View {
var text:String
var body: some View {
VStack {
TextView(text: text, font: Font.system(size: 16, weight: Font.Weight.regular))
.foregroundColor(Color.black)
.frame(maxWidth: .infinity, alignment: .leading)
.offset(x: -15)
}
}
}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct ExampleView11_Previews: PreviewProvider {
static var previews: some View {
ExampleView11()
}
}
6 changes: 3 additions & 3 deletions Example/StepperView/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "tick.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "completed.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Example/StepperView/Images.xcassets/pending.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "placeholderCircle.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bee85d4

Please sign in to comment.