Skip to content

Commit

Permalink
Merge pull request #43 from keyur-gofynd/master
Browse files Browse the repository at this point in the history
Add readme files for version 1.1.0
  • Loading branch information
hitendra-gofynd authored Apr 28, 2023
2 parents 5b1a4d1 + a316ae4 commit 1195dde
Show file tree
Hide file tree
Showing 17 changed files with 695 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct UIElementsList: View {
NavigationLink {
DeviderViews()
} label: {
Text("Deviders")
Text("Dividers")
}

NavigationLink {
Expand Down
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)

})

})

}

}

```
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)

})
}
}
}


```
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))
)
}
}

}
}
}


```
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()
}
}
```
Loading

0 comments on commit 1195dde

Please sign in to comment.