8000 [UPUP-1077]: PageRequestService by ridebyhorse · Pull Request #5 · MobileUpLLC/PagingList · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[UPUP-1077]: PageRequestService #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 98 additions & 6 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
objects = {

/* Begin PBXBuildFile section */
084770A82DAF92F60043935A /* PostExampleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 084770A72DAF92E50043935A /* PostExampleModel.swift */; };
084770AB2DAFA1C80043935A /* PostsRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 084770AA2DAFA1C00043935A /* PostsRepository.swift */; };
084770DC2DAFD9C50043935A /* MockPostExampleModel&PI=1&PS=10.json in Resources */ = {isa = PBXBuildFile; fileRef = 084770C82DAFA6710043935A /* MockPostExampleModel&PI=1&PS=10.json */; };
084770DD2DAFD9C50043935A /* MockPostExampleModel&PI=2&PS=10.json in Resources */ = {isa = PBXBuildFile; fileRef = 084770CC2DAFA7060043935A /* MockPostExampleModel&PI=2&PS=10.json */; };
084770DE2DAFD9C50043935A /* MockPostExampleModel&PI=3&PS=10.json in Resources */ = {isa = PBXBuildFile; fileRef = 084770CE2DAFA76F0043935A /* MockPostExampleModel&PI=3&PS=10.json */; };
084770E22DAFDB7A0043935A /* MockPostExampleModel&PI=4&PS=10.json in Resources */ = {isa = PBXBuildFile; fileRef = 084770E12DAFDB7A0043935A /* MockPostExampleModel&PI=4&PS=10.json */; };
084770E42DAFE1090043935A /* ListWithPageRequestServiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 084770E32DAFE0F90043935A /* ListWithPageRequestServiceView.swift */; };
084770E62DAFE1A10043935A /* ListWithPageRequestServiceViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 084770E52DAFE18B0043935A /* ListWithPageRequestServiceViewModel.swift */; };
08D497D82DB7E4DB008C31C3 /* PostModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D497D72DB7E4D7008C31C3 /* PostModel.swift */; };
08D497DA2DB7EA87008C31C3 /* PostsRepositoryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D497D92DB7EA78008C31C3 /* PostsRepositoryError.swift */; };
08D497DD2DB7EAD4008C31C3 /* IntsRepositoryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08D497DC2DB7EAD2008C31C3 /* IntsRepositoryError.swift */; };
733AAF712CECDECA00FAB5AF /* ListWithSectionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 733AAF702CECDECA00FAB5AF /* ListWithSectionsView.swift */; };
733AAF732CECEC6500FAB5AF /* ListStateViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 733AAF722CECEC6500FAB5AF /* ListStateViews.swift */; };
73FE54682CEF6DEC00B6C83E /* ListWithoutSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73FE54672CEF6DEC00B6C83E /* ListWithoutSectionView.swift */; };
Expand All @@ -19,6 +30,17 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
084770A72DAF92E50043935A /* PostExampleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostExampleModel.swift; sourceTree = "<group>"; };
084770AA2DAFA1C00043935A /* PostsRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsRepository.swift; sourceTree = "<group>"; };
084770C82DAFA6710043935A /* MockPostExampleModel&PI=1&PS=10.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "MockPostExampleModel&PI=1&PS=10.json"; sourceTree = "<group>"; };
084770CC2DAFA7060043935A /* MockPostExampleModel&PI=2&PS=10.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "MockPostExampleModel&PI=2&PS=10.json"; sourceTree = "<group>"; };
084770CE2DAFA76F0043935A /* MockPostExampleModel&PI=3&PS=10.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "MockPostExampleModel&PI=3&PS=10.json"; sourceTree = "<group>"; };
084770E12DAFDB7A0043935A /* MockPostExampleModel&PI=4&PS=10.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "MockPostExampleModel&PI=4&PS=10.json"; sourceTree = "<group>"; };
084770E32DAFE0F90043935A /* ListWithPageRequestServiceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWithPageRequestServiceView.swift; sourceTree = "<group>"; };
084770E52DAFE18B0043935A /* ListWithPageRequestServiceViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWithPageRequestServiceViewModel.swift; sourceTree = "<group>"; };
08D497D72DB7E4D7008C31C3 /* PostModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostModel.swift; sourceTree = "<group>"; };
08D497D92DB7EA78008C31C3 /* PostsRepositoryError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsRepositoryError.swift; sourceTree = "<group>"; };
08D497DC2DB7EAD2008C31C3 /* IntsRepositoryError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntsRepositoryError.swift; sourceTree = "<group>"; };
733AAF702CECDECA00FAB5AF /* ListWithSectionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWithSectionsView.swift; sourceTree = "<group>"; };
733AAF722CECEC6500FAB5AF /* ListStateViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListStateViews.swift; sourceTree = "<group>"; };
73FE54672CEF6DEC00B6C83E /* ListWithoutSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListWithoutSectionView.swift; sourceTree = "<group>"; };
Expand All @@ -43,6 +65,65 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
084770A92DAFA1B30043935A /* Repository */ = {
isa = PBXGroup;
children = (
E10FA355297A68830031ED65 /* IntsRepository.swift */,
084770AA2DAFA1C00043935A /* PostsRepository.swift */,
);
path = Repository;
sourceTree = "<group>";
};
084770C72DAFA5250043935A /* Mock */ = {
isa = PBXGroup;
children = (
084770C82DAFA6710043935A /* MockPostExampleModel&PI=1&PS=10.json */,
084770CC2DAFA7060043935A /* MockPostExampleModel&PI=2&PS=10.json */,
084770CE2DAFA76F0043935A /* MockPostExampleModel&PI=3&PS=10.json */,
084770E12DAFDB7A0043935A /* MockPostExampleModel&PI=4&PS=10.json */,
);
path = Mock;
sourceTree = "<group>";
};
084770D02DAFA7BB0043935A /* UI */ = {
isa = PBXGroup;
children = (
089B61F82DB2239C00059219 /* ListWithPageRequestService */,
73FE54672CEF6DEC00B6C83E /* ListWithoutSectionView.swift */,
E1FDB14B29770604003CC2A5 /* ContentView.swift */,
733AAF722CECEC6500FAB5AF /* ListStateViews.swift */,
733AAF702CECDECA00FAB5AF /* ListWithSectionsView.swift */,
);
path = UI;
sourceTree = "<group>";
};
084770D12DAFA7D60043935A /* Model */ = {
isa = PBXGroup;
children = (
08D497D72DB7E4D7008C31C3 /* PostModel.swift */,
084770A72DAF92E50043935A /* PostExampleModel.swift */,
);
path = Model;
sourceTree = "<group>";
};
089B61F82DB2239C00059219 /* ListWithPageRequestService */ = {
isa = PBXGroup;
children = (
084770E52DAFE18B0043935A /* ListWithPageRequestServiceViewModel.swift */,
084770E32DAFE0F90043935A /* ListWithPageRequestServiceView.swift */,
);
path = ListWithPageRequestService;
sourceTree = "<group>";
};
08D497DB2DB7EACD008C31C3 /* Error */ = {
isa = PBXGroup;
children = (
08D497DC2DB7EAD2008C31C3 /* IntsRepositoryError.swift */,
08D497D92DB7EA78008C31C3 /* PostsRepositoryError.swift */,
);
path = Error;
sourceTree = "<group>";
};
E10FA35129770CBE0031ED65 /* Packages */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -72,12 +153,12 @@
E1FDB14829770604003CC2A5 /* Sources */ = {
isa = PBXGroup;
children = (
08D497DB2DB7EACD008C31C3 /* Error */,
084770C72DAFA5250043935A /* Mock */,
084770D12DAFA7D60043935A /* Model */,
084770D02DAFA7BB0043935A /* UI */,
084770A92DAFA1B30043935A /* Repository */,
E1FDB14929770604003CC2A5 /* ExampleApp.swift */,
E1FDB14B29770604003CC2A5 /* ContentView.swift */,
733AAF722CECEC6500FAB5AF /* ListStateViews.swift */,
E10FA355297A68830031ED65 /* IntsRepository.swift */,
733AAF702CECDECA00FAB5AF /* ListWithSectionsView.swift */,
73FE54672CEF6DEC00B6C83E /* ListWithoutSectionView.swift */,
E1FDB14D29770605003CC2A5 /* Assets.xcassets */,
E1FDB14F29770605003CC2A5 /* Preview Content */,
);
Expand Down Expand Up @@ -161,6 +242,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
084770DC2DAFD9C50043935A /* MockPostExampleModel&PI=1&PS=10.json in Resources */,
084770DD2DAFD9C50043935A /* MockPostExampleModel&PI=2&PS=10.json in Resources */,
084770E22DAFDB7A0043935A /* MockPostExampleModel&PI=4&PS=10.json in Resources */,
084770DE2DAFD9C50043935A /* MockPostExampleModel&PI=3&PS=10.json in Resources */,
E1FDB15129770605003CC2A5 /* Preview Assets.xcassets in Resources */,
E1FDB14E29770605003CC2A5 /* Assets.xcassets in Resources */,
);
Expand All @@ -186,7 +271,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\n\nif which swiftlint >/dev/null; then\n swiftlint --path 6DB6 .. --config ../swiftlint.yml\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
shellScript = "export PATH=\"$HOME/.mint/bin:/opt/homebrew/bin:$PATH\"\nexpected_swiflint_version=\"0.58.2\"\n\nif (mint list | grep \"$expected_swiflint_version\"); then\n mint install realm/SwiftLint@\"$expected_swiflint_version\"\n swiftlint lint --config ../swiftlint.yml ..\nelse\n echo \"SwiftLint $expected_swiflint_version is not installed\"\n echo \"run the command in the terminal: mint install realm/SwiftLint@$expected_swiflint_version\"\n exit 1\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

Expand All @@ -195,12 +280,19 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
084770A82DAF92F60043935A /* PostExampleModel.swift in Sources */,
E10FA356297A68830031ED65 /* IntsRepository.swift in Sources */,
733AAF712CECDECA00FAB5AF /* ListWithSectionsView.swift in Sources */,
08D497DD2DB7EAD4008C31C3 /* IntsRepositoryError.swift in Sources */,
E1FDB14C29770604003CC2A5 /* ContentView.swift in Sources */,
73FE54682CEF6DEC00B6C83E /* ListWithoutSectionView.swift in Sources */,
084770AB2DAFA1C80043935A /* PostsRepository.swift in Sources */,
084770E42DAFE1090043935A /* ListWithPageRequestServiceView.swift in Sources */,
733AAF732CECEC6500FAB5AF /* ListStateViews.swift in Sources */,
08D497DA2DB7EA87008C31C3 /* PostsRepositoryError.swift in Sources */,
E1FDB14A29770604003CC2A5 /* ExampleApp.swift in Sources */,
084770E62DAFE1A10043935A /* ListWithPageRequestServiceViewModel.swift in Sources */,
08D497D82DB7E4DB008C31C3 /* PostModel.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
21 changes: 21 additions & 0 deletions Example/Sources/Error/IntsRepositoryError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// IntsRepositoryError.swift
// Example
//
// Created by Maria Nesterova on 22.04.2025.
//

import Foundation

enum IntsRepositoryError: Swift.Error {
case undefined
}

extension IntsRepositoryError: LocalizedError {
var errorDescription: String? {
switch self {
case .undefined:
return "Undefined error"
}
}
}
21 changes: 21 additions & 0 deletions Example/Sources/Error/PostsRepositoryError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// PostsRepositoryError.swift
// Example
//
// Created by Maria Nesterova on 22.04.2025.
//

import Foundation

enum PostsRepositoryError: Swift.Error {
case undefined
}

extension PostsRepositoryError: LocalizedError {
var errorDescription: String? {
switch self {
case .undefined:
return "Undefined error"
}
}
}
65 changes: 65 additions & 0 deletions Example/Sources/Mock/MockPostExampleModel&PI=1&PS=10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"posts": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Post 1",
"description": "Got first post",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "223e4567-e89b-12d3-a456-426614174001",
"title": "Post 2",
"description": "Excited for the second post!",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "323e4567-e89b-12d3-a456-426614174002",
"title": "Post 3",
"description": "Third post vibes",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "423e4567-e89b-12d3-a456-426614174003",
"title": "Post 4",
"description": "Another day, another post",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "523e4567-e89b-12d3-a456-426614174004",
"title": "Post 5",
"description": "Loving this journey",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "623e4567-e89b-12d3-a456-426614174005",
"title": "Post 6",
"description": "Halfway through!",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "723e4567-e89b-12d3-a456-426614174006",
"title": "Post 7",
"description": "Lucky number seven",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "823e4567-e89b-12d3-a456-426614174007",
"title": "Post 8",
"description": "Keeping it real",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "923e4567-e89b-12d3-a456-426614174008",
"title": "Post 9",
"description": "Almost at double digits",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "a23e4567-e89b-12d3-a456-426614174009",
"title": "Post 10",
"description": "Made it to ten!",
"imageUrl": "https://picsum.photos/200"
}
],
"hasMore": true
}
65 changes: 65 additions & 0 deletions Example/Sources/Mock/MockPostExampleModel&PI=2&PS=10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"posts": [
{
"id": "b23e4567-e89b-12d3-a456-426614174010",
"title": "Post 11",
"description": "Eleven is my favorite",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "c23e4567-e89b-12d3-a456-426614174011",
"title": "Post 12",
"description": "Twelve posts and counting",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "d23e4567-e89b-12d3-a456-426614174012",
"title": "Post 13",
"description": "Lucky thirteen",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "e23e4567-e89b-12d3-a456-426614174013",
"title": "Post 14",
"description": "Fourteen feels great",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "f23e4567-e89b-12d3-a456-426614174014",
"title": "Post 15",
"description": "Halfway to thirty!",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "g23e4567-e89b-12d3-a456-426614174015",
"title": "Post 16",
"description": "Sweet sixteen",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "h23e4567-e89b-12d3-a456-426614174016",
"title": "Post 17",
"description": "Seventeen and thriving",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "i23e4567-e89b-12d3-a456-426614174017",
"title": "Post 18",
"description": "Eighteen posts strong",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "j23e4567-e89b-12d3-a456-426614174018",
"title": "Post 19",
"description": "Nineteen and counting",
"imageUrl": "https://picsum.photos/200"
},
{
"id": "k23e4567-e89b-12d3-a456-426614174019",
"title": "Post 20",
"description": "Twenty posts milestone!",
"imageUrl": "https://picsum.photos/200"
}
],
"hasMore": true
}
Loading
0