Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Sources/CITPincode/CITPincodeView+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ extension CITPincodeView {

/// The cornerRadius of each pincode cell, used to set rounded corners, e.g. set to 0 for sharp corners, to 8 for small rounding or .infinity for maximum rounding.
public var cellCornerRadius: CGFloat


/// The spacing between pincode cells.
public var cellSpacing: CGFloat

/// The type of pincode, you can choose any UIKeyboardType, but the most common types are ".default" for a text keyboard and .numberPad for a numbers only keyboard.
public var keyboardType: UIKeyboardType

Expand Down Expand Up @@ -145,6 +148,7 @@ extension CITPincodeView {
keyboardDoneButtonText: String = "citpincode_keyboard_done_button_text".localized,
cellSize: CGSize = .init(width: 40, height: 56),
cellCornerRadius: CGFloat = 8,
cellSpacing: CGFloat = 8,
keyboardType: UIKeyboardType = .default,
charactersToFilterOutOnPaste: [String] = ["-"],
divider: CITPincodeDividerConfiguration = .none,
Expand All @@ -166,6 +170,7 @@ extension CITPincodeView {
self.keyboardDoneButtonText = keyboardDoneButtonText
self.cellSize = cellSize
self.cellCornerRadius = cellCornerRadius
self.cellSpacing = cellSpacing
self.keyboardType = keyboardType
self.charactersToFilterOutOnPaste = charactersToFilterOutOnPaste
self.divider = divider
Expand Down
2 changes: 1 addition & 1 deletion Sources/CITPincode/CITPincodeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct CITPincodeView: View {

public var body: some View {
VStack(alignment: config.resendButtonStyle.alignment) {
HStack {
HStack(spacing: config.cellSpacing) {
ForEach(0 ..< config.codeLength, id: \.self) { index in
CITPincodeCellView(
config: config,
Expand Down