Skip to content

Commit

Permalink
[#21] Add UI model
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Nov 11, 2022
1 parent 2e6950c commit d623900
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 10 deletions.
56 changes: 55 additions & 1 deletion iosApp/Survey.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
09495F7B28FFF4340036BDFB /* FadePaginationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495F7928FFF4340036BDFB /* FadePaginationView.swift */; };
09495F7C28FFF4340036BDFB /* PageControlView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495F7A28FFF4340036BDFB /* PageControlView.swift */; };
09495F7E28FFF47F0036BDFB /* GestureVelocity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495F7D28FFF47F0036BDFB /* GestureVelocity.swift */; };
09495F7F2900017E0036BDFB /* ViewId+SurveySelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495F7728FFF2D50036BDFB /* ViewId+SurveySelection.swift */; };
09495FA0290A82290036BDFB /* LoginFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495F9F290A82290036BDFB /* LoginFlow.swift */; };
09495FA3290A823C0036BDFB /* SurveySelectionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495FA2290A823C0036BDFB /* SurveySelectionScreen.swift */; };
09495FA6290A82590036BDFB /* SurveySelectionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09495FA5290A82590036BDFB /* SurveySelectionSpec.swift */; };
09636AF228D4779400A5CB97 /* NeuzeitSLTStd-Book.otf in Resources */ = {isa = PBXBuildFile; fileRef = 09636AF028D4779400A5CB97 /* NeuzeitSLTStd-Book.otf */; };
09636AF328D4779400A5CB97 /* NeuzeitSLTStd-BookHeavy.otf in Resources */ = {isa = PBXBuildFile; fileRef = 09636AF128D4779400A5CB97 /* NeuzeitSLTStd-BookHeavy.otf */; };
09636AF628D47A1500A5CB97 /* R.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09636AF528D47A1400A5CB97 /* R.generated.swift */; };
Expand Down Expand Up @@ -118,6 +122,9 @@
09495F7928FFF4340036BDFB /* FadePaginationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FadePaginationView.swift; sourceTree = "<group>"; };
09495F7A28FFF4340036BDFB /* PageControlView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageControlView.swift; sourceTree = "<group>"; };
09495F7D28FFF47F0036BDFB /* GestureVelocity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GestureVelocity.swift; sourceTree = "<group>"; };
09495F9F290A82290036BDFB /* LoginFlow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginFlow.swift; sourceTree = "<group>"; };
09495FA2290A823C0036BDFB /* SurveySelectionScreen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SurveySelectionScreen.swift; sourceTree = "<group>"; };
09495FA5290A82590036BDFB /* SurveySelectionSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SurveySelectionSpec.swift; sourceTree = "<group>"; };
09636AF028D4779400A5CB97 /* NeuzeitSLTStd-Book.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NeuzeitSLTStd-Book.otf"; sourceTree = "<group>"; };
09636AF128D4779400A5CB97 /* NeuzeitSLTStd-BookHeavy.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "NeuzeitSLTStd-BookHeavy.otf"; sourceTree = "<group>"; };
09636AF528D47A1400A5CB97 /* R.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = R.generated.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -239,6 +246,30 @@
path = SurveySelection;
sourceTree = "<group>";
};
09495F9E290A82290036BDFB /* Flows */ = {
isa = PBXGroup;
children = (
09495F9F290A82290036BDFB /* LoginFlow.swift */,
);
path = Flows;
sourceTree = "<group>";
};
09495FA1290A823C0036BDFB /* SurveySelection */ = {
isa = PBXGroup;
children = (
09495FA2290A823C0036BDFB /* SurveySelectionScreen.swift */,
);
path = SurveySelection;
sourceTree = "<group>";
};
09495FA4290A82590036BDFB /* SurveySelection */ = {
isa = PBXGroup;
children = (
09495FA5290A82590036BDFB /* SurveySelectionSpec.swift */,
);
path = SurveySelection;
sourceTree = "<group>";
};
09636AEF28D4777E00A5CB97 /* Fonts */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -300,6 +331,23 @@
path = Presentation;
sourceTree = "<group>";
};
09636B1128D80FB000A5CB97 /* Modules */ = {
isa = PBXGroup;
children = (
09636B1228D80FC100A5CB97 /* Login */,
09495FA4290A82590036BDFB /* SurveySelection */,
);
path = Modules;
sourceTree = "<group>";
};
09636B1228D80FC100A5CB97 /* Login */ = {
isa = PBXGroup;
children = (
09636B1A28D8215C00A5CB97 /* LoginSpec.swift */,
);
path = Login;
sourceTree = "<group>";
};
09636B1328D8146500A5CB97 /* ViewId */ = {
isa = PBXGroup;
children = (
Expand All @@ -317,6 +365,7 @@
children = (
09636B3728D8286600A5CB97 /* General */,
09636B2728D8251300A5CB97 /* Login */,
09495FA1290A823C0036BDFB /* SurveySelection */,
09636B2A28D8255D00A5CB97 /* ScreenProtocol.swift */,
);
path = Screens;
Expand Down Expand Up @@ -503,6 +552,7 @@
450B8AFFE6D899DF9189AB05 /* Sources */ = {
isa = PBXGroup;
children = (
09495F9E290A82290036BDFB /* Flows */,
09636B2628D8250B00A5CB97 /* Screens */,
CF43FB94DA987166ECF7EC52 /* Specs */,
);
Expand Down Expand Up @@ -934,7 +984,7 @@
outputFileListPaths = (
);
outputPaths = (
"$SRCROOT/$PROJECT_NAME/Sources/Supports/Helpers/Rswift/R.generated.swift",
$SRCROOT/$PROJECT_NAME/Sources/Supports/Helpers/Rswift/R.generated.swift,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -1172,11 +1222,15 @@
files = (
09636B3328D8272E00A5CB97 /* ViewId+General.swift in Sources */,
09636B3228D8272200A5CB97 /* ScreenProtocol.swift in Sources */,
09495FA6290A82590036BDFB /* SurveySelectionSpec.swift in Sources */,
09636B2128D821EA00A5CB97 /* ViewId.swift in Sources */,
09495F6A28FFAFA20036BDFB /* ViewId+Splash.swift in Sources */,
09495FA0290A82290036BDFB /* LoginFlow.swift in Sources */,
09495F7F2900017E0036BDFB /* ViewId+SurveySelection.swift in Sources */,
09636B3628D8285700A5CB97 /* KeyboardScreen.swift in Sources */,
09636B2228D821ED00A5CB97 /* ViewId+Login.swift in Sources */,
09636B3128D8271D00A5CB97 /* LoginScreen.swift in Sources */,
09495FA3290A823C0036BDFB /* SurveySelectionScreen.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI

struct SurveyItemView: View {

let survey: Survey
let survey: SurveyUI

var body: some View {
ZStack {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ struct SurveySelectionView: View {

@State private var currentPage = 0
// TODO: Replace Example data
@State private var surveys: [Survey] = [
Survey(
@State private var surveys: [SurveyUI] = [
SurveyUI(
id: "1",
imageUrl: "https://dhdbhh0jsld0o.cloudfront.net/m/1ea51560991bcb7d00d0_",
title: "Scarlett Bangkok",
description: "We'd love ot hear from you!"
),
Survey(
SurveyUI(
id: "2",
imageUrl: "https://dhdbhh0jsld0o.cloudfront.net/m/287db81c5e4242412cc0_",
title: "ibis Bangkok Riverside",
description: "We'd love ot hear from you!"
),
Survey(
SurveyUI(
id: "3",
imageUrl: "https://dhdbhh0jsld0o.cloudfront.net/m/1ea51560991bcb7d00d0_",
title: "Scarlett Bangkok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ data class Survey (
val imageUrl: String,
val title: String,
val description: String
) {
val largeImageUrl
get() = imageUrl.plus("l")
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.nimblehq.blisskmmic.presentation.model

data class SurveyUI (
val id: String,
val imageUrl: String,
val title: String,
val description: String
) {
val largeImageUrl
get() = imageUrl.plus("l")
}

0 comments on commit d623900

Please sign in to comment.