Skip to content
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
9 changes: 0 additions & 9 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ opt_in_rules:
included:
- NativeAppTemplate

# Excluded paths
excluded:
- Pods
- Carthage
- DerivedData
- .build

# Configured rules
line_length:
warning: 120
Expand Down Expand Up @@ -62,6 +55,4 @@ identifier_name:
max_length:
warning: 50
excluded:
- by
- id
- db
4 changes: 0 additions & 4 deletions NativeAppTemplate.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
0172046625AA82BF008FD63B /* MessageBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172045925AA82B4008FD63B /* MessageBarView.swift */; };
0172046725AA82BF008FD63B /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172045725AA82B4008FD63B /* MainView.swift */; };
0172046925AA82BF008FD63B /* PermissionsLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172045D25AA82B4008FD63B /* PermissionsLoadingView.swift */; };
0172047925AA8335008FD63B /* UIFont+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172046E25AA8325008FD63B /* UIFont+Extensions.swift */; };
0172047E25AA8343008FD63B /* Font+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172047525AA8325008FD63B /* Font+Extensions.swift */; };
0172048125AA8343008FD63B /* Color+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172047625AA8325008FD63B /* Color+Extensions.swift */; };
017204B625AA8467008FD63B /* DataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0172049225AA8449008FD63B /* DataManager.swift */; };
Expand Down Expand Up @@ -215,7 +214,6 @@
0172045925AA82B4008FD63B /* MessageBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageBarView.swift; sourceTree = "<group>"; };
0172045C25AA82B4008FD63B /* SnackbarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnackbarView.swift; sourceTree = "<group>"; };
0172045D25AA82B4008FD63B /* PermissionsLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionsLoadingView.swift; sourceTree = "<group>"; };
0172046E25AA8325008FD63B /* UIFont+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+Extensions.swift"; sourceTree = "<group>"; };
0172047525AA8325008FD63B /* Font+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Font+Extensions.swift"; sourceTree = "<group>"; };
0172047625AA8325008FD63B /* Color+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extensions.swift"; sourceTree = "<group>"; };
0172049225AA8449008FD63B /* DataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -648,7 +646,6 @@
children = (
0172047625AA8325008FD63B /* Color+Extensions.swift */,
0172047525AA8325008FD63B /* Font+Extensions.swift */,
0172046E25AA8325008FD63B /* UIFont+Extensions.swift */,
);
path = Styleguide;
sourceTree = "<group>";
Expand Down Expand Up @@ -895,7 +892,6 @@
011F6DE9259EF16400BED22E /* Sources */ = {
isa = PBXSourcesBuildPhase;
files = (
0172047925AA8335008FD63B /* UIFont+Extensions.swift in Sources */,
01E2477029A570D300D4B00D /* SignUp.swift in Sources */,
01D85B4A2E07F16900A95798 /* ShopkeeperEditViewModel.swift in Sources */,
0172052F25AC41A7008FD63B /* SessionRequest.swift in Sources */,
Expand Down
3 changes: 0 additions & 3 deletions NativeAppTemplate/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ private final class NullSessionController: SessionControllerProtocol {
var shouldUpdateApp: Bool = false
var shouldUpdatePrivacy: Bool = false
var shouldUpdateTerms: Bool = false
var shopLimitCount: Int = 0
var shopkeeper: Shopkeeper?
var isLoggedIn: Bool {
false
Expand Down Expand Up @@ -105,8 +104,6 @@ struct App {
dataManager = nativeAppTemplateObjects.dataManager
messageBus = nativeAppTemplateObjects.messageBus

// Tips.showAllTipsForTesting()

try? Tips.configure()
}
}
Expand Down
16 changes: 0 additions & 16 deletions NativeAppTemplate/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ enum NativeAppTemplateConstants {
static let xxxxl: CGFloat = 128
}

// MARK: - Animation Durations

enum Animation {
/// 0.15s - Fast animations, micro-interactions
static let fast: Double = 0.15

/// 0.3s - Standard animations, most UI transitions
static let standard: Double = 0.3
}

// MARK: - Glass

enum Glass {
Expand Down Expand Up @@ -147,7 +137,6 @@ enum Strings {
// MARK: Shop View

static let shopName = String(localized: "Shop Name")
static let createShop = String(localized: "Create Shop")
static let addShop = String(localized: "Add Shop")
static let addShopDescription = String(localized: "Add a new shop.")
static let deleteShop = String(localized: "Delete Shop")
Expand Down Expand Up @@ -307,9 +296,7 @@ enum Strings {
// MARK: Other

static let ok = String(localized: "OK")
static let no = String(localized: "No")
static let cancel = String(localized: "Cancel")
static let close = String(localized: "Close")
static let save = String(localized: "Save")
static let edit = String(localized: "Edit")
static let delete = String(localized: "Delete")
Expand All @@ -321,10 +308,7 @@ enum Strings {
static let emailIsInvalid = String(localized: "Email is invalid.")
static let passwordIsRequired = String(localized: "Password is required.")
static let passwordIsInvalid = String(localized: "Password is invalid.")
static let role = String(localized: "Role")
static let complete = String(localized: "Complete")
static let open = String(localized: "Open")
static let instructions = String(localized: "Instructions")
static let forceSignOut = String(localized: "Force Sign Out?")
static let signOut = String(localized: "Sign Out")
static let noConnection = String(localized: "No Connection")
Expand Down
4 changes: 0 additions & 4 deletions NativeAppTemplate/Data/Repositories/ItemTagRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import SwiftUI
self.itemTagsService = itemTagsService
}

var isEmpty: Bool {
itemTags.isEmpty
}

func reloadPage(shopId: String, page: Int) {
if Task.isCancelled {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import SwiftUI
@MainActor protocol ItemTagRepositoryProtocol: AnyObject, Observable, Sendable {
var itemTags: [ItemTag] { get set }
var state: DataState { get set }
var isEmpty: Bool { get }
var paginationMeta: PaginationMeta? { get }
var isLoadingMore: Bool { get }

Expand Down
60 changes: 0 additions & 60 deletions NativeAppTemplate/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@
}
}
},
"Close" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "閉じる"
}
}
}
},
"Complete" : {
"localizations" : {
"ja" : {
Expand Down Expand Up @@ -318,16 +308,6 @@
}
}
},
"Create Shop" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "店舗を作成"
}
}
}
},
"Current Password" : {
"localizations" : {
"ja" : {
Expand Down Expand Up @@ -589,16 +569,6 @@
}
}
},
"Instructions" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "手順"
}
}
}
},
"Item tag created successfully." : {
"localizations" : {
"ja" : {
Expand Down Expand Up @@ -769,16 +739,6 @@
}
}
},
"No" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "いいえ"
}
}
}
},
"No Connection" : {
"localizations" : {
"ja" : {
Expand All @@ -799,16 +759,6 @@
}
}
},
"Open" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "開く"
}
}
}
},
"or" : {
"localizations" : {
"ja" : {
Expand Down Expand Up @@ -989,16 +939,6 @@
}
}
},
"Role" : {
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "権限"
}
}
}
},
"Save" : {
"localizations" : {
"ja" : {
Expand Down
4 changes: 2 additions & 2 deletions NativeAppTemplate/Login/SignUpRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import os
return shopkeeper
}

func update(id: String, signUp: SignUp, networkClient: NativeAppTemplateAPI) async throws -> Shopkeeper {
func update(signUp: SignUp, networkClient: NativeAppTemplateAPI) async throws -> Shopkeeper {
var shopkeeper: Shopkeeper

do {
let signUpsService = SignUpsService(networkClient: networkClient)
shopkeeper = try await signUpsService.updateShopkeeper(id: id, signUp: signUp)
shopkeeper = try await signUpsService.updateShopkeeper(signUp: signUp)
} catch {
Failure
.update(from: Self.self, reason: error.codedDescription)
Expand Down
2 changes: 1 addition & 1 deletion NativeAppTemplate/Login/SignUpRepositoryProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation

@MainActor protocol SignUpRepositoryProtocol: AnyObject, Sendable {
func signUp(signUp: SignUp) async throws -> Shopkeeper
func update(id: String, signUp: SignUp, networkClient: NativeAppTemplateAPI) async throws -> Shopkeeper
func update(signUp: SignUp, networkClient: NativeAppTemplateAPI) async throws -> Shopkeeper
func destroy(networkClient: NativeAppTemplateAPI) async throws
func sendResetPasswordInstruction(sendResetPassword: SendResetPassword) async throws
func sendConfirmationInstruction(sendConfirmation: SendConfirmation) async throws
Expand Down
1 change: 0 additions & 1 deletion NativeAppTemplate/Login/SignUpRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct UpdateShopkeeperRequest: Request {

// MARK: - Parameters

let id: String
let signUp: SignUp

// MARK: - Internal
Expand Down
4 changes: 2 additions & 2 deletions NativeAppTemplate/Login/SignUpService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ extension SignUpsService {
try await makeRequest(request: MakeShopkeeperRequest(signUp: signUp))
}

func updateShopkeeper(id: String, signUp: SignUp) async throws -> UpdateShopkeeperRequest.Response {
let request = UpdateShopkeeperRequest(id: id, signUp: signUp)
func updateShopkeeper(signUp: SignUp) async throws -> UpdateShopkeeperRequest.Response {
let request = UpdateShopkeeperRequest(signUp: signUp)
return try await makeRequest(request: request)
}

Expand Down
20 changes: 0 additions & 20 deletions NativeAppTemplate/Models/Shopkeeper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,3 @@ public extension Shopkeeper {
locale == appLocale ? nil : appLocale
}
}

private extension Shopkeeper {
private init(
shopkeeper: Shopkeeper
) {
id = shopkeeper.id
accountId = shopkeeper.accountId
personalAccountId = shopkeeper.personalAccountId
accountOwnerId = shopkeeper.accountOwnerId
accountName = shopkeeper.accountName
email = shopkeeper.email
name = shopkeeper.name
timeZone = shopkeeper.timeZone
locale = shopkeeper.locale
uid = shopkeeper.uid
token = shopkeeper.token
client = shopkeeper.client
expiry = shopkeeper.expiry
}
}
10 changes: 0 additions & 10 deletions NativeAppTemplate/Networking/JSONAPI/JSONAPIResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public class JSONAPIResource {
return EntityIdentity(id: id, type: entityType)
}

subscript(key: String) -> Any? {
attributes[key]
}

// MARK: - Initializers

convenience init(
Expand Down Expand Up @@ -66,9 +62,3 @@ public class JSONAPIResource {
meta = dict["meta"] as? [String: Any] ?? [:]
}
}

extension JSONAPIResource {
subscript<T>(key: some CustomStringConvertible) -> T? {
self[key.description] as? T
}
}
1 change: 0 additions & 1 deletion NativeAppTemplate/Networking/Requests/ShopsRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct GetShopsRequest: Request {
}

struct GetShopDetailRequest: Request {
/// typealias Response = (shop: Shop, cacheUpdate: DataCacheUpdate)
typealias Response = Shop

// MARK: - Properties
Expand Down
10 changes: 0 additions & 10 deletions NativeAppTemplate/Persistence/KeychainStore/Keychain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ struct Keychain {
}
}

func string(for account: String) throws -> String? {
guard let data = try data(for: account) else { return nil }
guard let string = String(data: data, encoding: .utf8) else { throw Self.error(errSecDecode) }
return string
}

func set(_ data: Data, for account: String) throws {
let attributes: [String: Any] = [
kSecValueData as String: data,
Expand All @@ -61,10 +55,6 @@ struct Keychain {
}
}

func set(_ string: String, for account: String) throws {
try set(Data(string.utf8), for: account)
}

func remove(_ account: String) throws {
let status = SecItemDelete(baseQuery(account: account) as CFDictionary)
guard status == errSecSuccess || status == errSecItemNotFound else { throw Self.error(status) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//

import Foundation
import os

protocol KeychainStore {
associatedtype DataType: NSObject, NSCoding
Expand Down Expand Up @@ -53,7 +52,6 @@ extension KeychainStore {

func store(_ data: DataType) throws {
let archived: Data
appLogger.debug("KeychainStore data: \(data, privacy: .private)")
do {
archived = try NSKeyedArchiver.archivedData(withRootObject: data, requiringSecureCoding: true)
} catch {
Expand Down
1 change: 0 additions & 1 deletion NativeAppTemplate/Sessions/SessionControllerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ protocol SessionControllerProtocol: AnyObject, Observable, Sendable {
var shouldUpdateApp: Bool { get set }
var shouldUpdatePrivacy: Bool { get set }
var shouldUpdateTerms: Bool { get set }
var shopLimitCount: Int { get set }

var shopkeeper: Shopkeeper? { get set }

Expand Down
Loading
Loading