This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct HomeView: View { | |
var body: some View { | |
GeometryReader { geometry in | |
VStack{ | |
HStack{ | |
Button(action: {}){ | |
Image("camera") | |
.resizable() | |
.frame(width: 30, height: 30) | |
}.padding() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PreviewViewTop: View { | |
var body: some View { | |
HStack{ | |
VStack { | |
Image("logo-social") | |
.resizable() | |
.frame(width: 60, height: 60) | |
.clipShape(Circle()) | |
.shadow(radius: 3) | |
.overlay(Circle().stroke(Color.pink, lineWidth: 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GeometryReader { geometry in | |
VStack{ | |
HStack{ | |
Button(action: {}){ | |
Image("camera") | |
.resizable() | |
.frame(width: 30, height: 30) | |
}.padding() | |
Text("Back4Gram") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Perform the SignUpUser mutation, passing the parameters we just got from our TextFields | |
apollo.perform(mutation: SignUpUserMutation(username: self.username, password: self.password, email: self.email)){ result in | |
// Let's switch the result so we can separate a successful one from an error | |
switch result { | |
// In case of success | |
case .success(let graphQLResult): | |
// We try to parse our result | |
if let objId = graphQLResult.data?.users?.signUp.objectId { | |
print ("User created with ObjectId: " + objId) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Apollo | |
// Apollo Client initialization. | |
// More about it here: https://www.back4app.com/docs/ios/swift-graphql | |
let apollo: ApolloClient = { | |
let configuration = URLSessionConfiguration.default | |
configuration.httpAdditionalHeaders = [ | |
"X-Parse-Application-Id": "YourAppIdHere", | |
"X-Parse-Client-Key": "YourClientKeyHere" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SignUpView: View { | |
@State var username: String = "" | |
@State var password: String = "" | |
@State var email: String = "" | |
let lightGreyColor = Color(red: 239.0/255.0, green: 243.0/255.0, blue: 244.0/255.0, opacity: 1.0) | |
let lightBlueColor = Color(red: 36.0/255.0, green: 158.0/255.0, blue: 235.0/255.0, opacity: 1.0) | |
var body: some View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SignUpView: View { | |
@State var username: String = "" | |
@State var password: String = "" | |
@State var email: String = "" | |
var body: some View { | |
VStack{ | |
Text("Sign Up") | |
TextField("Username", text: $username) | |
SecureField("Password", text: $password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SignUpView: View { | |
var body: some View { | |
VStack{ | |
Text("Sign Up") | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ContentView: View { | |
var body: some View { | |
SignUpView() | |
} | |
} |