Skip to content

Commit

Permalink
Enforce View conformance for ViewProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Sep 12, 2024
1 parent d78dc2b commit e0d2f83
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Fyreplace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@
4DCE062C2C08E65300F69AF1 /* RegularNavigation.swift */,
4D5251F42C10A9F100018CD2 /* DynamicNavigation.swift */,
4D5251EB2C1097A600018CD2 /* Destination.swift */,
4D5251F22C109FAC00018CD2 /* Label+Destination.swift */,
);
path = Navigation;
sourceTree = "<group>";
Expand Down Expand Up @@ -395,6 +394,7 @@
4D9B3B442C36F46F00A8F7AD /* NSTextContentType.swift */,
4D9B3B462C36F50300A8F7AD /* UITextContentType.swift */,
4DE785872C88F392000EC4E5 /* HTTPField.swift */,
4D5251F22C109FAC00018CD2 /* Label+Destination.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion Fyreplace/Views/MainView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

struct MainView: View, MainViewProtocol {
struct MainView: MainViewProtocol {
@State
var showError = false

Expand Down
2 changes: 1 addition & 1 deletion Fyreplace/Views/Screens/AuthenticatingScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct AuthenticatingScreen<Content>: View where Content: View {

init(isRegistering: Bool, content: @escaping () -> Content) {
self.content = content
choice = isRegistering ? .register : .login
self.choice = isRegistering ? .register: .login
}

var body: some View {
Expand Down
2 changes: 1 addition & 1 deletion Fyreplace/Views/Screens/LoginScreen.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

struct LoginScreen: View, LoginScreenProtocol {
struct LoginScreen: LoginScreenProtocol {
let namespace: Namespace.ID

@EnvironmentObject
Expand Down
2 changes: 1 addition & 1 deletion Fyreplace/Views/Screens/RegisterScreen.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

struct RegisterScreen: View, RegisterScreenProtocol {
struct RegisterScreen: RegisterScreenProtocol {
let namespace: Namespace.ID

@EnvironmentObject
Expand Down
5 changes: 1 addition & 4 deletions Fyreplace/Views/Screens/SettingsScreen.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import SwiftUI

struct SettingsScreen: View, SettingsScreenProtocol {
struct SettingsScreen: SettingsScreenProtocol {
@KeychainStorage("connection.token")
var token

@SceneStorage("SettingsScreen.choice")
private var choice = Destination.login

var body: some View {
Button("Settings.Logout", role: .destructive, action: logout)
.controlSize(.large)
Expand Down
3 changes: 2 additions & 1 deletion Fyreplace/Views/ViewProtocol.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import OpenAPIRuntime
import Sentry
import SwiftUI

protocol ViewProtocol {}
protocol ViewProtocol: View {}

protocol LoadingViewProtocol: ViewProtocol {
var isLoading: Bool { get nonmutating set }
Expand Down

0 comments on commit e0d2f83

Please sign in to comment.