Skip to content

Commit

Permalink
Fix swift lint indentation_width
Browse files Browse the repository at this point in the history
  • Loading branch information
levieggertcru committed Jul 15, 2024
1 parent b3e13a9 commit b12ef1c
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 54 deletions.
7 changes: 2 additions & 5 deletions godtools/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

let uiTestsDeepLinkString: String? = ProcessInfo.processInfo.environment[LaunchEnvironmentKey.urlDeeplink.value]

if let uiTestsDeepLinkString = uiTestsDeepLinkString, !uiTestsDeepLinkString.isEmpty,
let url = URL(string: uiTestsDeepLinkString) {

if let uiTestsDeepLinkString = uiTestsDeepLinkString, !uiTestsDeepLinkString.isEmpty, let url = URL(string: uiTestsDeepLinkString) {
_ = appDeepLinkingService.parseDeepLinkAndNotify(incomingDeepLink: .url(incomingUrl: IncomingDeepLinkUrl(url: url)))
}

Expand Down Expand Up @@ -177,8 +175,7 @@ extension AppDelegate {

let successfullyHandledQuickAction: Bool

if let toolDeepLinkUrlString = ToolShortcutLinksView.getToolDeepLinkUrl(shortcutItem: shortcutItem),
let toolDeepLinkUrl = URL(string: toolDeepLinkUrlString) {
if let toolDeepLinkUrlString = ToolShortcutLinksView.getToolDeepLinkUrl(shortcutItem: shortcutItem), let toolDeepLinkUrl = URL(string: toolDeepLinkUrlString) {

let trackActionAnalyticsUseCase: TrackActionAnalyticsUseCase = appDiContainer.domainLayer.getTrackActionAnalyticsUseCase()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ struct ConfirmAppLanguageView: View {
}
.font(FontLibrary.sfProTextRegular.font(size: fontSize))
.foregroundColor(ColorPalette.gtGrey.color)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ struct DownloadableLanguageItemView: View {
private func startProgressAnimationTimer() {

progressAnimationTimer = Timer.scheduledTimer(withTimeInterval: 0.2, repeats: true, block: { timer in
guard let downloadProgress = self.animationDownloadProgress,
let progressTarget = self.downloadProgressTarget
else { return }

guard let downloadProgress = self.animationDownloadProgress, let progressTarget = self.downloadProgressTarget else {

return
}

if downloadProgress < progressTarget {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class FavoritesViewModel: ObservableObject {
data: [
AnalyticsConstants.Keys.source: AnalyticsConstants.Sources.featured,
AnalyticsConstants.Keys.tool: featuredLesson.analyticsToolName
]
]
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ struct ToolDetailsView: View {
VStack(alignment: .center, spacing: 0) {

ToolDetailsTitleHeaderView(viewModel: viewModel)
.padding(EdgeInsets(top: 40, leading: contentInsets.leading, bottom: 0, trailing: contentInsets.trailing))
.padding(EdgeInsets(top: 40, leading: contentInsets.leading, bottom: 0, trailing: contentInsets.trailing))

ToolDetailsPrimaryButtonsView(viewModel: viewModel, primaryButtonWidth: contentWidth)
.padding(EdgeInsets(top: 16, leading: contentInsets.leading, bottom: 0, trailing: contentInsets.trailing))
.padding(EdgeInsets(top: 16, leading: contentInsets.leading, bottom: 0, trailing: contentInsets.trailing))

SegmentControl(selectedIndex: $selectedSegmentIndex, segments: viewModel.segments, segmentTappedClosure: { (index: Int) in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class TractRemoteSharePublisher: NSObject {
if loggingEnabled {
print("\n TractRemoteSharePublisher \(method)")
if let label = label, let labelValue = labelValue {
print(" \(label): \(labelValue)")
print(" \(label): \(labelValue)")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class TractRemoteShareSubscriber: NSObject {
if loggingEnabled {
print("\n TractRemoteShareSubscriber \(method)")
if let label = label, let labelValue = labelValue {
print(" \(label): \(labelValue)")
print(" \(label): \(labelValue)")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GetToolFilterLanguagesRepository: GetToolFilterLanguagesRepositoryInterfac
func getLanguageFilter(from languageId: String?, translatedInAppLanguage: AppLanguageDomainModel) -> LanguageFilterDomainModel? {

guard let languageId = languageId,
let language = languagesRepository.getLanguage(id: languageId)
let language = languagesRepository.getLanguage(id: languageId)
else {
return nil
}
Expand All @@ -64,7 +64,7 @@ extension GetToolFilterLanguagesRepository {
private func getLanguageFilterPublisher(from languageId: String?, translatedInAppLanguage: AppLanguageDomainModel) -> AnyPublisher<LanguageFilterDomainModel?, Never> {

guard let languageId = languageId,
let language = languagesRepository.getLanguage(id: languageId)
let language = languagesRepository.getLanguage(id: languageId)
else {
return Just<LanguageFilterDomainModel?>(nil)
.eraseToAnyPublisher()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class ToolFilterCategorySelectionViewModel: ObservableObject {
@Published var navTitle: String = ""
@Published var categorySearchResults: [CategoryFilterDomainModel] = [CategoryFilterDomainModel]()

init(viewToolFilterCategoriesUseCase: ViewToolFilterCategoriesUseCase, searchToolFilterCategoriesUseCase: SearchToolFilterCategoriesUseCase, getUserToolFiltersUseCase: GetUserToolFiltersUseCase
, storeUserToolFiltersUseCase: StoreUserToolFiltersUseCase, getCurrentAppLanguageUseCase: GetCurrentAppLanguageUseCase, viewSearchBarUseCase: ViewSearchBarUseCase, flowDelegate: FlowDelegate) {
init(viewToolFilterCategoriesUseCase: ViewToolFilterCategoriesUseCase, searchToolFilterCategoriesUseCase: SearchToolFilterCategoriesUseCase, getUserToolFiltersUseCase: GetUserToolFiltersUseCase, storeUserToolFiltersUseCase: StoreUserToolFiltersUseCase, getCurrentAppLanguageUseCase: GetCurrentAppLanguageUseCase, viewSearchBarUseCase: ViewSearchBarUseCase, flowDelegate: FlowDelegate) {

self.viewToolFilterCategoriesUseCase = viewToolFilterCategoriesUseCase
self.searchToolFilterCategoriesUseCase = searchToolFilterCategoriesUseCase
Expand Down
2 changes: 1 addition & 1 deletion godtools/App/Flows/App/AppFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ extension AppFlow {
getCurrentAppLanguageUseCase: appDiContainer.feature.appLanguage.domainLayer.getCurrentAppLanguageUseCase(),
viewSearchBarUseCase: appDiContainer.domainLayer.getViewSearchBarUseCase(),
flowDelegate: self
)
)

let view = ToolFilterCategorySelectionView(viewModel: viewModel)

Expand Down
3 changes: 1 addition & 2 deletions godtools/App/Flows/ToolScreenShare/ToolScreenShareFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ class ToolScreenShareFlow: Flow {

let tractRemoteShareURLBuilder: TractRemoteShareURLBuilder = appDiContainer.feature.toolScreenShare.dataLayer.getTractRemoteShareURLBuilder()

guard let domainModel = shareToolScreenShareSessionDomainModel,
let remoteShareUrl = tractRemoteShareURLBuilder.buildRemoteShareURL(toolId: toolSettingsObserver.toolId, primaryLanguageId: toolSettingsObserver.languages.primaryLanguageId, parallelLanguageId: toolSettingsObserver.languages.parallelLanguageId, selectedLanguageId: toolSettingsObserver.languages.selectedLanguageId, page: toolSettingsObserver.pageNumber, subscriberChannelId: channel.subscriberChannelId) else {
guard let domainModel = shareToolScreenShareSessionDomainModel, let remoteShareUrl = tractRemoteShareURLBuilder.buildRemoteShareURL(toolId: toolSettingsObserver.toolId, primaryLanguageId: toolSettingsObserver.languages.primaryLanguageId, parallelLanguageId: toolSettingsObserver.languages.parallelLanguageId, selectedLanguageId: toolSettingsObserver.languages.selectedLanguageId, page: toolSettingsObserver.pageNumber, subscriberChannelId: channel.subscriberChannelId) else {

let viewModel = AlertMessageViewModel(
title: "Error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,17 @@ class AppsFlyerAnalytics: NSObject {
private func log(method: String, label: String?, labelValue: String?, data: [String: Any]?) {

if loggingEnabled {

print("\nAppsFlyer \(method)")

if let label = label, let labelValue = labelValue {
print(" \(label): \(labelValue)")
print(" \(label): \(labelValue)")
}

if let data = data {
print(" data: \(data)")
}

if let customData = appsFlyer.appsFlyerLib.customData {
print(" customData: \(customData)")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,13 @@ class FirebaseAnalytics {
private func log(method: String, label: String?, labelValue: String?, data: [String: Any]?) {

if loggingEnabled {

print("\nFirebaseAnalytics \(method)")

if let label = label, let labelValue = labelValue {
print(" \(label): \(labelValue)")
print(" \(label): \(labelValue)")
}

if let data = data {
print(" data: \(data)")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ extension MobileContentViewModel {

func getClickableAnalyticsEvents() -> [AnalyticsEvent] {

guard let clickableModel = baseModel as? Clickable, clickableModel.isClickable,
let modelHasAnalyticsEvents = clickableModel as? HasAnalyticsEvents else {
guard let clickableModel = baseModel as? Clickable, clickableModel.isClickable, let modelHasAnalyticsEvents = clickableModel as? HasAnalyticsEvents else {

return Array()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ class MobileContentPagesView: AppViewController {

weakSelf.pageNavigationView.scrollToPage(pageNavigation: navigationEvent.pageNavigation, completion: { (completedNavigation: PageNavigationCollectionViewNavigationCompleted) in

if let pagePositions = navigationEvent.pagePositions,
let pageCell = completedNavigation.pageCell as? MobileContentPageCell,
let pageView = pageCell.mobileContentView as? MobileContentPageView {
if let pagePositions = navigationEvent.pagePositions, let pageCell = completedNavigation.pageCell as? MobileContentPageCell, let pageView = pageCell.mobileContentView as? MobileContentPageView {

pageView.setPositionStateForViewHierarchy(
positionState: pagePositions,
Expand Down Expand Up @@ -159,9 +157,7 @@ class MobileContentPagesView: AppViewController {

for cell in visiblePageCells {

if let pageCell = cell as? MobileContentPageCell,
let pageView = pageCell.mobileContentView as? MobileContentPageView,
let indexPath = pageNavigationView.getIndexPathForPageCell(pageCell: pageCell) {
if let pageCell = cell as? MobileContentPageCell, let pageView = pageCell.mobileContentView as? MobileContentPageView, let indexPath = pageNavigationView.getIndexPathForPageCell(pageCell: pageCell) {

let page: Int = indexPath.row
let currentPagePositions: MobileContentViewPositionState = pageView.getPositionStateForViewHierarchy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,31 @@ import UIKit
extension UIImage {
//found here: https://www.advancedswift.com/resize-uiimage-no-stretching-swift/
func scalePreservingAspectRatio(targetSize: CGSize) -> UIImage {
// Determine the scale factor that preserves aspect ratio
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height

let scaleFactor = min(widthRatio, heightRatio)

// Compute the new image size that preserves aspect ratio
let scaledImageSize = CGSize(
width: size.width * scaleFactor,
height: size.height * scaleFactor
)

// Determine the scale factor that preserves aspect ratio
let widthRatio = targetSize.width / size.width
let heightRatio = targetSize.height / size.height

let scaleFactor = min(widthRatio, heightRatio)

// Compute the new image size that preserves aspect ratio
let scaledImageSize = CGSize(
width: size.width * scaleFactor,
height: size.height * scaleFactor
)

// Draw and return the resized UIImage
let renderer = UIGraphicsImageRenderer(
size: scaledImageSize
)
// Draw and return the resized UIImage
let renderer = UIGraphicsImageRenderer(
size: scaledImageSize
)

let scaledImage = renderer.image { _ in
self.draw(in: CGRect(
origin: .zero,
size: scaledImageSize
))
}

return scaledImage
let scaledImage = renderer.image { _ in
self.draw(in: CGRect(
origin: .zero,
size: scaledImageSize
))
}

return scaledImage
}
}

0 comments on commit b12ef1c

Please sign in to comment.