This file contains hidden or 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
final class SignInWithAppleCoordinator: NSObject { | |
func getApppleRequest() { | |
let appleIdProvider = ASAuthorizationAppleIDProvider() | |
let request = appleIdProvider.createRequest() | |
request.requestedScopes = [.fullName, .email] | |
let authController = ASAuthorizationController(authorizationRequests: [request]) | |
authController.delegate = self | |
authController.performRequests() | |
} |
This file contains hidden or 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
final class AppleViewModel: ObservableObject { | |
var signInWithApple = SignInWithAppleCoordinator() | |
@Published var user: User? | |
func getRequest() { | |
signInWithApple.getApppleRequest() | |
} | |
func getUserInfo() { |
This file contains hidden or 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 Login: View { | |
@ObservedObject var appleView = AppleViewModel() | |
var body: some View { | |
VStack { | |
if appleView.user != nil { | |
//User Logged In | |
} else { | |
Button(action: { | |
self.appleView.getRequest() | |
}){ |
This file contains hidden or 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 SwiftUI | |
import PlaygroundSupport | |
struct Screen: View { | |
init() { | |
UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: UIColor.systemBlue] | |
UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor.systemBlue] | |
} | |
@State var tasks = ["Meal Prep", "Call Family", "Do Laundry"] | |
var body: some View { |
This file contains hidden or 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 SwiftUI | |
struct Tinder: View { | |
var body: some View { | |
ZStack { | |
Color.init(red: 242/255, green: 242/255, blue: 242/255).edgesIgnoringSafeArea(.all) | |
VStack { | |
HStack { | |
Image(systemName: "person.fill").resizable().frame(width: 35, height: 35).foregroundColor(.gray) | |
Spacer() |
This file contains hidden or 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
// | |
// LandingPage.swift | |
// Swiftlycode | |
// | |
// Created by Navdeep Singh on 5/19/20. | |
// Copyright © 2020 Navdeep Singh. All rights reserved. | |
// | |
import SwiftUI |
This file contains hidden or 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
Network.shared.apollo.perform(mutation: CreatePersonMutation(input: personInput)) { result in | |
switch result { | |
case .success(let graphQLResult): | |
print(graphQLResult) | |
case .failure(let error): | |
print("Failure! Error: \(error)") | |
} | |
} |
This file contains hidden or 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
Network.shared.apollo.fetch(query: ListPersonQuery) { result in | |
switch result { | |
case .success(let graphQLResult): | |
if let items = graphQLResult.data?.listPerson?.items { | |
for conf in items { | |
if let curPerson = conf { | |
//Do whatever here with your Graphql Result | |
print(curPerson) | |
} | |
} |
This file contains hidden or 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 SwiftUI | |
import PlaygroundSupport | |
struct Screen: View { | |
var body: some View { | |
NavigationView { | |
VStack { | |
ScrollView (.vertical, showsIndicators: false) { | |
SearchBar() | |
Pins() |
This file contains hidden or 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 SwiftUI | |
import PlaygroundSupport | |
struct Screen: View { | |
var body: some View { | |
VStack { | |
ChatTopView() | |
ConversationView() | |
ChatBottomBar().padding(.bottom, 10) | |
} |