Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SwiftLint Warning for SFSafesymbols #14

Merged
merged 2 commits into from
Jul 13, 2023
Merged
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
17 changes: 17 additions & 0 deletions Simple.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
32E5F92B29C9E17500DB1104 /* institutionalEmailDomains.json in Resources */ = {isa = PBXBuildFile; fileRef = 32E5F92629C9E17400DB1104 /* institutionalEmailDomains.json */; };
32E5F92D29C9E1B700DB1104 /* Constants-Annotation.txt in Resources */ = {isa = PBXBuildFile; fileRef = 32E5F92C29C9E1B700DB1104 /* Constants-Annotation.txt */; };
32E5F92F29CAE0F700DB1104 /* SettingMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32E5F92E29CAE0F700DB1104 /* SettingMessage.swift */; };
48047EC72A605EAA0095F991 /* SFSafeSymbols in Frameworks */ = {isa = PBXBuildFile; productRef = 48047EC62A605EAA0095F991 /* SFSafeSymbols */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -118,6 +119,7 @@
2B2E48E82978760100EDE277 /* FirebaseStorage in Frameworks */,
2B2E48DA2978760100EDE277 /* FirebaseAnalytics in Frameworks */,
2B2E48DC2978760100EDE277 /* FirebaseAuth in Frameworks */,
48047EC72A605EAA0095F991 /* SFSafeSymbols in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -367,6 +369,7 @@
2B2E48E72978760100EDE277 /* FirebaseStorage */,
2B2E48EA29787A1E00EDE277 /* GeoFire */,
2B2E48EC29787A1E00EDE277 /* GeoFireUtils */,
48047EC62A605EAA0095F991 /* SFSafeSymbols */,
);
productName = OpenSafe;
productReference = 2B3E84B6297234BB00A0FDD7 /* Simple.app */;
Expand Down Expand Up @@ -399,6 +402,7 @@
packageReferences = (
2B2E48D82978760100EDE277 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
2B2E48E929787A1E00EDE277 /* XCRemoteSwiftPackageReference "geofire-objc" */,
48047EC52A605EAA0095F991 /* XCRemoteSwiftPackageReference "SFSafeSymbols" */,
);
productRefGroup = 2B3E84B7297234BB00A0FDD7 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -707,6 +711,14 @@
kind = branch;
};
};
48047EC52A605EAA0095F991 /* XCRemoteSwiftPackageReference "SFSafeSymbols" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SFSafeSymbols/SFSafeSymbols";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand Down Expand Up @@ -760,6 +772,11 @@
package = 2B2E48E929787A1E00EDE277 /* XCRemoteSwiftPackageReference "geofire-objc" */;
productName = GeoFireUtils;
};
48047EC62A605EAA0095F991 /* SFSafeSymbols */ = {
isa = XCSwiftPackageProductDependency;
package = 48047EC52A605EAA0095F991 /* XCRemoteSwiftPackageReference "SFSafeSymbols" */;
productName = SFSafeSymbols;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 2B3E84AE297234BB00A0FDD7 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@
"version" : "2.2.0"
}
},
{
"identity" : "sfsafesymbols",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SFSafeSymbols/SFSafeSymbols",
"state" : {
"revision" : "7cca2d60925876b5953a2cf7341cd80fbeac983c",
"version" : "4.1.1"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
Expand Down
13 changes: 5 additions & 8 deletions Simple/Core/Authentication/View/EmailVerificationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct EmailVerificationView: View {
@Environment(\.colorScheme) var colorScheme
Expand All @@ -23,7 +24,6 @@ struct EmailVerificationView: View {
.foregroundColor(Color(.systemBlue))
.padding(.top, 56)


Text("Verification sent")
.font(.title3)
.fontWeight(.semibold)
Expand All @@ -45,7 +45,7 @@ struct EmailVerificationView: View {
HStack {
Text("CONTINUE TO APP")
.fontWeight(.semibold)
Image(systemName: "arrow.right")
Image(systemSymbol: SFSymbol.arrowRight)
}
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(width: 165, height: 70)
Expand All @@ -70,21 +70,19 @@ struct EmailVerificationView: View {
}

Spacer()



Button {
viewModel.signout()
} label: {
HStack(spacing: 4) {
Image(systemName: "arrow.left")
Image(systemSymbol: SFSymbol.arrowLeft)
Text("Return to Login page")
.fontWeight(.semibold)
}
.font(.footnote)
.padding(.bottom, 24)
}



}
.alert(isPresented: $viewModel.showAuthAlert, content: {
Alert(title: Text(viewModel.authError?.title ?? AuthenticationError.unknown.title), message: Text(viewModel.authError?.description ?? AuthenticationError.unknown.description))
Expand All @@ -98,4 +96,3 @@ struct EmailVerificationView_Previews: PreviewProvider {
EmailVerificationView()
}
}

14 changes: 7 additions & 7 deletions Simple/Core/Authentication/View/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct LoginView: View {
@Environment(\.colorScheme) var colorScheme
Expand All @@ -15,10 +16,10 @@ struct LoginView: View {

var body: some View {
NavigationStack {
VStack (spacing: 24) {
VStack(spacing: 24) {

Spacer()

Image(colorScheme == .dark ? "simple-logo-dark" : "simple-logo")
.resizable()
.frame(width: 150, height: 150)
Expand All @@ -31,7 +32,7 @@ struct LoginView: View {
.autocapitalization(.none)
.frame(maxWidth: 500)

VStack (spacing: 10) {
VStack(spacing: 10) {
OSInputField(text: $password,
title: "Password",
placeholder: "Enter your password",
Expand All @@ -52,8 +53,7 @@ struct LoginView: View {
}
.padding(.horizontal)
.padding(.top, 12)



Button {
Task {
try await viewModel.signIn(withEmail: email.trimmingCharacters(in: .whitespacesAndNewlines), password: password)
Expand All @@ -62,7 +62,7 @@ struct LoginView: View {
HStack {
Text("SIGN IN")
.fontWeight(.semibold)
Image(systemName: "arrow.right")
Image(systemSymbol: SFSymbol.arrowRight)
}
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(width: 175, height: 50)
Expand Down
5 changes: 3 additions & 2 deletions Simple/Core/Authentication/View/RegistrationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct iOSCheckboxToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View {
Expand All @@ -14,7 +15,7 @@ struct iOSCheckboxToggleStyle: ToggleStyle {
}, label: {
HStack {
configuration.label
Image(systemName: configuration.isOn ? "checkmark.square" : "square")
Image(systemSymbol: configuration.isOn ? SFSymbol.checkmarkSquare : SFSymbol.square)
}
.frame(maxWidth: 500, alignment: .trailing)
})
Expand Down Expand Up @@ -87,7 +88,7 @@ struct RegistrationView: View {
Text("SIGN UP")
.fontWeight(.semibold)

Image(systemName: "arrow.right")
Image(systemSymbol: SFSymbol.arrowRight)
}
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(width: 175, height: 50)
Expand Down
8 changes: 4 additions & 4 deletions Simple/Core/Authentication/View/ResetPasswordView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct ResetPasswordView: View {
@Environment(\.colorScheme) var colorScheme
Expand All @@ -24,8 +25,7 @@ struct ResetPasswordView: View {
.resizable()
.frame(width: 140, height: 140*2500/2429)
.padding(.vertical, 32)



OSInputField(text: $email,
title: "Email Address",
placeholder: "Enter the email for your account")
Expand All @@ -40,7 +40,7 @@ struct ResetPasswordView: View {
HStack {
Text("SEND RESET LINK")
.fontWeight(.semibold)
Image(systemName: "arrow.right")
Image(systemSymbol: SFSymbol.arrowRight)
}
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(width: 200, height: 50)
Expand All @@ -57,7 +57,7 @@ struct ResetPasswordView: View {
dismiss()
} label: {
HStack {
Image(systemName: "arrow.left")
Image(systemSymbol: SFSymbol.arrowLeft)

Text("Back to Login")
.fontWeight(.semibold)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct SendEmailVerificationView: View {
@Environment(\.colorScheme) var colorScheme
Expand Down Expand Up @@ -43,7 +44,7 @@ struct SendEmailVerificationView: View {
HStack {
Text("SEND EMAIL")
.fontWeight(.semibold)
Image(systemName: "arrow.right")
Image(systemSymbol: SFSymbol.arrowRight)
}
.foregroundColor(colorScheme == .dark ? .black : .white)
.frame(width: 160, height: 50)
Expand All @@ -58,7 +59,7 @@ struct SendEmailVerificationView: View {
viewModel.signout()
} label: {
HStack(spacing: 4) {
Image(systemName: "arrow.left")
Image(systemSymbol: SFSymbol.arrowLeft)
Text("Return to Login page")
.fontWeight(.semibold)
}
Expand Down
3 changes: 1 addition & 2 deletions Simple/Core/Home/ViewModel/OSMapViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ class OSMapViewModel: ObservableObject {
listeners.append(listener)
}
}



@MainActor
func refreshReports() {
self.userRegion = nil
Expand Down
11 changes: 6 additions & 5 deletions Simple/Core/Reports/Views/CreateReportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct CreateReportView: View {
@State private var selectedReportType = OSReportType.medicalEmergency.rawValue
Expand Down Expand Up @@ -55,7 +56,7 @@ struct CreateReportView: View {
Section {
VStack(alignment: .leading) {
HStack {
Image(systemName: "location.square.fill")
Image(systemSymbol: SFSymbol.locationSquareFill)
.imageScale(.medium)
.font(.title)
.foregroundColor(Color(userIsPolice ? .systemRed : .systemBlue))
Expand Down Expand Up @@ -114,7 +115,7 @@ struct CreateReportView: View {
Button(action: {
self.policeShowInfo.toggle()
}) {
Image(systemName: "info.circle")
Image(systemSymbol: SFSymbol.infoCircle)
.foregroundColor(Color(.systemRed))
}
}
Expand All @@ -134,7 +135,7 @@ struct CreateReportView: View {
Button(action: {
self.onlyPolicesCanSeeReportShowInfo.toggle()
}) {
Image(systemName: "info.circle")
Image(systemSymbol: SFSymbol.infoCircle)
.foregroundColor(Color(.systemRed))
}
}
Expand All @@ -154,7 +155,7 @@ struct CreateReportView: View {
Button(action: {
self.showInfo.toggle()
}) {
Image(systemName: "info.circle")
Image(systemSymbol: SFSymbol.infoCircle)
}
}
}
Expand Down Expand Up @@ -240,7 +241,7 @@ struct CheckmarkToggleStyle: ToggleStyle {
.foregroundColor(.white)
.padding(.all, 3)
.overlay(
Image(systemName: configuration.isOn ? "exclamationmark" : "checkmark")
Image(systemSymbol: configuration.isOn ? SFSymbol.exclamationmark : SFSymbol.checkmark)
.resizable()
.aspectRatio(contentMode: .fit)
.font(Font.title.weight(.black))
Expand Down
3 changes: 2 additions & 1 deletion Simple/Core/Reports/Views/LocationSearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import SwiftUI
import SFSafeSymbols

struct LocationSearchView: View {
@ObservedObject var viewModel: OSReportViewModel
Expand All @@ -28,7 +29,7 @@ struct LocationSearchView: View {
List {
ForEach(viewModel.results, id: \.self) { result in
HStack {
Image(systemName: "mappin.circle.fill")
Image(systemSymbol: SFSymbol.mappinCircleFill)
.resizable()
.foregroundColor(Color(userIsPolice ? .systemRed : .systemBlue))
.accentColor(.white)
Expand Down
2 changes: 1 addition & 1 deletion Simple/Core/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct SettingsView: View {
if let user = viewModel.currentUser {
let userIsPolice = (user.fullname).contains("👮‍♂️")

HStack (spacing: 15) {
HStack(spacing: 15) {
Text(userIsPolice ? "Police" : user.initials)
.font(userIsPolice ? .title2 : .title)
.fontWeight(.semibold)
Expand Down
3 changes: 1 addition & 2 deletions Simple/Utils/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,5 @@ let MOCK_REPORTS: [OSReport] = [
geohash: "9q9hrh5sdd",
locationString: "1 Hacker Way, Cupertino CA",
status: .unconfirmed
),
)
]