-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from keyur-gofynd/master
Add readme files for version 1.1.0
- Loading branch information
Showing
17 changed files
with
695 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview Content/ReadmeActionSheet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## Action Sheet - Preview | ||
|
||
| Preview1 | | ||
| --- | | ||
| <img src="https://raw.githubusercontent.com/keyur-gofynd/nitrozen-ios/master/Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview%20Content/actionsheet1.png" width="300"> | | ||
|
||
## Action Sheet code snippets | ||
Action Sheet with example | ||
```swift | ||
struct ActionOptions: Identifiable { | ||
|
||
var name: String | ||
var id: UUID = UUID() | ||
var icon: String | ||
|
||
static var options: [ActionOptions] = [ | ||
.init(name: "Camera", icon: "camera"), | ||
.init(name: "Photo", icon: "photo"), | ||
] | ||
|
||
func hash(into hasher: inout Hasher) { | ||
hasher.combine(id) | ||
} | ||
|
||
} | ||
|
||
struct ActionSheet: View { | ||
|
||
var options: [ActionOptions] = ActionOptions.options | ||
@State var showingSheet = false | ||
|
||
var body: some View { | ||
List{ | ||
Section { | ||
Text("Gallary Options") | ||
.onTapGesture { | ||
self.showingSheet.toggle() | ||
} | ||
} | ||
|
||
} | ||
.nitrozenSheet(isPresented: $showingSheet, postion: .bottom, content: { | ||
NitrozenActionSheet( | ||
title: "Select Profile Picture!!", | ||
isShowing:$showingSheet, | ||
closeView: NitrozenActionSheet.CustomView.nitrozen, | ||
content: { | ||
VStack(alignment: .leading, spacing: 12){ | ||
ForEach(options) { option in | ||
HStack(alignment: .top) { | ||
Image(systemName: option.icon) | ||
Text(option.name) | ||
.body(size: .s, weight: .regular) | ||
.foregroundColor(.gray) | ||
Spacer() | ||
} | ||
.frame(height: 30.0) | ||
.padding(0) | ||
} | ||
|
||
} | ||
.padding([.top,.bottom], 10) | ||
|
||
}) | ||
|
||
}) | ||
|
||
} | ||
|
||
} | ||
|
||
``` |
130 changes: 130 additions & 0 deletions
130
Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview Content/ReadmeAlert.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
## Alert - Preview | ||
|
||
| Preview1 | Preview2 | | ||
| --- | --- | | ||
| <img src="https://raw.githubusercontent.com/keyur-gofynd/nitrozen-ios/master/Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview%20Content/alert1.png" width="300"> | <img src="https://raw.githubusercontent.com/keyur-gofynd/nitrozen-ios/master/Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview%20Content/alert2.png" width="300"> | | ||
|
||
## Alert code snippets | ||
Alert with example | ||
```swift | ||
struct Alerts: View { | ||
|
||
@State var canShowAlert1: Bool = false | ||
@State var canShowAlert2: Bool = false | ||
|
||
|
||
var body: some View { | ||
|
||
List { | ||
Section { | ||
Text("Alert with Horizontal Actions") | ||
|
||
Button { | ||
self.canShowAlert1 = true | ||
} label: { | ||
Text("Show alert") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.primaryButton() | ||
} | ||
|
||
Section { | ||
Text("Alert with Verticle Actions") | ||
|
||
Button { | ||
self.canShowAlert2 = true | ||
} label: { | ||
Text("Show alert") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.primaryButton() | ||
|
||
} | ||
} | ||
.frame(maxWidth: .infinity, maxHeight: .infinity) | ||
.background(.red.opacity(0.2)) | ||
.nitrozenSheet(isPresented: $canShowAlert1, postion: .center) { | ||
NitrozenAlert(isPresented: $canShowAlert1, | ||
title: "Great! Your bank account was added successfully", | ||
subtitle: "You KYC verification is pending. Check your mailbox to complete the process.", | ||
topView: AnyView( | ||
Image(systemName: "exclamationmark.circle.fill") | ||
.resizable() | ||
.scaledToFill() | ||
.foregroundColor(.orange) | ||
.frame(width: 40, height: 40) | ||
.padding(.top, 20) | ||
.padding(.bottom, 12) | ||
), | ||
closeView: .nitrozen, | ||
actions: { | ||
|
||
HStack(spacing: 16) { | ||
Button { | ||
print("tap on button 1") | ||
self.canShowAlert1 = false | ||
} label: { | ||
Text("B1") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.borderedButton() | ||
|
||
Button { | ||
print("tap on button 2") | ||
self.canShowAlert1 = false | ||
} label: { | ||
Text("B2") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.primaryButton() | ||
} | ||
.padding(.horizontal, 8) | ||
.padding(.bottom, 48) | ||
|
||
}) | ||
} | ||
.nitrozenSheet(isPresented: $canShowAlert2, postion: .center) { | ||
NitrozenAlert(isPresented: $canShowAlert2, | ||
title: "Great! Your bank account was added successfully", | ||
subtitle: "You KYC verification is pending. Check your mailbox to complete the process.", | ||
topView: AnyView( | ||
Image(systemName: "checkmark.circle.fill") | ||
.resizable() | ||
.scaledToFill() | ||
.foregroundColor(.green) | ||
.frame(width: 40, height: 40) | ||
.padding(.top, 20) | ||
.padding(.bottom, 12) | ||
), | ||
closeView: .nitrozen, | ||
actions: { | ||
|
||
VStack(spacing: 16) { | ||
Button { | ||
print("tap on button 1") | ||
self.canShowAlert2 = false | ||
} label: { | ||
Text("B1") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.borderedButton() | ||
|
||
Button { | ||
print("tap on button 2") | ||
self.canShowAlert2 = false | ||
} label: { | ||
Text("B2") | ||
.frame(maxWidth: .infinity) | ||
} | ||
.primaryButton() | ||
} | ||
.padding(.horizontal, 8) | ||
.padding(.bottom, 48) | ||
|
||
}) | ||
} | ||
} | ||
} | ||
|
||
|
||
``` |
91 changes: 91 additions & 0 deletions
91
...-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview Content/ReadmeDividerView.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
## Divider - Preview | ||
|
||
| Preview1 | | ||
| --- | | ||
| <img src="https://raw.githubusercontent.com/keyur-gofynd/nitrozen-ios/master/Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview%20Content/divider1.png" width="300"> | | ||
|
||
|
||
## Divider code snippets | ||
Divider with example | ||
```swift | ||
struct DeviderViews: View { | ||
|
||
var body: some View { | ||
List{ | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style") | ||
NitrozenDivider() | ||
} | ||
} | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style with horizontal layout\n- custom height, custom color") | ||
NitrozenDivider( | ||
appearance: NitrozenAppearance.shared | ||
.divider.copy | ||
.layout(.horizontal(height: 20)) | ||
.color(NitrozenAppearance.shared.colorProvider.warning50) | ||
.shape(.capsule) | ||
) | ||
} | ||
} | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style with horizontal layout\n- custom height, custom color, custom shape") | ||
NitrozenDivider( | ||
appearance: NitrozenAppearance.shared | ||
.divider.copy | ||
.layout(.horizontal(height: 20)) | ||
.color(NitrozenAppearance.shared.colorProvider.success50) | ||
.shape(.roundedRectangle(radius: 5)) | ||
) | ||
} | ||
} | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style with verticle layout") | ||
NitrozenDivider( | ||
appearance: NitrozenAppearance.shared | ||
.divider.copy | ||
.layout(.verticle(width: 1)) | ||
) | ||
} | ||
} | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style with verticle layout\n- custom width, custom color") | ||
NitrozenDivider( | ||
appearance: NitrozenAppearance.shared | ||
.divider.copy | ||
.layout(.verticle(width: 20)) | ||
.color(NitrozenAppearance.shared.colorProvider.warning50) | ||
.shape(.capsule) | ||
) | ||
} | ||
} | ||
|
||
Section { | ||
VStack { | ||
Text("Default Nitrozen style with verticle layout\n- custom width, custom color, custom shape") | ||
NitrozenDivider( | ||
appearance: NitrozenAppearance.shared | ||
.divider.copy | ||
.layout(.verticle(width: 20)) | ||
.color(NitrozenAppearance.shared.colorProvider.success50) | ||
.shape(.roundedRectangle(radius: 5)) | ||
) | ||
} | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
|
||
``` |
94 changes: 94 additions & 0 deletions
94
Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview Content/ReadmeOTPView.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
## OTPView - Preview | ||
|
||
| Preview1 | | ||
| --- | | ||
| <img src="https://raw.githubusercontent.com/keyur-gofynd/nitrozen-ios/master/Example-Nitrozen-SwiftUI/Example-Nitrozen-SwiftUI/Preview%20Content/otpview1.png" width="300"> | | ||
|
||
## OTPView code snippets | ||
OTPView with example | ||
```swift | ||
struct OtpView: View { | ||
@State var otpcode6:String = "" | ||
@State var otpcode7:String = "" | ||
@State var otpcode4:String = "" | ||
@State var otpcode5:String = "" | ||
@State var otpcode3:String = "" | ||
@State var otpcode10:String = "" | ||
|
||
var body: some View { | ||
|
||
VStack(spacing: 40) { | ||
|
||
VStack { | ||
Text("Nitrozen OTPField") | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode6, | ||
otpCodeLength: 6, | ||
placeHolder: "0", | ||
validationState: .error | ||
) | ||
} | ||
|
||
VStack { | ||
Text("Nitrozen OTPField") | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode7, | ||
otpCodeLength: 6, | ||
placeHolder: "0", | ||
validationState: .success, | ||
spacing: 4 | ||
) | ||
} | ||
|
||
VStack { | ||
Text("SecureField OTPField with custom border color") | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode4, | ||
otpCodeLength: 4, | ||
placeHolder: "0", | ||
isSecureField: true, | ||
isAutoFirstResponder: true, | ||
appearance: NitrozenAppearance.shared.otpTextView.copy | ||
.borderColor(.green) | ||
.fillBorderColor(.blue) | ||
.size(CGSize.init(width: 60, height: 40)) | ||
.borderRadius(0) | ||
|
||
) | ||
} | ||
|
||
VStack { | ||
Text("Custom Height OTPField") | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode5, | ||
otpCodeLength: 5, | ||
placeHolder: "0", | ||
appearance: NitrozenAppearance.shared.otpTextView.copy | ||
.size(CGSize.init(width: 60, height: 60)) | ||
) | ||
} | ||
|
||
VStack { | ||
Text("Custom PlaceHolder") | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode3, | ||
otpCodeLength: 3, | ||
placeHolder: "\u{272A}", | ||
isAutoFirstResponder: false | ||
) | ||
} | ||
|
||
VStack { | ||
NitrozenOtpTextView( | ||
otpCode: $otpcode10, | ||
otpCodeLength: 10, | ||
placeHolder: "0", | ||
appearance: NitrozenAppearance.shared.otpTextView.copy | ||
.size(CGSize.init(width: 20, height: 20)) | ||
) | ||
} | ||
} | ||
Spacer() | ||
} | ||
} | ||
``` |
Oops, something went wrong.