Skip to content

Commit f654260

Browse files
committed
- More code clean up.
1 parent b09487b commit f654260

Some content is hidden

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

43 files changed

+93
-127
lines changed

AppStoreExample/AppStoreExample/AppBoundary.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 4/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/AppDelegate.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppDelegate.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import UIKit

AppStoreExample/AppStoreExample/Base.lproj/LaunchScreen.storyboard

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3-
<device id="retina3_5" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
63
<dependencies>
7-
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
95
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
106
</dependencies>
117
<scenes>
@@ -18,17 +14,17 @@
1814
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
1915
</layoutGuides>
2016
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21-
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
2218
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2319
<subviews>
2420
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AppStoreExample" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c6V-oA-CkW">
25-
<rect key="frame" x="49" y="224" width="222" height="33.5"/>
21+
<rect key="frame" x="191" y="283.5" width="218.5" height="33.5"/>
2622
<fontDescription key="fontDescription" type="italicSystem" pointSize="28"/>
2723
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
2824
<nil key="highlightedColor"/>
2925
</label>
30-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Francisco Valbuena" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zdn-oN-X5w">
31-
<rect key="frame" x="89" y="265" width="142.5" height="20"/>
26+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Frank Valbuena" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zdn-oN-X5w">
27+
<rect key="frame" x="244" y="324.5" width="112" height="20"/>
3228
<fontDescription key="fontDescription" name="HelveticaNeue-LightItalic" family="Helvetica Neue" pointSize="17"/>
3329
<nil key="textColor"/>
3430
<nil key="highlightedColor"/>

AppStoreExample/AppStoreExample/Core/Model/AppData.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppData.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/Services/Adapters/CoreDataAppsRepository.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
// CoreDataAppsRepository.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/6/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/6/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation
1010
import CoreData
1111
import MagicalRecord
1212

13-
public class AppSyncDataEntity: NSManagedObject {
13+
public final class AppSyncDataEntity: NSManagedObject {
1414
@NSManaged public var a_appstoreID: String?
1515
@NSManaged public var a_artist: String?
1616
@NSManaged public var a_bannerURL: String?
@@ -38,7 +38,7 @@ extension AppSyncDataEntity: AppData {
3838
var rank: Int { return a_rank!.intValue }
3939
}
4040

41-
class CoreDataAppsRepository: AppsRepository {
41+
final class CoreDataAppsRepository: AppsRepository {
4242
var lastSyncDate: Date? {
4343
get { return UserDefaults.standard.value(forKey:"lastSyncDate") as? Date }
4444
set(value) { UserDefaults.standard.set(value, forKey: "lastSyncDate") }

AppStoreExample/AppStoreExample/Core/Services/Adapters/InMemoryAppsRepository.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// InMemoryAppsRepository.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/Services/Adapters/ItunesWebService.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// ItunesWebService.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation
1010
import Alamofire
1111

12-
class ItunesWebService: AppStoreService {
12+
final class ItunesWebService: AppStoreService {
1313
static let endPoint = "https://itunes.apple.com/us/rss/topfreeapplications/"
1414

1515
func retrieveTopFreeApps(count: Int, completion: @escaping (AppStoreResponse) -> Void) {

AppStoreExample/AppStoreExample/Core/Services/AppStoreService.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppStoreService.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/Services/AppsRepository.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppsRepository.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCase.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// UseCaseGateway.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/GetAppDetails.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// GetAppDetails.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/Implementations/GetAppDetailsImp.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// GetAppDetailsImp.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/Implementations/ListAppsImpl.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// ListAppsImpl.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/Implementations/ListCategoriesImpl.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// ListCategoriesImpl.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/Implementations/SyncAppDataImpl.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SyncAppDataImpl.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation
@@ -35,7 +35,7 @@ final class SyncAppDataImpl: SyncAppData {
3535
completion(result)
3636
}
3737

38-
service.retrieveTopFreeApps(count: SyncAppDataImpl.numberOfAppsToSync) {
38+
service.retrieveTopFreeApps(count: Self.numberOfAppsToSync) {
3939
switch $0 {
4040
case .success(let apps):
4141
repository.removeAllApps()

AppStoreExample/AppStoreExample/Core/UseCases/ListApps.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// ListApps.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/ListCategories.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// ListAppCategories.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Core/UseCases/SyncAppData.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// SyncAppData.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/3/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/3/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/Entity.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 5/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/SceneAppDelegate.swift

+1-31
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 4/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation
1010
import UIKit
1111
import Boundaries
1212

1313
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
14-
typealias Boundary = AppBoundary
15-
1614
var window: UIWindow?
1715
let appBoundary = AppBoundary.Resolved()
1816

@@ -25,32 +23,4 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
2523
window.makeKeyAndVisible()
2624
self.window = window
2725
}
28-
29-
func sceneDidDisconnect(_ scene: UIScene) {
30-
// Called as the scene is being released by the system.
31-
// This occurs shortly after the scene enters the background, or when its session is discarded.
32-
// Release any resources associated with this scene that can be re-created the next time the scene connects.
33-
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
34-
}
35-
36-
func sceneDidBecomeActive(_ scene: UIScene) {
37-
// Called when the scene has moved from an inactive state to an active state.
38-
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
39-
}
40-
41-
func sceneWillResignActive(_ scene: UIScene) {
42-
// Called when the scene will move from an active state to an inactive state.
43-
// This may occur due to temporary interruptions (ex. an incoming phone call).
44-
}
45-
46-
func sceneWillEnterForeground(_ scene: UIScene) {
47-
// Called as the scene transitions from the background to the foreground.
48-
// Use this method to undo the changes made on entering the background.
49-
}
50-
51-
func sceneDidEnterBackground(_ scene: UIScene) {
52-
// Called as the scene transitions from the foreground to the background.
53-
// Use this method to save data, release shared resources, and store enough scene-specific state information
54-
// to restore the scene back to its current state.
55-
}
5626
}

AppStoreExample/AppStoreExample/Service.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 4/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/View.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 4/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/ViewModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// AppStoreExample
44
//
55
// Created by Frank Valbuena on 4/05/20.
6-
// Copyright © 2020 Francisco Valbuena. All rights reserved.
6+
// Copyright © 2020 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/ViewModels/AppCategoriesViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppCategoriesViewModel.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/6/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/6/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/ViewModels/AppDetailsViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppDetailsViewModel.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import AlamofireImage

AppStoreExample/AppStoreExample/ViewModels/AppListViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppListViewModel.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/ViewModels/AppSyncViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppSyncViewModel.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

AppStoreExample/AppStoreExample/ViewModels/AppThumbnailViewModel.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// AppThumbnailViewModel.swift
33
// AppStoreExample
44
//
5-
// Created by Francisco Valbuena on 1/4/17.
6-
// Copyright © 2017 Francisco Valbuena. All rights reserved.
5+
// Created by Frank Valbuena on 1/4/17.
6+
// Copyright © 2017 Frank Valbuena. All rights reserved.
77
//
88

99
import Foundation

0 commit comments

Comments
 (0)