Skip to content

Commit df6396d

Browse files
committed
- atter-logic submodule
- GetEvent use case
1 parent 724de75 commit df6396d

File tree

6 files changed

+62
-11
lines changed

6 files changed

+62
-11
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "atter-logic"]
2+
path = atter-logic
3+
url = https://github.com/mateuszkwiecinski/atter-logic

Atter.xcodeproj/project.pbxproj

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
8F74564022E1B050003B9C1D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F74563F22E1B050003B9C1D /* AppDelegate.swift */; };
1111
8F74564722E1B051003B9C1D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F74564622E1B051003B9C1D /* Assets.xcassets */; };
1212
8F74564A22E1B051003B9C1D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F74564822E1B051003B9C1D /* LaunchScreen.storyboard */; };
13+
8F8E659C22E24BA200881D5C /* atter_logic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F8E659B22E24BA100881D5C /* atter_logic.framework */; };
14+
8F8E659D22E24BA200881D5C /* atter_logic.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8F8E659B22E24BA100881D5C /* atter_logic.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1315
8FD7C8E522E21B050019B532 /* AtterTabBarRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E222E21B050019B532 /* AtterTabBarRouter.swift */; };
1416
8FD7C8E622E21B050019B532 /* AtterTabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E322E21B050019B532 /* AtterTabBarViewController.swift */; };
1517
8FD7C8E722E21B050019B532 /* AtterTabBarConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FD7C8E422E21B050019B532 /* AtterTabBarConfigurator.swift */; };
@@ -27,6 +29,20 @@
2729
E314BD30BBAF1CE6474593C7 /* Pods_Atter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3B08D871FB59595CB29583 /* Pods_Atter.framework */; };
2830
/* End PBXBuildFile section */
2931

32+
/* Begin PBXCopyFilesBuildPhase section */
33+
8F8E659E22E24BA200881D5C /* Embed Frameworks */ = {
34+
isa = PBXCopyFilesBuildPhase;
35+
buildActionMask = 2147483647;
36+
dstPath = "";
37+
dstSubfolderSpec = 10;
38+
files = (
39+
8F8E659D22E24BA200881D5C /* atter_logic.framework in Embed Frameworks */,
40+
);
41+
name = "Embed Frameworks";
42+
runOnlyForDeploymentPostprocessing = 0;
43+
};
44+
/* End PBXCopyFilesBuildPhase section */
45+
3046
/* Begin PBXFileReference section */
3147
1A3B08D871FB59595CB29583 /* Pods_Atter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Atter.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3248
7D02AB8ECD98F92E430A8B34 /* Pods-Atter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Atter.release.xcconfig"; path = "Target Support Files/Pods-Atter/Pods-Atter.release.xcconfig"; sourceTree = "<group>"; };
@@ -35,6 +51,7 @@
3551
8F74564622E1B051003B9C1D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3652
8F74564922E1B051003B9C1D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3753
8F74564B22E1B051003B9C1D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
54+
8F8E659B22E24BA100881D5C /* atter_logic.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = atter_logic.framework; path = "atter-logic/atter-logic/build/xcode-frameworks/atter_logic.framework"; sourceTree = "<group>"; };
3855
8FD7C8E222E21B050019B532 /* AtterTabBarRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarRouter.swift; sourceTree = "<group>"; };
3956
8FD7C8E322E21B050019B532 /* AtterTabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarViewController.swift; sourceTree = "<group>"; };
4057
8FD7C8E422E21B050019B532 /* AtterTabBarConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtterTabBarConfigurator.swift; sourceTree = "<group>"; };
@@ -57,6 +74,7 @@
5774
isa = PBXFrameworksBuildPhase;
5875
buildActionMask = 2147483647;
5976
files = (
77+
8F8E659C22E24BA200881D5C /* atter_logic.framework in Frameworks */,
6078
E314BD30BBAF1CE6474593C7 /* Pods_Atter.framework in Frameworks */,
6179
);
6280
runOnlyForDeploymentPostprocessing = 0;
@@ -84,6 +102,7 @@
84102
8F74563322E1B050003B9C1D = {
85103
isa = PBXGroup;
86104
children = (
105+
8F8E659B22E24BA100881D5C /* atter_logic.framework */,
87106
8F74563E22E1B050003B9C1D /* Atter */,
88107
8F74563D22E1B050003B9C1D /* Products */,
89108
05A2C2869DB0ADC05ABE9CAF /* Pods */,
@@ -204,12 +223,14 @@
204223
buildConfigurationList = 8F74564E22E1B051003B9C1D /* Build configuration list for PBXNativeTarget "Atter" */;
205224
buildPhases = (
206225
870EFA60EB091353C50386AF /* [CP] Check Pods Manifest.lock */,
226+
8F8E659F22E24BC900881D5C /* Run gradlew */,
207227
8FD7C8E822E21C060019B532 /* Run R.swift */,
208228
8F74563822E1B050003B9C1D /* Sources */,
209229
8F74563922E1B050003B9C1D /* Frameworks */,
210230
8F74563A22E1B050003B9C1D /* Resources */,
211231
8F74565322E1B14D003B9C1D /* Run SwiftLint */,
212232
CCDAAFCDA4811C812C1DC979 /* [CP] Embed Pods Frameworks */,
233+
8F8E659E22E24BA200881D5C /* Embed Frameworks */,
213234
);
214235
buildRules = (
215236
);
@@ -308,6 +329,24 @@
308329
shellPath = /bin/sh;
309330
shellScript = "${PODS_ROOT}/SwiftLint/swiftlint\n";
310331
};
332+
8F8E659F22E24BC900881D5C /* Run gradlew */ = {
333+
isa = PBXShellScriptBuildPhase;
334+
buildActionMask = 2147483647;
335+
files = (
336+
);
337+
inputFileListPaths = (
338+
);
339+
inputPaths = (
340+
);
341+
name = "Run gradlew";
342+
outputFileListPaths = (
343+
);
344+
outputPaths = (
345+
);
346+
runOnlyForDeploymentPostprocessing = 0;
347+
shellPath = /bin/sh;
348+
shellScript = "cd \"$SRCROOT/atter-logic/atter-logic/build/xcode-frameworks\"\n./gradlew :atter-logic:packForXCode -PXCODE_CONFIGURATION=${CONFIGURATION}\n";
349+
};
311350
8FD7C8E822E21C060019B532 /* Run R.swift */ = {
312351
isa = PBXShellScriptBuildPhase;
313352
buildActionMask = 2147483647;
@@ -505,6 +544,10 @@
505544
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
506545
CODE_SIGN_STYLE = Automatic;
507546
DEVELOPMENT_TEAM = WB5LCV9PU6;
547+
FRAMEWORK_SEARCH_PATHS = (
548+
"$(inherited)",
549+
"$(PROJECT_DIR)/atter-logic/atter-logic/build/xcode-frameworks",
550+
);
508551
INFOPLIST_FILE = "$(SRCROOT)/Atter/Supporting Files/Info.plist";
509552
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
510553
LD_RUNPATH_SEARCH_PATHS = (
@@ -525,6 +568,10 @@
525568
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
526569
CODE_SIGN_STYLE = Automatic;
527570
DEVELOPMENT_TEAM = WB5LCV9PU6;
571+
FRAMEWORK_SEARCH_PATHS = (
572+
"$(inherited)",
573+
"$(PROJECT_DIR)/atter-logic/atter-logic/build/xcode-frameworks",
574+
);
528575
INFOPLIST_FILE = "$(SRCROOT)/Atter/Supporting Files/Info.plist";
529576
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
530577
LD_RUNPATH_SEARCH_PATHS = (

Atter/Event List/Cell/EventCell.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
//
88

99
import UIKit
10+
import atter_logic
1011

1112
class EventCell: UITableViewCell {
1213

1314
@IBOutlet private weak var nameLabel: UILabel!
1415
@IBOutlet private weak var dateLabel: UILabel!
1516
@IBOutlet private weak var attendeesLabel: UILabel!
1617

17-
func setup(name: String, date: String, attendees: Int) {
18-
nameLabel.text = name
19-
dateLabel.text = date
20-
attendeesLabel.text = "number of attendees: \(attendees)"
18+
func setup(with event: Event) {
19+
nameLabel.text = event.name
20+
dateLabel.text = event.eventDate
21+
attendeesLabel.text = "number of attendees: \(event.attendeesCount)"
2122
}
2223
}

Atter/Event List/EventListViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extension EventListViewController: UITableViewDataSource {
5353
return UITableViewCell()
5454
}
5555

56-
cell.setup(name: event.name, date: event.date, attendees: event.attendees)
56+
cell.setup(with: event)
5757

5858
return cell
5959
}

Atter/Event List/EventListViewModel.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
//
88

99
import UIKit
10+
import atter_logic
1011

1112
final class EventListViewModel: ViewModel {
1213

13-
typealias Event = (name: String, date: String, attendees: Int)
14-
14+
private let getEventUseCase: GetEvents
1515
private(set) var events: [Event] = []
1616

1717
weak var presenter: EventListPresenter?
1818

19-
init(presenter: EventListPresenter) {
19+
init(presenter: EventListPresenter, getEventUseCase: GetEvents = .init()) {
2020
self.presenter = presenter
21+
self.getEventUseCase = getEventUseCase
2122
}
2223

2324
func viewWillAppear() {
24-
events = [Event("Super event1", "13.07.19", 7),
25-
Event("Jan Paweł", "21.37.19", 2),
26-
Event("Lot do Sydney", "16.11.19", 4)]
25+
events = getEventUseCase.invoke()
2726
presenter?.reloadTableView()
2827
}
2928
}

atter-logic

Submodule atter-logic added at 7c883c9

0 commit comments

Comments
 (0)