diff --git a/Sources/BitcoinUI/SeedPhraseView.swift b/Sources/BitcoinUI/SeedPhraseView.swift index 5585fa0..12ddf13 100644 --- a/Sources/BitcoinUI/SeedPhraseView.swift +++ b/Sources/BitcoinUI/SeedPhraseView.swift @@ -10,10 +10,20 @@ import SwiftUI public struct SeedPhraseView: View { public var words: [String] public var preferredWordsPerRow: Int + public var usePaging: Bool + public var wordsPerPage: Int + @State private var currentPage = 0 - public init(words: [String], preferredWordsPerRow: Int) { + public init( + words: [String], + preferredWordsPerRow: Int, + usePaging: Bool = false, + wordsPerPage: Int = 6 + ) { self.words = words self.preferredWordsPerRow = preferredWordsPerRow + self.usePaging = usePaging + self.wordsPerPage = wordsPerPage } public var body: some View { @@ -30,78 +40,98 @@ public struct SeedPhraseView: View { } }() - VStack(alignment: .leading, spacing: 8) { - ForEach(0.. [[Element]] { + stride(from: 0, to: count, by: size).map { + Array(self[$0..