Skip to content
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

Working post #6

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.xcodeproj/project.xcworkspace/xcuserdata/
*.xcodeproj/xcuserdata/
*.xcworkspace/xcuserdata/
*.DS_Store
DerivedData/
build/
42 changes: 42 additions & 0 deletions MobileAcebook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
objects = {

/* Begin PBXBuildFile section */
185902772AD4449A0072BFE6 /* SignInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 185902762AD4449A0072BFE6 /* SignInView.swift */; };
18755DB92AD44EA200EBD67D /* FeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18755DB82AD44EA200EBD67D /* FeedView.swift */; };
18755DBB2AD4509000EBD67D /* SignUpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18755DBA2AD4509000EBD67D /* SignUpView.swift */; };
322FA2F42AD6B21F00DB3C70 /* CreatePostPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322FA2F32AD6B21F00DB3C70 /* CreatePostPage.swift */; };
322FA2F62AD6C83700DB3C70 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322FA2F52AD6C83700DB3C70 /* Post.swift */; };
AE5D85B02AC8A221009680C6 /* MobileAcebookApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5D85AF2AC8A221009680C6 /* MobileAcebookApp.swift */; };
AE5D85B42AC8A224009680C6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE5D85B32AC8A224009680C6 /* Assets.xcassets */; };
AE5D85B72AC8A224009680C6 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE5D85B62AC8A224009680C6 /* Preview Assets.xcassets */; };
Expand All @@ -19,6 +24,8 @@
AE5D85E32AC9AFD2009680C6 /* MockAuthenticationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5D85E22AC9AFD2009680C6 /* MockAuthenticationService.swift */; };
AE5D85E62AC9B077009680C6 /* AuthenticationServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5D85E52AC9B077009680C6 /* AuthenticationServiceProtocol.swift */; };
AE5D85E82AC9B29A009680C6 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5D85E72AC9B29A009680C6 /* User.swift */; };
C78022B72AD5770900D8A925 /* SignupPageService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78022B62AD5770900D8A925 /* SignupPageService.swift */; };
C78022C02AD5AFBF00D8A925 /* SignupPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78022BF2AD5AFBF00D8A925 /* SignupPageView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -39,6 +46,12 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
18034D252AD55C4A00B34CC3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
185902762AD4449A0072BFE6 /* SignInView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInView.swift; sourceTree = "<group>"; };
18755DB82AD44EA200EBD67D /* FeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedView.swift; sourceTree = "<group>"; };
18755DBA2AD4509000EBD67D /* SignUpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpView.swift; sourceTree = "<group>"; };
322FA2F32AD6B21F00DB3C70 /* CreatePostPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatePostPage.swift; sourceTree = "<group>"; };
322FA2F52AD6C83700DB3C70 /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = "<group>"; };
AE5D85AC2AC8A221009680C6 /* MobileAcebook.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MobileAcebook.app; sourceTree = BUILT_PRODUCTS_DIR; };
AE5D85AF2AC8A221009680C6 /* MobileAcebookApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MobileAcebookApp.swift; sourceTree = "<group>"; };
AE5D85B32AC8A224009680C6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -54,6 +67,9 @@
AE5D85E22AC9AFD2009680C6 /* MockAuthenticationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockAuthenticationService.swift; sourceTree = "<group>"; };
AE5D85E52AC9B077009680C6 /* AuthenticationServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationServiceProtocol.swift; sourceTree = "<group>"; };
AE5D85E72AC9B29A009680C6 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
C78022B62AD5770900D8A925 /* SignupPageService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupPageService.swift; sourceTree = "<group>"; };
C78022BF2AD5AFBF00D8A925 /* SignupPageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SignupPageView.swift; sourceTree = "<group>"; };
C7D8387C2AD43DC900C4BBC1 /* SignupPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupPageView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -88,6 +104,7 @@
AE5D85BF2AC8A224009680C6 /* MobileAcebookTests */,
AE5D85C92AC8A224009680C6 /* MobileAcebookUITests */,
AE5D85AD2AC8A221009680C6 /* Products */,
C78022BC2AD5AEEA00D8A925 /* Recovered References */,
);
sourceTree = "<group>";
};
Expand All @@ -104,13 +121,18 @@
AE5D85AE2AC8A221009680C6 /* MobileAcebook */ = {
isa = PBXGroup;
children = (
18034D252AD55C4A00B34CC3 /* Info.plist */,
AE5D85E42AC9B060009680C6 /* Protocols */,
AE5D85DF2AC9AF83009680C6 /* Models */,
AE5D85DD2AC9AF72009680C6 /* Services */,
AE5D85AF2AC8A221009680C6 /* MobileAcebookApp.swift */,
AE5D85B32AC8A224009680C6 /* Assets.xcassets */,
AE5D85B52AC8A224009680C6 /* Preview Content */,
AE5D85D92AC8A337009680C6 /* WelcomePageView.swift */,
185902762AD4449A0072BFE6 /* SignInView.swift */,
18755DB82AD44EA200EBD67D /* FeedView.swift */,
18755DBA2AD4509000EBD67D /* SignUpView.swift */,
C78022BF2AD5AFBF00D8A925 /* SignupPageView.swift */,
);
path = MobileAcebook;
sourceTree = "<group>";
Expand Down Expand Up @@ -146,6 +168,8 @@
isa = PBXGroup;
children = (
AE5D85E02AC9AFA9009680C6 /* AuthenticationService.swift */,
C78022B62AD5770900D8A925 /* SignupPageService.swift */,
322FA2F32AD6B21F00DB3C70 /* CreatePostPage.swift */,
);
path = Services;
sourceTree = "<group>";
Expand All @@ -162,6 +186,7 @@
isa = PBXGroup;
children = (
AE5D85E72AC9B29A009680C6 /* User.swift */,
322FA2F52AD6C83700DB3C70 /* Post.swift */,
);
path = Models;
sourceTree = "<group>";
Expand All @@ -174,6 +199,14 @@
path = Protocols;
sourceTree = "<group>";
};
C78022BC2AD5AEEA00D8A925 /* Recovered References */ = {
isa = PBXGroup;
children = (
C7D8387C2AD43DC900C4BBC1 /* SignupPageView.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -304,10 +337,17 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
322FA2F42AD6B21F00DB3C70 /* CreatePostPage.swift in Sources */,
AE5D85E12AC9AFA9009680C6 /* AuthenticationService.swift in Sources */,
C78022B72AD5770900D8A925 /* SignupPageService.swift in Sources */,
322FA2F62AD6C83700DB3C70 /* Post.swift in Sources */,
18755DB92AD44EA200EBD67D /* FeedView.swift in Sources */,
C78022C02AD5AFBF00D8A925 /* SignupPageView.swift in Sources */,
AE5D85E62AC9B077009680C6 /* AuthenticationServiceProtocol.swift in Sources */,
AE5D85B02AC8A221009680C6 /* MobileAcebookApp.swift in Sources */,
18755DBB2AD4509000EBD67D /* SignUpView.swift in Sources */,
AE5D85E82AC9B29A009680C6 /* User.swift in Sources */,
185902772AD4449A0072BFE6 /* SignInView.swift in Sources */,
AE5D85DA2AC8A337009680C6 /* WelcomePageView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -471,6 +511,7 @@
DEVELOPMENT_ASSET_PATHS = "\"MobileAcebook/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MobileAcebook/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down Expand Up @@ -499,6 +540,7 @@
DEVELOPMENT_ASSET_PATHS = "\"MobileAcebook/Preview Content\"";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = MobileAcebook/Info.plist;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
107 changes: 107 additions & 0 deletions MobileAcebook.xcodeproj/xcshareddata/xcschemes/MobileAcebook.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE5D85AB2AC8A221009680C6"
BuildableName = "MobileAcebook.app"
BlueprintName = "MobileAcebook"
ReferencedContainer = "container:MobileAcebook.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE5D85BB2AC8A224009680C6"
BuildableName = "MobileAcebookTests.xctest"
BlueprintName = "MobileAcebookTests"
ReferencedContainer = "container:MobileAcebook.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE5D85C52AC8A224009680C6"
BuildableName = "MobileAcebookUITests.xctest"
BlueprintName = "MobileAcebookUITests"
ReferencedContainer = "container:MobileAcebook.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE5D85AB2AC8A221009680C6"
BuildableName = "MobileAcebook.app"
BlueprintName = "MobileAcebook"
ReferencedContainer = "container:MobileAcebook.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-_UIConstraintBasedLayoutLogUnsatisfiable NO"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "AE5D85AB2AC8A221009680C6"
BuildableName = "MobileAcebook.app"
BlueprintName = "MobileAcebook"
ReferencedContainer = "container:MobileAcebook.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
41 changes: 41 additions & 0 deletions MobileAcebook/FeedView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// SwiftUIView.swift
// MobileAcebook
//
// Created by Alina Ermakova on 09/10/2023.
//

import SwiftUI

struct FeedView: View {

@State var postTextField: String = ""
@State var postArray: [String] = []

var body: some View {
TextField("Write a post", text: $postTextField)
.padding()
.foregroundColor(.black)
.frame(width: 303, height: 36)
.background(.white)
.cornerRadius(6)
.overlay(RoundedRectangle(cornerRadius: 6)
.inset(by: 0.5)
.stroke(Color(red: 0.16, green: 0.16, blue: 0.16).opacity(0.5), lineWidth: 1))
Button(action: {
createPost()
}, label: {
Text("Post")
})
}

func createPost() {
postArray.append(postTextField)
}
}

struct FeedView_Previews: PreviewProvider {
static var previews: some View {
FeedView()
}
}
11 changes: 11 additions & 0 deletions MobileAcebook/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
6 changes: 4 additions & 2 deletions MobileAcebook/MobileAcebookApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import SwiftUI
@main
struct MobileAcebookApp: App {
var body: some Scene {
WindowGroup {
WelcomePageView()
WindowGroup {
NavigationView {
WelcomePageView()
}
}
}
}
15 changes: 15 additions & 0 deletions MobileAcebook/Models/Post.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Post.swift
// MobileAcebook
//
// Created by Makers Admin on 11/10/2023.
//



import Foundation

public struct Post: Codable {
let message: String
let image: String
}
5 changes: 4 additions & 1 deletion MobileAcebook/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
//
// Created by Josué Estévez Fernández on 01/10/2023.
//
import Foundation

public struct User {
public struct User: Codable {
let email: String
let username: String
let password: String
let avatar: String?
}
4 changes: 4 additions & 0 deletions MobileAcebook/Protocols/AuthenticationServiceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
//

public protocol AuthenticationServiceProtocol {

typealias AuthCallback = (String?, Error?) -> Void

func signUp(user: User) -> Bool
func signIn(email: String, password: String, completion: @escaping AuthCallback)
}
Loading