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

Sign up logic #45

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f588bb2
Testing branch creation and pushing via Xcode.
bogdans13 Apr 16, 2024
d5f2c31
First commit - signup function added to AuthenticationService.swift.…
Maria-Basia Apr 16, 2024
0355fb0
login page created
ttyhktup Apr 16, 2024
2c481f3
added post model, aand also changed the welcome page
Jessicacktodd Apr 16, 2024
32e21a9
.DS_Store file added to .gitignore file
Maria-Basia Apr 16, 2024
1f17a2f
deleted .DS_Store file and removed not needed comments
Maria-Basia Apr 16, 2024
787e452
removed DS_Store added DS_Store to gitignore to avoid future pushes
George-Paul-1 Apr 16, 2024
5085729
Merge branch 'main' into services_authentication
Maria-Basia Apr 16, 2024
490ce94
playing around with button sizes
Jessicacktodd Apr 16, 2024
aedc0a1
Merge pull request #2 from bogdans13/services_authentication
ttyhktup Apr 16, 2024
9782224
commit it all
ttyhktup Apr 16, 2024
8cacb5f
DSSTOREREMOVED
ttyhktup Apr 16, 2024
c52738b
deleted DS_Store
Jessicacktodd Apr 16, 2024
3c9935d
Merge pull request #3 from bogdans13/create_login
ttyhktup Apr 16, 2024
1169c1e
got rid of merge conflicts
Jessicacktodd Apr 16, 2024
8cd3aa4
Merge pull request #4 from bogdans13/postModel
Jessicacktodd Apr 16, 2024
e7ed366
let's try
ttyhktup Apr 16, 2024
d66635f
Merge pull request #6 from bogdans13/create_login
ttyhktup Apr 16, 2024
0a2b056
login and signup style
ttyhktup Apr 17, 2024
6eb5044
first logic changes
ohmygois Apr 17, 2024
527317a
Merge branch 'create_login' of https://github.com/bogdans13/swiftui-e…
ohmygois Apr 17, 2024
9219017
signup page final
ttyhktup Apr 17, 2024
ba9a4f9
all pages styles alligned
ttyhktup Apr 17, 2024
336f533
Create Post Service + assign :Encodable to Post [Model]
bogdans13 Apr 17, 2024
1a1db21
changes made
ohmygois Apr 17, 2024
384f8df
changes made
ohmygois Apr 17, 2024
6989292
login function and UserLogin model added
Maria-Basia Apr 17, 2024
4b2054e
Merge pull request #7 from bogdans13/post_route
ohmygois Apr 17, 2024
12d4847
some changes
ttyhktup Apr 18, 2024
0434b60
Merge pull request #9 from bogdans13/create_login
ttyhktup Apr 18, 2024
b58c034
Merge branch 'main' into authentication
ttyhktup Apr 18, 2024
f2881ec
Merge pull request #8 from bogdans13/authentication
ttyhktup Apr 18, 2024
b0486fb
welcome page links added
ttyhktup Apr 18, 2024
b8f988a
Merge pull request #10 from bogdans13/create_login
ttyhktup Apr 18, 2024
fc2b204
autocapitalization removed
ttyhktup Apr 18, 2024
fd0d0e4
Merge pull request #11 from bogdans13/create_login
ttyhktup Apr 18, 2024
95ad1e8
signup working
ttyhktup Apr 18, 2024
bddf4de
Merge pull request #12 from bogdans13/create_login
ttyhktup Apr 18, 2024
83b1f6e
changes made
ohmygois Apr 18, 2024
9e51082
Latest version
ohmygois Apr 18, 2024
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
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*.xcworkspace/xcuserdata/
DerivedData/
build/
.DS_Store

25 changes: 25 additions & 0 deletions MobileAcebook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
0F81A0C52BCE82C200AED673 /* LoginPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F81A0C42BCE82C200AED673 /* LoginPageView.swift */; };
0F81A0C72BCED6FD00AED673 /* SignUpPageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F81A0C62BCED6FD00AED673 /* SignUpPageView.swift */; };
3D9855862BCE82EF007D584D /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9855852BCE82EF007D584D /* 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 +22,11 @@
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 */; };

D6070C072BD005F5003EFBE5 /* UserLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = D6070C062BD005F5003EFBE5 /* UserLogin.swift */; };

C1615B992BCFEF2800A7AB81 /* PostService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1615B982BCFEF2800A7AB81 /* PostService.swift */; };

/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -39,6 +47,9 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
0F81A0C42BCE82C200AED673 /* LoginPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginPageView.swift; sourceTree = "<group>"; };
0F81A0C62BCED6FD00AED673 /* SignUpPageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpPageView.swift; sourceTree = "<group>"; };
3D9855852BCE82EF007D584D /* 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 +65,10 @@
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>"; };

D6070C062BD005F5003EFBE5 /* UserLogin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserLogin.swift; sourceTree = "<group>"; };
C1615B982BCFEF2800A7AB81 /* PostService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostService.swift; sourceTree = "<group>"; };

/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -111,6 +126,8 @@
AE5D85B32AC8A224009680C6 /* Assets.xcassets */,
AE5D85B52AC8A224009680C6 /* Preview Content */,
AE5D85D92AC8A337009680C6 /* WelcomePageView.swift */,
0F81A0C42BCE82C200AED673 /* LoginPageView.swift */,
0F81A0C62BCED6FD00AED673 /* SignUpPageView.swift */,
);
path = MobileAcebook;
sourceTree = "<group>";
Expand Down Expand Up @@ -146,6 +163,7 @@
isa = PBXGroup;
children = (
AE5D85E02AC9AFA9009680C6 /* AuthenticationService.swift */,
C1615B982BCFEF2800A7AB81 /* PostService.swift */,
);
path = Services;
sourceTree = "<group>";
Expand All @@ -162,6 +180,8 @@
isa = PBXGroup;
children = (
AE5D85E72AC9B29A009680C6 /* User.swift */,
3D9855852BCE82EF007D584D /* Post.swift */,
D6070C062BD005F5003EFBE5 /* UserLogin.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -306,9 +326,14 @@
files = (
AE5D85E12AC9AFA9009680C6 /* AuthenticationService.swift in Sources */,
AE5D85E62AC9B077009680C6 /* AuthenticationServiceProtocol.swift in Sources */,
D6070C072BD005F5003EFBE5 /* UserLogin.swift in Sources */,
AE5D85B02AC8A221009680C6 /* MobileAcebookApp.swift in Sources */,
3D9855862BCE82EF007D584D /* Post.swift in Sources */,
AE5D85E82AC9B29A009680C6 /* User.swift in Sources */,
0F81A0C72BCED6FD00AED673 /* SignUpPageView.swift in Sources */,
AE5D85DA2AC8A337009680C6 /* WelcomePageView.swift in Sources */,
C1615B992BCFEF2800A7AB81 /* PostService.swift in Sources */,
0F81A0C52BCE82C200AED673 /* LoginPageView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
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>
102 changes: 102 additions & 0 deletions MobileAcebook.xcodeproj/xcshareddata/xcschemes/MobileAcebook.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<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>
</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>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"images" : [
{
"filename" : "makers-logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "paw (1).png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions MobileAcebook/LoginPageView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
//
// WelcomePageView.swift
// MobileAcebook
//
// Created by Josué Estévez Fernández on 30/09/2023.
//

import SwiftUI

struct LoginPageView: View {
@State private var username = ""
@State private var password = ""
@State var isShowingPassword: Bool = false

var body: some View {
NavigationView {

VStack {
Spacer()
Text("Log in")
.font(.largeTitle)
.bold()
Spacer()
VStack {
Text("Username") .frame(maxWidth: 250, alignment: .topLeading)

TextField("", text: $username)
.frame(width: 250, height: 40)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray)
)
.multilineTextAlignment(.center)
.autocapitalization(. none)
.accessibilityIdentifier("loginUsername")
}.padding()
VStack {
Text("Password")
.frame(maxWidth: 250, alignment: .topLeading)
Group {
if isShowingPassword {
TextField("", text: $password)
.frame(width: 250, height: 40)
.multilineTextAlignment(.center)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray))
}else {
SecureField("", text: $password)
.frame(width: 250, height: 40)
.multilineTextAlignment(.center)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray))
}
}
.disableAutocorrection(true)
.autocapitalization(.none)

Button {
isShowingPassword.toggle()
} label: {
if isShowingPassword {
Text("Hide password")
} else {
Text("Show password")
}
}.padding()
}


Button("Submit") {
guard !username.isEmpty && !password.isEmpty else { return }
}
.frame(width: 250, height: 40)
.background(Color(red: 0x50/255, green: 0xB7/255, blue: 0xB7/255))
.foregroundColor(.white)
.cornerRadius(10)
.padding()

Spacer()
Spacer()
Spacer()
HStack(spacing:3){
Text("Don't have an account?")
NavigationLink(destination: SignUpPageView()){
Text("Sign up here")
.fontWeight(.bold)
}

//add navigation to login
}
.padding()
}

}
}
}

struct LoginPageView_Previews: PreviewProvider {
static var previews: some View {
LoginPageView()
}
}
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 Jess Todd on 16/04/2024.
//

import Foundation

public struct Post: Encodable {
let message: String
let date: String
let user: String
let profilePicture: String
}
8 changes: 6 additions & 2 deletions MobileAcebook/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
// Created by Josué Estévez Fernández on 01/10/2023.
//

public struct User {
let username: String


public struct User: Encodable {
let imgUrl: String
let email: String
let password: String
let username: String
}
13 changes: 13 additions & 0 deletions MobileAcebook/Models/UserLogin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// UserLogin.swift
// MobileAcebook
//
// Created by Maria Basia on 17/04/2024.
//

import Foundation

struct UserLogin: Encodable {
let email: String
let password: String
}
Loading