From b27cd37a39f7dbaf7991587b0bef87810a848d43 Mon Sep 17 00:00:00 2001 From: Lucas DELANIER Date: Thu, 6 Jun 2024 10:19:40 +0200 Subject: [PATCH] feature/user-picture (#31) Co-authored-by: ludelanier Reviewed-on: https://codefirst.iut.uca.fr/git/AllDev/Apple/pulls/31 --- Sources/AllInApp/AllIn/AllIn.entitlements | 4 +- .../AllInApp/AllIn/Components/BetCard.swift | 2 +- .../AllIn/Components/DropDownFriends.swift | 2 +- .../AllInApp/AllIn/Components/Friend.swift | 5 +- Sources/AllInApp/AllIn/Components/Menu.swift | 6 +-- .../AllIn/Components/ParticipationCell.swift | 35 ------------ .../AllIn/Components/RankingRow.swift | 19 +------ .../AllInApp/AllIn/Components/UserInfo.swift | 31 +++++------ .../AllIn/Components/UsersPreview.swift | 23 ++++---- .../AllIn/Components/userPicture.swift | 53 +++++++++++++++++++ .../AllInApp/AllIn/Views/DetailsView.swift | 5 +- .../AllInApp/AllIn/Views/RankingView.swift | 13 +---- .../AllInApp.xcodeproj/project.pbxproj | 16 +++--- .../AllInWidgetsExtension.entitlements | 4 +- .../project.pbxproj | 6 +++ Sources/Model/Sources/Model/User.swift | 5 +- 16 files changed, 109 insertions(+), 120 deletions(-) delete mode 100644 Sources/AllInApp/AllIn/Components/ParticipationCell.swift create mode 100644 Sources/AllInApp/AllIn/Components/userPicture.swift diff --git a/Sources/AllInApp/AllIn/AllIn.entitlements b/Sources/AllInApp/AllIn/AllIn.entitlements index 0f06eb8..2eb7e33 100644 --- a/Sources/AllInApp/AllIn/AllIn.entitlements +++ b/Sources/AllInApp/AllIn/AllIn.entitlements @@ -3,8 +3,6 @@ com.apple.security.application-groups - - group.alldev.AllIn - + diff --git a/Sources/AllInApp/AllIn/Components/BetCard.swift b/Sources/AllInApp/AllIn/Components/BetCard.swift index 4db923c..9d2a9e3 100644 --- a/Sources/AllInApp/AllIn/Components/BetCard.swift +++ b/Sources/AllInApp/AllIn/Components/BetCard.swift @@ -44,7 +44,7 @@ struct BetCard: View { VStack(alignment: .leading,spacing: 2){ HStack{ Spacer() - UsersPreview() + UsersPreview(users: bet.registered) Text("bet_players_waiting_format \(bet.registered.count.description)") .font(.system(size: 15)) .foregroundColor(AllInColors.grey800Color) diff --git a/Sources/AllInApp/AllIn/Components/DropDownFriends.swift b/Sources/AllInApp/AllIn/Components/DropDownFriends.swift index 96ce832..f9b3382 100644 --- a/Sources/AllInApp/AllIn/Components/DropDownFriends.swift +++ b/Sources/AllInApp/AllIn/Components/DropDownFriends.swift @@ -52,7 +52,7 @@ struct DropDownFriends: View { ) .frame(width: 15, height: 15) .padding(.trailing, 5) - UserInfo() + UserInfo(username: "", value: 0) .contentShape(Rectangle()) } .padding([.leading, .trailing], 15) diff --git a/Sources/AllInApp/AllIn/Components/Friend.swift b/Sources/AllInApp/AllIn/Components/Friend.swift index 56ddec6..42ad66a 100644 --- a/Sources/AllInApp/AllIn/Components/Friend.swift +++ b/Sources/AllInApp/AllIn/Components/Friend.swift @@ -29,10 +29,7 @@ struct Friend: View { var body: some View { HStack{ - AsyncImage(url: URL(string: user.image ?? "")) - .frame(width: 50, height: 50) - .cornerRadius(180) - .scaledToFit() + UserPicture(picture: nil,username: user.username, size: 45) Text(user.username) .fontWeight(.medium) .padding(.leading, 5) diff --git a/Sources/AllInApp/AllIn/Components/Menu.swift b/Sources/AllInApp/AllIn/Components/Menu.swift index a3ad403..e56d245 100644 --- a/Sources/AllInApp/AllIn/Components/Menu.swift +++ b/Sources/AllInApp/AllIn/Components/Menu.swift @@ -11,6 +11,7 @@ import DependencyInjection struct Menu: View { @Inject var authService: IAuthService + let parameters: [(String, String, String, String)] = [ ("videoGameImage", String(localized: "drawer_create_a_bet"), String(localized: "drawer_create_a_bet_subtitle"), "CreationBet"), @@ -27,10 +28,7 @@ struct Menu: View { HStack() { Spacer() VStack(){ - AsyncImage(url: URL(string: AppStateContainer.shared.user?.image ?? "")) - .scaledToFit() - .frame(width: 100, height: 100) - .cornerRadius(180) + UserPicture(username: (AppStateContainer.shared.user?.username)!, size: 100) Text(AppStateContainer.shared.user?.username.capitalized ?? "") .fontWeight(.medium) .font(.system(size: 17)) diff --git a/Sources/AllInApp/AllIn/Components/ParticipationCell.swift b/Sources/AllInApp/AllIn/Components/ParticipationCell.swift deleted file mode 100644 index f902425..0000000 --- a/Sources/AllInApp/AllIn/Components/ParticipationCell.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ParticipationCell.swift -// AllIn -// -// Created by Lucas Delanier on 21/01/2024. -// - -import SwiftUI -import Model - -struct ParticipationCell: View { - var participation: Participation - var body: some View { - HStack(alignment: .center, spacing: 0){ - Circle() - .frame(width: 30, height: 30) - .foregroundColor(AllInColors.grey700Color) - .padding(.trailing, 7) - Text(participation.username) - .font(.system(size: 15)) - .foregroundStyle(AllInColors.primaryTextColor) - .fontWeight(.semibold) - Spacer() - Text(participation.stake.description) - .font(.system(size: 18)) - .foregroundStyle(AllInColors.lightPurpleColor) - .fontWeight(.bold) - .padding(.trailing, 8) - Image("PurpleAllCoin") - .resizable() - .frame(width: 11, height: 12) - } - } -} - diff --git a/Sources/AllInApp/AllIn/Components/RankingRow.swift b/Sources/AllInApp/AllIn/Components/RankingRow.swift index 688e76a..40e3e68 100644 --- a/Sources/AllInApp/AllIn/Components/RankingRow.swift +++ b/Sources/AllInApp/AllIn/Components/RankingRow.swift @@ -19,24 +19,7 @@ struct RankingRow: View { Text(number.description) .textStyle(weight: .bold, color: AllInColors.lightPurpleColor, size: 18) .padding(.leading, 15) - - Image(image) - .resizable() - .scaledToFit() - .frame(width: 40, height: 40) - .cornerRadius(180) - .padding([.bottom,.top], 10) - Text(pseudo) - .fontWeight(.medium) - .font(.system(size: 16)) - .lineLimit(1) - Spacer() - Image("allcoinIcon") - .resizable() - .frame(width: 17, height: 17, alignment: .leading) - Text(allCoins.description) - .textStyle(weight: .black, color: AllInColors.lightPurpleColor, size: 16) - .padding(.trailing, 15) + UserInfo(username: pseudo, value: allCoins) } .background(AllInColors.componentBackgroundColor) .cornerRadius(8) diff --git a/Sources/AllInApp/AllIn/Components/UserInfo.swift b/Sources/AllInApp/AllIn/Components/UserInfo.swift index f0b17ef..56b2411 100644 --- a/Sources/AllInApp/AllIn/Components/UserInfo.swift +++ b/Sources/AllInApp/AllIn/Components/UserInfo.swift @@ -6,27 +6,28 @@ // import SwiftUI +import Model struct UserInfo: View { + var username: String + var value: Int var body: some View { HStack { - Image("defaultUserImage") - .resizable() - .frame(width: 35, height: 35) - Text("David") - .textStyle(weight: .bold, color: AllInColors.primaryTextColor, size: 13) + UserPicture(username: username, size: 35) + .padding(.trailing, 7) + Text(username) + .font(.system(size: 15)) + .foregroundStyle(AllInColors.primaryTextColor) + .fontWeight(.semibold) Spacer() - Image("allcoinIcon") + Text(value.description) + .font(.system(size: 18)) + .foregroundStyle(AllInColors.lightPurpleColor) + .fontWeight(.bold) + .padding(.trailing, 8) + Image("PurpleAllCoin") .resizable() - .frame(width: 17, height: 17, alignment: .leading) - Text("541") - .textStyle(weight: .black, color: AllInColors.lightPurpleColor, size: 16) + .frame(width: 11, height: 12) } } } - -struct UserInfo_Previews: PreviewProvider { - static var previews: some View { - UserInfo() - } -} diff --git a/Sources/AllInApp/AllIn/Components/UsersPreview.swift b/Sources/AllInApp/AllIn/Components/UsersPreview.swift index e8fed87..bf58d31 100644 --- a/Sources/AllInApp/AllIn/Components/UsersPreview.swift +++ b/Sources/AllInApp/AllIn/Components/UsersPreview.swift @@ -6,22 +6,19 @@ // import SwiftUI +import Model struct UsersPreview: View { + var users: [User]? var body: some View { - HStack(spacing: -20){ - Image("defaultUserImage") - .resizable() - .frame(width: 35, height: 35) - Image("defaultUserImage") - .resizable() - .frame(width: 35, height: 35) - Image("defaultUserImage") - .resizable() - .frame(width: 35, height: 35) - Image("defaultUserImage") - .resizable() - .frame(width: 35, height: 35) + if users != nil { + HStack(spacing: -20){ + ForEach(users!.prefix(4)) { user in + Image("defaultUserImage") + .resizable() + .frame(width: 35, height: 35) + } + } } } } diff --git a/Sources/AllInApp/AllIn/Components/userPicture.swift b/Sources/AllInApp/AllIn/Components/userPicture.swift new file mode 100644 index 0000000..0fc7e81 --- /dev/null +++ b/Sources/AllInApp/AllIn/Components/userPicture.swift @@ -0,0 +1,53 @@ +// +// userPicture.swift +// AllIn +// +// Created by Lucas Delanier on 04/06/2024. +// + +import SwiftUI + +struct UserPicture: View { + var picture: URL? + var username: String + var size: CGFloat + var body: some View { + ZStack { + if picture != nil { + AsyncImage( + url: picture, + content: { image in + image + .resizable() + .aspectRatio(contentMode: .fit) + .clipShape(Circle()) + }, + placeholder: { + ProgressView() + } + ) + } else { + Circle() + .foregroundColor(.gray) + .frame(width: size, height: size) + .overlay( + Text(username.prefix(2).uppercased()) + .fontWeight(.medium) + .foregroundStyle(.white) + .font(.system(size: fontSize(for: size))) + ) + } + } + } + + func fontSize(for diameter: CGFloat) -> CGFloat { + let fontScaleFactor: CGFloat = 0.45 + return diameter * fontScaleFactor + } +} + +struct UserPicture_Previews: PreviewProvider { + static var previews: some View { + UserPicture(picture: nil, username: "Lucas", size: 100) + } +} diff --git a/Sources/AllInApp/AllIn/Views/DetailsView.swift b/Sources/AllInApp/AllIn/Views/DetailsView.swift index aabc20f..82ee7ea 100644 --- a/Sources/AllInApp/AllIn/Views/DetailsView.swift +++ b/Sources/AllInApp/AllIn/Views/DetailsView.swift @@ -121,9 +121,8 @@ struct DetailsView: View { .fontWeight(.bold) .padding(.bottom, 10) ScrollView(showsIndicators: false) { - ForEach(viewModel.betDetail?.participations ?? [], id: \.self) { participation in - ParticipationCell(participation: participation) - .padding(.horizontal, 10) + ForEach(viewModel.betDetail?.participations ?? []) { participation in + UserInfo(username: participation.username, value: participation.stake).padding(.horizontal, 10) } } .padding(.bottom, geometry.safeAreaInsets.bottom + 28) diff --git a/Sources/AllInApp/AllIn/Views/RankingView.swift b/Sources/AllInApp/AllIn/Views/RankingView.swift index b9e98d7..85bb797 100644 --- a/Sources/AllInApp/AllIn/Views/RankingView.swift +++ b/Sources/AllInApp/AllIn/Views/RankingView.swift @@ -51,12 +51,7 @@ struct RankingView: View { .cornerRadius(41.5, corners: .topLeft) .cornerRadius(8, corners: .topRight) .cornerRadius(15, corners: [.bottomLeft, .bottomRight]) - - Image("defaultUserImage") - .resizable() - .frame(width: 70, height: 70) - .scaledToFit() - .cornerRadius(180) + UserPicture(picture: nil, username: viewModel.friends[0].username, size: 70) .offset(x: 0, y: -55) Text("1") @@ -100,11 +95,7 @@ struct RankingView: View { .cornerRadius(8, corners: .topLeft) .cornerRadius(15, corners: [.bottomLeft, .bottomRight]) - Image("defaultUserImage") - .resizable() - .frame(width: 50, height: 50) - .scaledToFit() - .cornerRadius(180) + UserPicture(picture: nil, username: viewModel.friends[1].username, size: 50) .offset(x: 0, y: -50) Text("2") diff --git a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj index f9b6afe..37e36fc 100644 --- a/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj +++ b/Sources/AllInApp/AllInApp.xcodeproj/project.pbxproj @@ -14,12 +14,12 @@ 123590B42B51792000F7AEBD /* DetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123590B32B51792000F7AEBD /* DetailsView.swift */; }; 123590B62B5537E200F7AEBD /* ResultBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123590B52B5537E200F7AEBD /* ResultBanner.swift */; }; 123590B82B5541BA00F7AEBD /* ParticipateButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123590B72B5541BA00F7AEBD /* ParticipateButton.swift */; }; + 123F31DB2C0F26E8009B6D65 /* userPicture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 123F31DA2C0F26E8009B6D65 /* userPicture.swift */; }; 1244EF602B4EC31E00374ABF /* HistoricBetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */; }; 1244EF622B4EC67000374ABF /* ReviewCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1244EF612B4EC67000374ABF /* ReviewCard.swift */; }; 129D051D2B6E7FF0003D3E08 /* OddCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 129D051C2B6E7FF0003D3E08 /* OddCapsule.swift */; }; 12A9E4942C07132600AB8677 /* EmptyInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12A9E4932C07132600AB8677 /* EmptyInfo.swift */; }; 12C370482B5A5EE500CD9F0F /* BetLineLoading.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12C370472B5A5EE500CD9F0F /* BetLineLoading.swift */; }; - 12C3704A2B5D5BD000CD9F0F /* ParticipationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12C370492B5D5BD000CD9F0F /* ParticipationCell.swift */; }; EC0193782B25BF16005D81E6 /* AllcoinsCapsule.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0193772B25BF16005D81E6 /* AllcoinsCapsule.swift */; }; EC01937A2B25C12B005D81E6 /* BetCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0193792B25C12B005D81E6 /* BetCard.swift */; }; EC01937C2B25C2A8005D81E6 /* AllcoinsCounter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC01937B2B25C2A8005D81E6 /* AllcoinsCounter.swift */; }; @@ -153,12 +153,12 @@ 123590B32B51792000F7AEBD /* DetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailsView.swift; sourceTree = ""; }; 123590B52B5537E200F7AEBD /* ResultBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultBanner.swift; sourceTree = ""; }; 123590B72B5541BA00F7AEBD /* ParticipateButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParticipateButton.swift; sourceTree = ""; }; + 123F31DA2C0F26E8009B6D65 /* userPicture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = userPicture.swift; sourceTree = ""; }; 1244EF5F2B4EC31E00374ABF /* HistoricBetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoricBetView.swift; sourceTree = ""; }; 1244EF612B4EC67000374ABF /* ReviewCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReviewCard.swift; sourceTree = ""; }; 129D051C2B6E7FF0003D3E08 /* OddCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OddCapsule.swift; sourceTree = ""; }; 12A9E4932C07132600AB8677 /* EmptyInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyInfo.swift; sourceTree = ""; }; 12C370472B5A5EE500CD9F0F /* BetLineLoading.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetLineLoading.swift; sourceTree = ""; }; - 12C370492B5D5BD000CD9F0F /* ParticipationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParticipationCell.swift; sourceTree = ""; }; EC0193772B25BF16005D81E6 /* AllcoinsCapsule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllcoinsCapsule.swift; sourceTree = ""; }; EC0193792B25C12B005D81E6 /* BetCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BetCard.swift; sourceTree = ""; }; EC01937B2B25C2A8005D81E6 /* AllcoinsCounter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllcoinsCounter.swift; sourceTree = ""; }; @@ -429,10 +429,10 @@ 120919172B56D0AE00D0FA29 /* ParticipationModal.swift */, 120919192B56DC6C00D0FA29 /* DropDownAnswerMenu.swift */, 12C370472B5A5EE500CD9F0F /* BetLineLoading.swift */, - 12C370492B5D5BD000CD9F0F /* ParticipationCell.swift */, 123225DA2B67E41400D30BB3 /* ChoiceFinalAnswerCell.swift */, 129D051C2B6E7FF0003D3E08 /* OddCapsule.swift */, 12A9E4932C07132600AB8677 /* EmptyInfo.swift */, + 123F31DA2C0F26E8009B6D65 /* userPicture.swift */, ); path = Components; sourceTree = ""; @@ -669,6 +669,7 @@ EC89F7BD2B250D66003821CE /* LoginView.swift in Sources */, EC650A442B25CDF3003AFCAD /* ParameterMenu.swift in Sources */, 120919182B56D0AE00D0FA29 /* ParticipationModal.swift in Sources */, + 123F31DB2C0F26E8009B6D65 /* userPicture.swift in Sources */, ECB26A132B406A9400FE06B3 /* BetViewModel.swift in Sources */, EC30770F2B24FCB00060E34D /* RegisterView.swift in Sources */, EC650A522B2794DD003AFCAD /* BetView.swift in Sources */, @@ -707,7 +708,6 @@ EC3077072B24CB840060E34D /* SplashView.swift in Sources */, EC01937E2B25C52E005D81E6 /* TopBar.swift in Sources */, ECA9D1CB2B2DA2320076E0EC /* DropDownFriends.swift in Sources */, - 12C3704A2B5D5BD000CD9F0F /* ParticipationCell.swift in Sources */, 123590B82B5541BA00F7AEBD /* ParticipateButton.swift in Sources */, EC01FCC32B56650400BB2390 /* DetailsViewModel.swift in Sources */, ECB26A1B2B40746C00FE06B3 /* FriendsViewModel.swift in Sources */, @@ -916,7 +916,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"AllIn/Preview Content\""; - DEVELOPMENT_TEAM = P39ZK4GA2T; + DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "All In"; @@ -950,7 +950,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"AllIn/Preview Content\""; - DEVELOPMENT_TEAM = P39ZK4GA2T; + DEVELOPMENT_TEAM = 35KQ5BDC64; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "All In"; @@ -1054,7 +1054,7 @@ CODE_SIGN_ENTITLEMENTS = AllInWidgetsExtension.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = P39ZK4GA2T; + DEVELOPMENT_TEAM = 35KQ5BDC64; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AllInWidgets/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AllInWidgets; @@ -1082,7 +1082,7 @@ CODE_SIGN_ENTITLEMENTS = AllInWidgetsExtension.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = P39ZK4GA2T; + DEVELOPMENT_TEAM = 35KQ5BDC64; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = AllInWidgets/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = AllInWidgets; diff --git a/Sources/AllInApp/AllInWidgetsExtension.entitlements b/Sources/AllInApp/AllInWidgetsExtension.entitlements index 0f06eb8..2eb7e33 100644 --- a/Sources/AllInApp/AllInWidgetsExtension.entitlements +++ b/Sources/AllInApp/AllInWidgetsExtension.entitlements @@ -3,8 +3,6 @@ com.apple.security.application-groups - - group.alldev.AllIn - + diff --git a/Sources/DependencyInjection/DependencyInjection.xcodeproj/project.pbxproj b/Sources/DependencyInjection/DependencyInjection.xcodeproj/project.pbxproj index 2c08517..5162e18 100644 --- a/Sources/DependencyInjection/DependencyInjection.xcodeproj/project.pbxproj +++ b/Sources/DependencyInjection/DependencyInjection.xcodeproj/project.pbxproj @@ -339,9 +339,11 @@ ECEE18C82B3C9CF400C95E8A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 35KQ5BDC64; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -376,9 +378,11 @@ ECEE18C92B3C9CF400C95E8A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 35KQ5BDC64; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -416,6 +420,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 35KQ5BDC64; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; MACOSX_DEPLOYMENT_TARGET = 13.3; @@ -436,6 +441,7 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 35KQ5BDC64; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.4; MACOSX_DEPLOYMENT_TARGET = 13.3; diff --git a/Sources/Model/Sources/Model/User.swift b/Sources/Model/Sources/Model/User.swift index a07565e..e3f7833 100644 --- a/Sources/Model/Sources/Model/User.swift +++ b/Sources/Model/Sources/Model/User.swift @@ -8,8 +8,11 @@ import Foundation /// A struct representing a user with details such as username, email, number of coins, and friends. -public struct User: Codable, Hashable { +public struct User: Codable, Hashable, Identifiable { + public var id: String { + return email + } /// The username of the user. public private(set) var username: String