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
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
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
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
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
struct Breathe: View { | |
@State var scale = false | |
@State var rotate = false | |
var body: some View { | |
ZStack { | |
Group { | |
ZStack { | |
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: -42) | |
Circle().frame(width: 80, height: 80).foregroundColor(Color(UIColor.systemBlue)).offset(y: 42) |
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 { | |
ScrollView { | |
HStack { | |
VStack (alignment: .leading) { | |
Text("TUESDAY, MAY 12").foregroundColor(.secondary).bold().font(.footnote) |
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
func scheduleNotifications() { | |
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, error in | |
if success { | |
print("Success") | |
//To add badgeNumber | |
//UIApplication.shared.applicationIconBadgeNumber = badgeNumber (Integer Value) | |
} else if let error = error { | |
print(error.localizedDescription) | |
} |