Skip to content

Commit abb79e1

Browse files
fix: format code (#63)
1 parent 77c4d0f commit abb79e1

File tree

92 files changed

+1541
-1520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1541
-1520
lines changed

GoMoney.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,8 +967,8 @@
967967
08C8729B28F655CD00DC859D /* Sources */,
968968
08C8729C28F655CD00DC859D /* Frameworks */,
969969
08C8729D28F655CD00DC859D /* Resources */,
970-
8291F096518328B4CB2334CA /* [CP] Embed Pods Frameworks */,
971970
08EEA005291CC29F003B35B8 /* Embed Foundation Extensions */,
971+
C7F73096535B070AD90AE7EF /* [CP] Embed Pods Frameworks */,
972972
);
973973
buildRules = (
974974
);
@@ -1085,7 +1085,7 @@
10851085
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
10861086
showEnvVarsInLog = 0;
10871087
};
1088-
8291F096518328B4CB2334CA /* [CP] Embed Pods Frameworks */ = {
1088+
C7F73096535B070AD90AE7EF /* [CP] Embed Pods Frameworks */ = {
10891089
isa = PBXShellScriptBuildPhase;
10901090
buildActionMask = 2147483647;
10911091
files = (
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
1-
//
2-
// AppDelegate.swift
3-
// GoMoney
4-
//
5-
// Created by Golden Owl on 12/10/2022.
6-
//
7-
81
import FirebaseCore
92
import GoogleSignIn
103
import UIKit
114

125
@main
136
class AppDelegate: UIResponder, UIApplicationDelegate {
14-
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
7+
func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
158
return GIDSignIn.sharedInstance.handle(url)
169
}
1710

18-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
11+
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1912
// Override point for customization after application launch.
20-
13+
2114
FirebaseApp.configure()
22-
15+
2316
return true
2417
}
2518

2619
// MARK: UISceneSession Lifecycle
2720

28-
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
21+
func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
2922
// Called when a new scene session is being created.
3023
// Use this method to select a configuration to create the new scene with.
3124
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
3225
}
3326

34-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
27+
func application(_: UIApplication, didDiscardSceneSessions _: Set<UISceneSession>) {
3528
// Called when the user discards a scene session.
3629
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
3730
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
3831
}
3932
}
40-

GoMoney/AppDelegate/SceneDelegate.swift

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
//
2-
// SceneDelegate.swift
3-
// GoMoney
4-
//
5-
// Created by Golden Owl on 12/10/2022.
6-
//
7-
81
import UIKit
92

103
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
114
var window: UIWindow?
125

136
let settingManager = SettingsManager.shared
147

15-
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
8+
func scene(_ scene: UIScene, willConnectTo _: UISceneSession, options _: UIScene.ConnectionOptions) {
169
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
1710
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
1811
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
@@ -44,29 +37,29 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
4437
window?.makeKeyAndVisible()
4538
}
4639

47-
func sceneDidDisconnect(_ scene: UIScene) {
40+
func sceneDidDisconnect(_: UIScene) {
4841
// Called as the scene is being released by the system.
4942
// This occurs shortly after the scene enters the background, or when its session is discarded.
5043
// Release any resources associated with this scene that can be re-created the next time the scene connects.
5144
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
5245
}
5346

54-
func sceneDidBecomeActive(_ scene: UIScene) {
47+
func sceneDidBecomeActive(_: UIScene) {
5548
// Called when the scene has moved from an inactive state to an active state.
5649
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
5750
}
5851

59-
func sceneWillResignActive(_ scene: UIScene) {
52+
func sceneWillResignActive(_: UIScene) {
6053
// Called when the scene will move from an active state to an inactive state.
6154
// This may occur due to temporary interruptions (ex. an incoming phone call).
6255
}
6356

64-
func sceneWillEnterForeground(_ scene: UIScene) {
57+
func sceneWillEnterForeground(_: UIScene) {
6558
// Called as the scene transitions from the background to the foreground.
6659
// Use this method to undo the changes made on entering the background.
6760
}
6861

69-
func sceneDidEnterBackground(_ scene: UIScene) {
62+
func sceneDidEnterBackground(_: UIScene) {
7063
// Called as the scene transitions from the foreground to the background.
7164
// Use this method to save data, release shared resources, and store enough scene-specific state information
7265
// to restore the scene back to its current state.

GoMoney/Base/GMMainViewController.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// GMViewController.swift
3-
// GoMoney
4-
//
5-
// Created by Golden Owl on 12/10/2022.
6-
//
7-
81
import Reachability
92
import UIKit
103

@@ -55,17 +48,20 @@ class GMMainViewController: GMViewController {
5548
image: leftBarImage,
5649
style: .done,
5750
target: self,
58-
action: nil)
51+
action: nil
52+
)
5953

6054
let leftBarTitle = UIBarButtonItem(
6155
title: leftTitle,
6256
style: .plain,
6357
target: self,
64-
action: nil)
58+
action: nil
59+
)
6560

6661
leftBarTitle.setTitleTextAttributes(
6762
[.foregroundColor: UIColor.white, .font: K.Theme.titleFont],
68-
for: .disabled)
63+
for: .disabled
64+
)
6965

7066
leftBarIcon.isEnabled = false
7167
leftBarTitle.isEnabled = false
@@ -77,7 +73,8 @@ class GMMainViewController: GMViewController {
7773
image: rightBarImage,
7874
style: .done,
7975
target: self,
80-
action: nil)
76+
action: nil
77+
)
8178
navigationItem.rightBarButtonItem = rightBarIcon
8279
}
8380

@@ -106,7 +103,8 @@ class GMMainViewController: GMViewController {
106103
if self?.networkAvailable == false {
107104
self?.snackBar(
108105
message: "Connection restored",
109-
actionIcon: UIImage(named: "ic_wifi")?.color(.green))
106+
actionIcon: UIImage(named: "ic_wifi")?.color(.green)
107+
)
110108
self?.networkAvailable = true
111109
}
112110
}
@@ -119,7 +117,8 @@ class GMMainViewController: GMViewController {
119117

120118
self?.snackBar(
121119
message: "Connection lost",
122-
actionIcon: UIImage(named: "ic_wifi_off")?.color(.red))
120+
actionIcon: UIImage(named: "ic_wifi_off")?.color(.red)
121+
)
123122
}
124123
}
125124

GoMoney/Base/GMViewController.swift

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// GMViewController.swift
3-
// GoMoney
4-
//
5-
// Created by Golden Owl on 12/10/2022.
6-
//
7-
81
import UIKit
92

103
class GMViewController: UIViewController {
@@ -70,22 +63,24 @@ class GMViewController: UIViewController {
7063
func setupKeyboard(
7164
onKeyboardWillShow: ((CGFloat, Double) -> Void)?,
7265
onKeyboardWillHide: ((CGFloat, Double) -> Void)?,
73-
hideKeyboarOnTap: Bool = true)
74-
{
66+
hideKeyboarOnTap: Bool = true
67+
) {
7568
self.onKeyboardWillShow = onKeyboardWillShow
7669
self.onKeyboardWillHide = onKeyboardWillHide
7770

7871
NotificationCenter.default.addObserver(
7972
self,
8073
selector: #selector(handleKeyboardWillShow(notification:)),
8174
name: UIResponder.keyboardWillShowNotification,
82-
object: nil)
75+
object: nil
76+
)
8377

8478
NotificationCenter.default.addObserver(
8579
self,
8680
selector: #selector(handleKeyboardWillHide(notification:)),
8781
name: UIResponder.keyboardWillHideNotification,
88-
object: nil)
82+
object: nil
83+
)
8984

9085
if hideKeyboarOnTap {
9186
hideKeyboardOnTap()

GoMoney/Common/AsyncImage/AsyncImageView.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class AsyncImageView: UIView {
4444
imageView.trailingAnchor.constraint(equalTo: trailingAnchor),
4545

4646
activityIndicator.centerXAnchor.constraint(equalTo: centerXAnchor),
47-
activityIndicator.centerYAnchor.constraint(equalTo: centerYAnchor)
47+
activityIndicator.centerYAnchor.constraint(equalTo: centerYAnchor),
4848
])
4949
}
5050

@@ -53,13 +53,13 @@ public class AsyncImageView: UIView {
5353
loader.loadImage(imageURL) { [weak self] result in
5454
DispatchQueue.main.async {
5555
switch result {
56-
case .success(let image):
57-
self?.activityIndicator.stopAnimating()
58-
self?.imageView.image = image
56+
case let .success(image):
57+
self?.activityIndicator.stopAnimating()
58+
self?.imageView.image = image
5959

60-
case .failure:
61-
self?.activityIndicator.stopAnimating()
62-
self?.imageView.image = defaultImage
60+
case .failure:
61+
self?.activityIndicator.stopAnimating()
62+
self?.imageView.image = defaultImage
6363
}
6464
}
6565
}

GoMoney/Common/Chart/Formatter/DayAxisValueFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class BarChartXAxisFormatter: IndexAxisValueFormatter {
88
self.tagExpenses = tagExpenses
99
}
1010

11-
override func stringForValue(_ value: Double, axis: AxisBase?) -> String {
11+
override func stringForValue(_ value: Double, axis _: AxisBase?) -> String {
1212
guard let
1313
tagExpenses = tagExpenses,
1414
tagExpenses.count > 0,

GoMoney/Common/Chart/Formatter/LineChartXAxisFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class LineChartXAxisFormatter: IndexAxisValueFormatter {
1010
self.dateType = dateType
1111
}
1212

13-
override func stringForValue(_ value: Double, axis: AxisBase?) -> String {
13+
override func stringForValue(_ value: Double, axis _: AxisBase?) -> String {
1414
guard
1515
let dateAmount = dateAmount,
1616
let dateType = dateType,

GoMoney/Common/Currency/MoneyFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class MoneyFormatter {
1+
enum MoneyFormatter {
22
static func formatShorter(amount: Double, currency: CurrencyUnit) -> String {
33
switch currency {
44
case .dong:

GoMoney/Common/InputView/AccessoryView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class AccessoryView: UIView {
9292
}
9393

9494
@available(*, unavailable)
95-
required init?(coder: NSCoder) {
95+
required init?(coder _: NSCoder) {
9696
fatalError("init(coder:) has not been implemented")
9797
}
9898

0 commit comments

Comments
 (0)