Skip to content

Commit

Permalink
Bump to swift 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed Nov 19, 2024
1 parent 293167a commit 7eee67e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// swift-tools-version:5.9
// swift-tools-version:6.0
import PackageDescription

let package = Package(
name: "TwoFa", // Defines the package name as TwoFa
platforms: [
.macOS(.v14), // macOS 14 and later
.iOS(.v17) // iOS 17 and later
.macOS(.v15), // macOS 14 and later
.iOS(.v18) // iOS 17 and later
], // Specifies the platforms supported by the package
products: [
.library(
Expand Down
12 changes: 10 additions & 2 deletions Sources/TwoFa/util/OTPArc/OTPArc+Const.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ extension OTPArc {
internal let lineWidth: CGFloat
/**
* - Note: Needed for public init
* - Parameters:
* - tints: - Fixme: ⚠️️ Add doc
* - iconSize: - Fixme: ⚠️️ Add doc
* - font: - Fixme: ⚠️️ Add doc
* - fontColor: - Fixme: ⚠️️ Add doc
* - bgStrokColor: - Fixme: ⚠️️ Add doc
* - background: - Fixme: ⚠️️ Add doc
* - lineWidth: - Fixme: ⚠️️ Add doc
*/
public init(tints: (idle: Color, start: Color, end: Color), iconSize: CGFloat, font: Font, fontColor: Color, bgStrokColor: Color, background: Color, lineWidth: CGFloat) {
self.tints = tints
Expand All @@ -29,7 +37,7 @@ extension OTPArc {
/**
* Default graph style
*/
public static let defaultGraphStyle: GraphStyle = {
public static var defaultGraphStyle: GraphStyle {
.init(
tints: (.blue, .green, .red),
iconSize: 24,
Expand All @@ -39,6 +47,6 @@ extension OTPArc {
background: .clear,
lineWidth: 3
)
}()
}
}
}
4 changes: 3 additions & 1 deletion Sources/TwoFa/util/OTPArc/OTPArc+Preview.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import SwiftUI

/**
* - Fixme: ⚠️️ Add doc
*/
#Preview {
let url: URL = .init(string: "otpauth://hotp/test?secret=6UAOpz+x3dsNrQ==&algorithm=SHA512&digits=6&counter=1")!
let account: OTPAccount = try! .init(url: url)
Expand Down
4 changes: 3 additions & 1 deletion Sources/TwoFa/util/OTPArc/OTPArc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public struct OTPArc: View {
* `OTPAccount`. If an account is provided, it
* initializes an `OTPTimer` to manage OTP
* generation timing.
* - Parameter account: The data model to generate timer from etc
* - Parameters:
* - account: The data model to generate timer from etc
* - graphStyle: - Fixme: ⚠️️ Add doc
*/
public init(account: OTPAccount?, graphStyle: GraphStyle = .defaultGraphStyle) {
self.account = account
Expand Down
6 changes: 4 additions & 2 deletions Sources/TwoFa/util/OTPTimer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ extension OTPTimer {
* to the console.
* - Note: If you forget to add event handler, this will be called
*/
fileprivate static let defaultOnChange: OTPTimerCallback = { (_: OTPTimer) in
Swift.print("Default onChange")
fileprivate static var defaultOnChange: OTPTimerCallback {
{ (_: OTPTimer) in
Swift.print("Default onChange")
}
}
}

0 comments on commit 7eee67e

Please sign in to comment.