Skip to content

Commit

Permalink
Merge pull request #1 from NawafSwe/nawaf
Browse files Browse the repository at this point in the history
Nawaf
  • Loading branch information
NawafSwe authored Nov 29, 2020
2 parents 56f7d53 + d758565 commit babe9fd
Show file tree
Hide file tree
Showing 3,939 changed files with 996,744 additions and 20 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
178 changes: 178 additions & 0 deletions Billing-Tracker.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>Billing-Tracker.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>20</integer>
</dict>
</dict>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions Billing-Tracker.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
16 changes: 16 additions & 0 deletions Billing-Tracker.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "Lottie",
"repositoryURL": "https://github.com/airbnb/lottie-ios.git",
"state": {
"branch": null,
"revision": "e02e82c7c1b472e85e641a7624e99c855e21add1",
"version": "3.1.9"
}
}
]
},
"version": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "E6BD38D5-4A7F-44A0-BD38-78C6868A0C8E"
type = "0"
version = "2.0">
</Bucket>
30 changes: 27 additions & 3 deletions Billing-Tracker/Billing_TrackerApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,38 @@
//

import SwiftUI

import Firebase
import UIKit
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
print("Billing-Tracker application is starting up. ApplicationDelegate didFinishLaunchingWithOptions.")
return true
}
}
@main
struct Billing_TrackerApp: App {


/// using the core data across all the application
let context = DataStore.shared.context
/// let context = DataStore.shared.context
/// configuring firebase app
// This approach works well for Firebase SDKs such as Cloud Firestore and Crashlytics.
// For other Firebase SDKs, such as Firebase Cloud Messaging, this is not sufficient, as they use method swizzling to hook into the application life cycle. This mechanism allows frameworks to intercept calls to specific methods and handle them before passing the call on to your application.
// In this case, you need to use the @UIApplicationDelegateAdaptor property wrapper to connect your app to an instance of AppDelegate.
init(){
FirebaseApp.configure()
/// making sure db is works fine
let db = Firestore.firestore()
print(db)

}
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
var body: some Scene {
// let session = UserAuthenticationManager()
WindowGroup {
HomeTabView().environment(\.managedObjectContext, context)
LandingView()
}

}
}
36 changes: 36 additions & 0 deletions Billing-Tracker/GoogleService-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?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>CLIENT_ID</key>
<string>716818199476-pov9uc26kh7v3040mmis79tj0bnagba4.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.716818199476-pov9uc26kh7v3040mmis79tj0bnagba4</string>
<key>API_KEY</key>
<string>AIzaSyCfqwXNRPuUFfogeSFDEiwW-4QTvFJNkDw</string>
<key>GCM_SENDER_ID</key>
<string>716818199476</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.nawaf.Billing-Tracker</string>
<key>PROJECT_ID</key>
<string>billing-tracker-bfee4</string>
<key>STORAGE_BUCKET</key>
<string>billing-tracker-bfee4.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:716818199476:ios:b5e04d0beff57708cbb8e1</string>
<key>DATABASE_URL</key>
<string>https://billing-tracker-bfee4.firebaseio.com</string>
</dict>
</plist>
13 changes: 12 additions & 1 deletion Billing-Tracker/Models/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,15 @@
//

import Foundation
final class user: ObservableObject{ }
struct User: Codable{
var uid: String
var email: String?
var displayName: String?

init(uid: String, displayName: String?, email: String?) {
self.uid = uid
self.email = email
self.displayName = displayName
}

}
8 changes: 5 additions & 3 deletions Billing-Tracker/Screens/HomeTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
import SwiftUI

struct HomeTabView: View {
@ObservedObject var userService = UserAuthenticationManager.shared
var body: some View {

TabView{
SubscriptionListView().tabItem {
Image(systemName: Icons.SFCreditcard)
.resizable()
.frame(width:20, height: 20)
.scaledToFit()
Text("Subscriptions")


}

Expand All @@ -27,6 +28,7 @@ struct HomeTabView: View {
.scaledToFit()
Text("Subscription Timings")
}

SettingView().tabItem {
Image(systemName: Icons.SFgearshape)
.resizable()
Expand All @@ -37,13 +39,13 @@ struct HomeTabView: View {
}
.tabViewStyle(DefaultTabViewStyle())
.accentColor(.tabItem)


}
}


struct HomeTabView_Previews: PreviewProvider {
static var previews: some View {
HomeTabView()
}
}

10 changes: 10 additions & 0 deletions Billing-Tracker/Screens/LandView/LandingViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// LandingViewModel.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import Foundation
import SwiftUI
final class LandingViewModel : ObservableObject{ }
20 changes: 20 additions & 0 deletions Billing-Tracker/Screens/LandingView/LandingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// LandingView.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import SwiftUI

struct LandingView: View {
var body: some View {
Text("Hello, World!")
}
}

struct LandingView_Previews: PreviewProvider {
static var previews: some View {
LandingView()
}
}
44 changes: 44 additions & 0 deletions Billing-Tracker/Screens/LoginView/LoginView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// LoginView.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import SwiftUI

struct LoginView: View {
@State var email = ""
@State var password = ""
var body: some View {
VStack(spacing: 30){
Text("Welcome")
.font(.title)
TextField("Email", text: $email)
.textFieldStyle(RoundedBorderTextFieldStyle())
.background(Color.white)


TextField("Password",text: $password)
.textFieldStyle(RoundedBorderTextFieldStyle())
.background(Color.white)



Button(action:{}){
Text("Login")
}
}
.padding()
.frame(width: 320, height: 300)
.background(Color.backgroundCell)
.clipShape(RoundedRectangle(cornerRadius: 25))
.shadow(radius: 3)
}
}

struct LoginView_Previews: PreviewProvider {
static var previews: some View {
LoginView()
}
}
8 changes: 8 additions & 0 deletions Billing-Tracker/Screens/LoginView/LoginViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// LoginViewModel.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import Foundation
44 changes: 44 additions & 0 deletions Billing-Tracker/Screens/LoginViews/BothView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// BothView.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import SwiftUI

struct BothView: View {
@State var loginPressed = false
@State var registerPressed = false
@EnvironmentObject var session:UserAuthenticationManager
var body: some View {
Group {
if self.session.session == nil {
VStack{
Button(action:{self.loginPressed.toggle()}){
Text("Login")
}
.sheet(isPresented: $loginPressed) {
LoginView().environmentObject(session)
}

Button(action:{self.registerPressed.toggle()}){
Text("Register")
}
.sheet(isPresented: $registerPressed) {
RegisterView(viewModel:RegisterViewModel(session: session ))
}
}
}else{
HomeTabView().environmentObject(session)
}

}
}
}

struct BothView_Previews: PreviewProvider {
static var previews: some View {
BothView().environmentObject(UserAuthenticationManager())
}
}
42 changes: 42 additions & 0 deletions Billing-Tracker/Screens/LoginViews/LandingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// LandingView.swift
// Billing-Tracker
//
// Created by Nawaf B Al sharqi on 29/11/2020.
//

import SwiftUI
import Firebase


struct LandingView: View {
@ObservedObject var session = UserAuthenticationManager.shared
@State var isLoading = false

var body: some View {
ZStack {
Group{
if session.authState == .signOut {
RegisterView()
}else{
HomeTabView()
}

}
LoadingView(isLoading:$isLoading)
}
.onAppear{
self.isLoading = true
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5){
self.isLoading = false
session.listen()

}
}
}
}
struct LandingView_Previews: PreviewProvider {
static var previews: some View {
LandingView()
}
}
Loading

0 comments on commit babe9fd

Please sign in to comment.