diff --git a/smartClass.xcodeproj/project.pbxproj b/smartClass.xcodeproj/project.pbxproj index 16ead9d..2cdb514 100644 --- a/smartClass.xcodeproj/project.pbxproj +++ b/smartClass.xcodeproj/project.pbxproj @@ -7,6 +7,13 @@ objects = { /* Begin PBXBuildFile section */ + 7DB230EE2A476162003EE6D5 /* UserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DB230ED2A476162003EE6D5 /* UserModel.swift */; }; + 7DB230F12A484450003EE6D5 /* FirebaseFirestoreSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 7DB230F02A484450003EE6D5 /* FirebaseFirestoreSwift */; }; + A86CA1482A404025006C3DC8 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A86CA1472A404025006C3DC8 /* GoogleService-Info.plist */; }; + A86CA14B2A404069006C3DC8 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = A86CA14A2A404069006C3DC8 /* FirebaseAuth */; }; + A86CA14D2A404069006C3DC8 /* FirebaseFirestore in Frameworks */ = {isa = PBXBuildFile; productRef = A86CA14C2A404069006C3DC8 /* FirebaseFirestore */; }; + A86CA14F2A404069006C3DC8 /* FirebaseStorage in Frameworks */ = {isa = PBXBuildFile; productRef = A86CA14E2A404069006C3DC8 /* FirebaseStorage */; }; + A86CA1512A404108006C3DC8 /* FirebaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A86CA1502A404108006C3DC8 /* FirebaseManager.swift */; }; A8700DF32A1DDAD500D60253 /* smartClassApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700DF22A1DDAD500D60253 /* smartClassApp.swift */; }; A8700DF52A1DDAD500D60253 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700DF42A1DDAD500D60253 /* ContentView.swift */; }; A8700DF72A1DDAD600D60253 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A8700DF62A1DDAD600D60253 /* Assets.xcassets */; }; @@ -15,9 +22,37 @@ A8700E052A1DDC2A00D60253 /* FontManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E042A1DDC2A00D60253 /* FontManager.swift */; }; A8700E082A1DDC6100D60253 /* CustomFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E072A1DDC6100D60253 /* CustomFont.swift */; }; A8700E0B2A1DDCAD00D60253 /* View.ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8700E0A2A1DDCAD00D60253 /* View.ext.swift */; }; + A8CE4D922A2B76B600CF698A /* GreetingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D912A2B76B600CF698A /* GreetingView.swift */; }; + A8CE4D942A2B76DA00CF698A /* GreetingTwoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D932A2B76DA00CF698A /* GreetingTwoView.swift */; }; + A8CE4D962A2B76FB00CF698A /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D952A2B76FB00CF698A /* LoginView.swift */; }; + A8CE4D992A2B773F00CF698A /* TextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D982A2B773F00CF698A /* TextFieldView.swift */; }; + A8CE4D9B2A2B77BB00CF698A /* RegistrationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D9A2A2B77BB00CF698A /* RegistrationView.swift */; }; + A8CE4D9F2A2B78D000CF698A /* StudentAppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4D9E2A2B78D000CF698A /* StudentAppView.swift */; }; + A8CE4DA22A2B7E5B00CF698A /* TabBarModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DA12A2B7E5B00CF698A /* TabBarModel.swift */; }; + A8CE4DA52A2B7EB800CF698A /* Icons.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DA42A2B7EB800CF698A /* Icons.swift */; }; + A8CE4DA72A2B7FDA00CF698A /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DA62A2B7FDA00CF698A /* Colors.swift */; }; + A8CE4DAA2A2CCC7100CF698A /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DA92A2CCC7100CF698A /* ProfileView.swift */; }; + A8CE4DAC2A2CCD1100CF698A /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DAB2A2CCD1100CF698A /* SettingView.swift */; }; + A8CE4DAE2A2CCD9E00CF698A /* SettingTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DAD2A2CCD9E00CF698A /* SettingTextFieldView.swift */; }; + A8CE4DB12A2CCDF600CF698A /* ButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DB02A2CCDF600CF698A /* ButtonView.swift */; }; + A8CE4DB32A2CCE3700CF698A /* LessonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DB22A2CCE3700CF698A /* LessonView.swift */; }; + A8CE4DB62A2DCF3A00CF698A /* MessagesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DB52A2DCF3A00CF698A /* MessagesView.swift */; }; + A8CE4DB82A2DCF5700CF698A /* MessageItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DB72A2DCF5700CF698A /* MessageItemView.swift */; }; + A8CE4DBC2A2DCF9000CF698A /* MessageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DBB2A2DCF9000CF698A /* MessageModel.swift */; }; + A8CE4DC12A2DD1AB00CF698A /* CalendarTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DC02A2DD1AB00CF698A /* CalendarTabView.swift */; }; + A8CE4DC32A2DD1D500CF698A /* TimetableCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DC22A2DD1D500CF698A /* TimetableCard.swift */; }; + A8CE4DC52A2DD1ED00CF698A /* TimetableCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DC42A2DD1ED00CF698A /* TimetableCardView.swift */; }; + A8CE4DC82A2DD76100CF698A /* CalendarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DC72A2DD76100CF698A /* CalendarView.swift */; }; + A8CE4DCA2A2DD79400CF698A /* CalendarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DC92A2DD79400CF698A /* CalendarViewModel.swift */; }; + A8CE4DCC2A2DD80400CF698A /* Date.ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DCB2A2DD80300CF698A /* Date.ext.swift */; }; + A8CE4DCF2A2DD85E00CF698A /* Color.ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DCE2A2DD85E00CF698A /* Color.ext.swift */; }; + A8CE4DD12A2DDFE900CF698A /* AppViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8CE4DD02A2DDFE900CF698A /* AppViewModel.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 7DB230ED2A476162003EE6D5 /* UserModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserModel.swift; sourceTree = ""; }; + A86CA1472A404025006C3DC8 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; + A86CA1502A404108006C3DC8 /* FirebaseManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseManager.swift; sourceTree = ""; }; A8700DEF2A1DDAD500D60253 /* smartClass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = smartClass.app; sourceTree = BUILT_PRODUCTS_DIR; }; A8700DF22A1DDAD500D60253 /* smartClassApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = smartClassApp.swift; sourceTree = ""; }; A8700DF42A1DDAD500D60253 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; @@ -28,6 +63,31 @@ A8700E042A1DDC2A00D60253 /* FontManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FontManager.swift; sourceTree = ""; }; A8700E072A1DDC6100D60253 /* CustomFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomFont.swift; sourceTree = ""; }; A8700E0A2A1DDCAD00D60253 /* View.ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = View.ext.swift; sourceTree = ""; }; + A8CE4D912A2B76B600CF698A /* GreetingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingView.swift; sourceTree = ""; }; + A8CE4D932A2B76DA00CF698A /* GreetingTwoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GreetingTwoView.swift; sourceTree = ""; }; + A8CE4D952A2B76FB00CF698A /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = ""; }; + A8CE4D982A2B773F00CF698A /* TextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldView.swift; sourceTree = ""; }; + A8CE4D9A2A2B77BB00CF698A /* RegistrationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationView.swift; sourceTree = ""; }; + A8CE4D9E2A2B78D000CF698A /* StudentAppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StudentAppView.swift; sourceTree = ""; }; + A8CE4DA12A2B7E5B00CF698A /* TabBarModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarModel.swift; sourceTree = ""; }; + A8CE4DA42A2B7EB800CF698A /* Icons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icons.swift; sourceTree = ""; }; + A8CE4DA62A2B7FDA00CF698A /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = ""; }; + A8CE4DA92A2CCC7100CF698A /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = ""; }; + A8CE4DAB2A2CCD1100CF698A /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = ""; }; + A8CE4DAD2A2CCD9E00CF698A /* SettingTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTextFieldView.swift; sourceTree = ""; }; + A8CE4DB02A2CCDF600CF698A /* ButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonView.swift; sourceTree = ""; }; + A8CE4DB22A2CCE3700CF698A /* LessonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LessonView.swift; sourceTree = ""; }; + A8CE4DB52A2DCF3A00CF698A /* MessagesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesView.swift; sourceTree = ""; }; + A8CE4DB72A2DCF5700CF698A /* MessageItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageItemView.swift; sourceTree = ""; }; + A8CE4DBB2A2DCF9000CF698A /* MessageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageModel.swift; sourceTree = ""; }; + A8CE4DC02A2DD1AB00CF698A /* CalendarTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarTabView.swift; sourceTree = ""; }; + A8CE4DC22A2DD1D500CF698A /* TimetableCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimetableCard.swift; sourceTree = ""; }; + A8CE4DC42A2DD1ED00CF698A /* TimetableCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimetableCardView.swift; sourceTree = ""; }; + A8CE4DC72A2DD76100CF698A /* CalendarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarView.swift; sourceTree = ""; }; + A8CE4DC92A2DD79400CF698A /* CalendarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewModel.swift; sourceTree = ""; }; + A8CE4DCB2A2DD80300CF698A /* Date.ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Date.ext.swift; sourceTree = ""; }; + A8CE4DCE2A2DD85E00CF698A /* Color.ext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.ext.swift; sourceTree = ""; }; + A8CE4DD02A2DDFE900CF698A /* AppViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppViewModel.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -35,17 +95,29 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A86CA14B2A404069006C3DC8 /* FirebaseAuth in Frameworks */, + A86CA14D2A404069006C3DC8 /* FirebaseFirestore in Frameworks */, + A86CA14F2A404069006C3DC8 /* FirebaseStorage in Frameworks */, + 7DB230F12A484450003EE6D5 /* FirebaseFirestoreSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 7DB230EF2A48444F003EE6D5 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; A8700DE62A1DDAD500D60253 = { isa = PBXGroup; children = ( A8700DF12A1DDAD500D60253 /* smartClass */, A8700DF02A1DDAD500D60253 /* Products */, + 7DB230EF2A48444F003EE6D5 /* Frameworks */, ); sourceTree = ""; }; @@ -60,12 +132,16 @@ A8700DF12A1DDAD500D60253 /* smartClass */ = { isa = PBXGroup; children = ( - A8700E092A1DDC9D00D60253 /* Extension */, + A8CE4DA32A2B7EA700CF698A /* Resources */, A8700E062A1DDC4900D60253 /* Modifiers */, - A8700E032A1DDBFC00D60253 /* Info.plist */, + A8700E092A1DDC9D00D60253 /* Extension */, A8700E002A1DDB6B00D60253 /* Fonts */, + A8CE4D712A2B71E900CF698A /* ViewModel */, + A8CE4D702A2B71E500CF698A /* View */, + A8CE4D6F2A2B71D500CF698A /* Model */, + A8700E032A1DDBFC00D60253 /* Info.plist */, + A86CA1472A404025006C3DC8 /* GoogleService-Info.plist */, A8700DF22A1DDAD500D60253 /* smartClassApp.swift */, - A8700DF42A1DDAD500D60253 /* ContentView.swift */, A8700DF62A1DDAD600D60253 /* Assets.xcassets */, A8700DF82A1DDAD600D60253 /* Preview Content */, ); @@ -101,10 +177,162 @@ isa = PBXGroup; children = ( A8700E0A2A1DDCAD00D60253 /* View.ext.swift */, + A8CE4DCB2A2DD80300CF698A /* Date.ext.swift */, + A8CE4DCE2A2DD85E00CF698A /* Color.ext.swift */, ); path = Extension; sourceTree = ""; }; + A8CE4D6F2A2B71D500CF698A /* Model */ = { + isa = PBXGroup; + children = ( + 7DB230ED2A476162003EE6D5 /* UserModel.swift */, + A8CE4DB92A2DCF8000CF698A /* Messages */, + A8CE4DA02A2B7E4200CF698A /* TabBar */, + ); + path = Model; + sourceTree = ""; + }; + A8CE4D702A2B71E500CF698A /* View */ = { + isa = PBXGroup; + children = ( + A8700DF42A1DDAD500D60253 /* ContentView.swift */, + A8CE4DAF2A2CCDE700CF698A /* Parts */, + A8CE4D732A2B721300CF698A /* Login */, + A8CE4D722A2B720F00CF698A /* App */, + ); + path = View; + sourceTree = ""; + }; + A8CE4D712A2B71E900CF698A /* ViewModel */ = { + isa = PBXGroup; + children = ( + A8CE4DC92A2DD79400CF698A /* CalendarViewModel.swift */, + A8CE4DD02A2DDFE900CF698A /* AppViewModel.swift */, + A86CA1502A404108006C3DC8 /* FirebaseManager.swift */, + ); + path = ViewModel; + sourceTree = ""; + }; + A8CE4D722A2B720F00CF698A /* App */ = { + isa = PBXGroup; + children = ( + A8CE4D9D2A2B78B600CF698A /* Student */, + A8CE4D9C2A2B78AD00CF698A /* Admin */, + ); + path = App; + sourceTree = ""; + }; + A8CE4D732A2B721300CF698A /* Login */ = { + isa = PBXGroup; + children = ( + A8CE4D972A2B773600CF698A /* Parts */, + A8CE4D912A2B76B600CF698A /* GreetingView.swift */, + A8CE4D932A2B76DA00CF698A /* GreetingTwoView.swift */, + A8CE4D952A2B76FB00CF698A /* LoginView.swift */, + A8CE4D9A2A2B77BB00CF698A /* RegistrationView.swift */, + ); + path = Login; + sourceTree = ""; + }; + A8CE4D972A2B773600CF698A /* Parts */ = { + isa = PBXGroup; + children = ( + A8CE4D982A2B773F00CF698A /* TextFieldView.swift */, + ); + path = Parts; + sourceTree = ""; + }; + A8CE4D9C2A2B78AD00CF698A /* Admin */ = { + isa = PBXGroup; + children = ( + ); + path = Admin; + sourceTree = ""; + }; + A8CE4D9D2A2B78B600CF698A /* Student */ = { + isa = PBXGroup; + children = ( + A8CE4DBD2A2DD18200CF698A /* Calendar */, + A8CE4DB42A2DCEF000CF698A /* Messages */, + A8CE4DA82A2CCC5B00CF698A /* Profile */, + A8CE4D9E2A2B78D000CF698A /* StudentAppView.swift */, + ); + path = Student; + sourceTree = ""; + }; + A8CE4DA02A2B7E4200CF698A /* TabBar */ = { + isa = PBXGroup; + children = ( + A8CE4DA12A2B7E5B00CF698A /* TabBarModel.swift */, + ); + path = TabBar; + sourceTree = ""; + }; + A8CE4DA32A2B7EA700CF698A /* Resources */ = { + isa = PBXGroup; + children = ( + A8CE4DA42A2B7EB800CF698A /* Icons.swift */, + A8CE4DA62A2B7FDA00CF698A /* Colors.swift */, + ); + path = Resources; + sourceTree = ""; + }; + A8CE4DA82A2CCC5B00CF698A /* Profile */ = { + isa = PBXGroup; + children = ( + A8CE4DA92A2CCC7100CF698A /* ProfileView.swift */, + A8CE4DAB2A2CCD1100CF698A /* SettingView.swift */, + A8CE4DAD2A2CCD9E00CF698A /* SettingTextFieldView.swift */, + A8CE4DB22A2CCE3700CF698A /* LessonView.swift */, + ); + path = Profile; + sourceTree = ""; + }; + A8CE4DAF2A2CCDE700CF698A /* Parts */ = { + isa = PBXGroup; + children = ( + A8CE4DB02A2CCDF600CF698A /* ButtonView.swift */, + ); + path = Parts; + sourceTree = ""; + }; + A8CE4DB42A2DCEF000CF698A /* Messages */ = { + isa = PBXGroup; + children = ( + A8CE4DB52A2DCF3A00CF698A /* MessagesView.swift */, + A8CE4DB72A2DCF5700CF698A /* MessageItemView.swift */, + ); + path = Messages; + sourceTree = ""; + }; + A8CE4DB92A2DCF8000CF698A /* Messages */ = { + isa = PBXGroup; + children = ( + A8CE4DBB2A2DCF9000CF698A /* MessageModel.swift */, + ); + path = Messages; + sourceTree = ""; + }; + A8CE4DBD2A2DD18200CF698A /* Calendar */ = { + isa = PBXGroup; + children = ( + A8CE4DC62A2DD73D00CF698A /* Calendar View */, + A8CE4DC02A2DD1AB00CF698A /* CalendarTabView.swift */, + A8CE4DC22A2DD1D500CF698A /* TimetableCard.swift */, + A8CE4DC42A2DD1ED00CF698A /* TimetableCardView.swift */, + ); + path = Calendar; + sourceTree = ""; + }; + A8CE4DC62A2DD73D00CF698A /* Calendar View */ = { + isa = PBXGroup; + children = ( + A8CE4DC72A2DD76100CF698A /* CalendarView.swift */, + ); + path = "Calendar View"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -121,6 +349,12 @@ dependencies = ( ); name = smartClass; + packageProductDependencies = ( + A86CA14A2A404069006C3DC8 /* FirebaseAuth */, + A86CA14C2A404069006C3DC8 /* FirebaseFirestore */, + A86CA14E2A404069006C3DC8 /* FirebaseStorage */, + 7DB230F02A484450003EE6D5 /* FirebaseFirestoreSwift */, + ); productName = smartClass; productReference = A8700DEF2A1DDAD500D60253 /* smartClass.app */; productType = "com.apple.product-type.application"; @@ -149,6 +383,9 @@ Base, ); mainGroup = A8700DE62A1DDAD500D60253; + packageReferences = ( + A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, + ); productRefGroup = A8700DF02A1DDAD500D60253 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -164,6 +401,7 @@ buildActionMask = 2147483647; files = ( A8700DFA2A1DDAD600D60253 /* Preview Assets.xcassets in Resources */, + A86CA1482A404025006C3DC8 /* GoogleService-Info.plist in Resources */, A8700E022A1DDBD400D60253 /* Nunito-VariableFont.ttf in Resources */, A8700DF72A1DDAD600D60253 /* Assets.xcassets in Resources */, ); @@ -176,11 +414,38 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A8CE4DB62A2DCF3A00CF698A /* MessagesView.swift in Sources */, + A8CE4DA52A2B7EB800CF698A /* Icons.swift in Sources */, + A8CE4DC12A2DD1AB00CF698A /* CalendarTabView.swift in Sources */, A8700DF52A1DDAD500D60253 /* ContentView.swift in Sources */, + A8CE4DB32A2CCE3700CF698A /* LessonView.swift in Sources */, + A8CE4DCF2A2DD85E00CF698A /* Color.ext.swift in Sources */, + A8CE4DB82A2DCF5700CF698A /* MessageItemView.swift in Sources */, + A8CE4DC82A2DD76100CF698A /* CalendarView.swift in Sources */, + A8CE4D922A2B76B600CF698A /* GreetingView.swift in Sources */, + A86CA1512A404108006C3DC8 /* FirebaseManager.swift in Sources */, + A8CE4DA72A2B7FDA00CF698A /* Colors.swift in Sources */, A8700E082A1DDC6100D60253 /* CustomFont.swift in Sources */, + A8CE4DAC2A2CCD1100CF698A /* SettingView.swift in Sources */, A8700E052A1DDC2A00D60253 /* FontManager.swift in Sources */, A8700DF32A1DDAD500D60253 /* smartClassApp.swift in Sources */, + A8CE4DC52A2DD1ED00CF698A /* TimetableCardView.swift in Sources */, + A8CE4DB12A2CCDF600CF698A /* ButtonView.swift in Sources */, + A8CE4DAA2A2CCC7100CF698A /* ProfileView.swift in Sources */, + A8CE4D9F2A2B78D000CF698A /* StudentAppView.swift in Sources */, A8700E0B2A1DDCAD00D60253 /* View.ext.swift in Sources */, + A8CE4DCC2A2DD80400CF698A /* Date.ext.swift in Sources */, + A8CE4DD12A2DDFE900CF698A /* AppViewModel.swift in Sources */, + A8CE4D962A2B76FB00CF698A /* LoginView.swift in Sources */, + A8CE4D942A2B76DA00CF698A /* GreetingTwoView.swift in Sources */, + A8CE4DA22A2B7E5B00CF698A /* TabBarModel.swift in Sources */, + A8CE4D992A2B773F00CF698A /* TextFieldView.swift in Sources */, + 7DB230EE2A476162003EE6D5 /* UserModel.swift in Sources */, + A8CE4DBC2A2DCF9000CF698A /* MessageModel.swift in Sources */, + A8CE4D9B2A2B77BB00CF698A /* RegistrationView.swift in Sources */, + A8CE4DCA2A2DD79400CF698A /* CalendarViewModel.swift in Sources */, + A8CE4DAE2A2CCD9E00CF698A /* SettingTextFieldView.swift in Sources */, + A8CE4DC32A2DD1D500CF698A /* TimetableCard.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -391,6 +656,40 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; + requirement = { + branch = master; + kind = branch; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 7DB230F02A484450003EE6D5 /* FirebaseFirestoreSwift */ = { + isa = XCSwiftPackageProductDependency; + package = A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseFirestoreSwift; + }; + A86CA14A2A404069006C3DC8 /* FirebaseAuth */ = { + isa = XCSwiftPackageProductDependency; + package = A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseAuth; + }; + A86CA14C2A404069006C3DC8 /* FirebaseFirestore */ = { + isa = XCSwiftPackageProductDependency; + package = A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseFirestore; + }; + A86CA14E2A404069006C3DC8 /* FirebaseStorage */ = { + isa = XCSwiftPackageProductDependency; + package = A86CA1492A404069006C3DC8 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseStorage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = A8700DE72A1DDAD500D60253 /* Project object */; } diff --git a/smartClass.xcodeproj/project.xcworkspace/xcuserdata/idevnva.xcuserdatad/UserInterfaceState.xcuserstate b/smartClass.xcodeproj/project.xcworkspace/xcuserdata/idevnva.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..50f6d4f Binary files /dev/null and b/smartClass.xcodeproj/project.xcworkspace/xcuserdata/idevnva.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/smartClass.xcodeproj/xcuserdata/ibatyrgereev.xcuserdatad/xcschemes/xcschememanagement.plist b/smartClass.xcodeproj/xcuserdata/ibatyrgereev.xcuserdatad/xcschemes/xcschememanagement.plist index 9b25639..753efba 100644 --- a/smartClass.xcodeproj/xcuserdata/ibatyrgereev.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/smartClass.xcodeproj/xcuserdata/ibatyrgereev.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,11 +4,32 @@ SchemeUserState - smartClass.xcscheme_^#shared#^_ + Promises (Playground) 1.xcscheme + + isShown + + orderHint + 2 + + Promises (Playground) 2.xcscheme + isShown + + orderHint + 3 + + Promises (Playground).xcscheme + + isShown + orderHint 0 + smartClass.xcscheme_^#shared#^_ + + orderHint + 1 + diff --git a/smartClass/Assets.xcassets/.DS_Store b/smartClass/Assets.xcassets/.DS_Store new file mode 100644 index 0000000..a4692d3 Binary files /dev/null and b/smartClass/Assets.xcassets/.DS_Store differ diff --git a/smartClass/Assets.xcassets/Red.colorset/Contents.json b/smartClass/Assets.xcassets/Red.colorset/Contents.json new file mode 100644 index 0000000..9edde74 --- /dev/null +++ b/smartClass/Assets.xcassets/Red.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.290", + "green" : "0.290", + "red" : "0.996" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.290", + "green" : "0.290", + "red" : "0.996" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/SecondStart.imageset/Contents.json b/smartClass/Assets.xcassets/SecondStart.imageset/Contents.json new file mode 100644 index 0000000..297eb4d --- /dev/null +++ b/smartClass/Assets.xcassets/SecondStart.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "SecondStart.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/SecondStart.imageset/SecondStart.svg b/smartClass/Assets.xcassets/SecondStart.imageset/SecondStart.svg new file mode 100644 index 0000000..08fbe06 --- /dev/null +++ b/smartClass/Assets.xcassets/SecondStart.imageset/SecondStart.svg @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smartClass/Assets.xcassets/StartScreen.imageset/Contents.json b/smartClass/Assets.xcassets/StartScreen.imageset/Contents.json new file mode 100644 index 0000000..7acc41c --- /dev/null +++ b/smartClass/Assets.xcassets/StartScreen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "StartScreen.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/StartScreen.imageset/StartScreen.svg b/smartClass/Assets.xcassets/StartScreen.imageset/StartScreen.svg new file mode 100644 index 0000000..791ced7 --- /dev/null +++ b/smartClass/Assets.xcassets/StartScreen.imageset/StartScreen.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json new file mode 100644 index 0000000..00f7d3b --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/BackgroundGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json new file mode 100644 index 0000000..d4464c6 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/BlueColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.914", + "green" : "0.424", + "red" : "0.231" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json new file mode 100644 index 0000000..0952145 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/ClassLightGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.690", + "green" : "0.690", + "red" : "0.690" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/Contents.json b/smartClass/Assets.xcassets/Timetable colors/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json b/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json new file mode 100644 index 0000000..5ab569d --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable colors/TextGrayColor.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.408", + "green" : "0.408", + "red" : "0.408" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/Contents.json b/smartClass/Assets.xcassets/Timetable icons/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json new file mode 100644 index 0000000..2f82bba --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 14.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png new file mode 100644 index 0000000..931fcac Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/arrowIconRight.imageset/image 14.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json new file mode 100644 index 0000000..b80b68c --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 16.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png new file mode 100644 index 0000000..f25a9ef Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/audienceIcon.imageset/image 16.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json new file mode 100644 index 0000000..240ed4f --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "image 15-2.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png new file mode 100644 index 0000000..bb19bc1 Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/buildingIcon.imageset/image 15-2.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json new file mode 100644 index 0000000..bed3b81 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Group 107.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png new file mode 100644 index 0000000..2aec536 Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/locationIcon.imageset/Group 107.png differ diff --git a/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json new file mode 100644 index 0000000..04f5328 --- /dev/null +++ b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "Rectangle 113.png", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png new file mode 100644 index 0000000..a4a900f Binary files /dev/null and b/smartClass/Assets.xcassets/Timetable icons/redRectangleIcon.imageset/Rectangle 113.png differ diff --git a/smartClass/Assets.xcassets/hello.imageset/Contents.json b/smartClass/Assets.xcassets/hello.imageset/Contents.json new file mode 100644 index 0000000..a1477e0 --- /dev/null +++ b/smartClass/Assets.xcassets/hello.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "hello.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/hello.imageset/hello.svg b/smartClass/Assets.xcassets/hello.imageset/hello.svg new file mode 100644 index 0000000..361b209 --- /dev/null +++ b/smartClass/Assets.xcassets/hello.imageset/hello.svg @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/smartClass/Assets.xcassets/iconCalendar.imageset/Contents.json b/smartClass/Assets.xcassets/iconCalendar.imageset/Contents.json new file mode 100644 index 0000000..733376f --- /dev/null +++ b/smartClass/Assets.xcassets/iconCalendar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconCalendar.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconCalendar.imageset/iconCalendar.png b/smartClass/Assets.xcassets/iconCalendar.imageset/iconCalendar.png new file mode 100644 index 0000000..eecc2b8 Binary files /dev/null and b/smartClass/Assets.xcassets/iconCalendar.imageset/iconCalendar.png differ diff --git a/smartClass/Assets.xcassets/iconClock.imageset/Contents.json b/smartClass/Assets.xcassets/iconClock.imageset/Contents.json new file mode 100644 index 0000000..f3077c9 --- /dev/null +++ b/smartClass/Assets.xcassets/iconClock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconClock.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconClock.imageset/iconClock.png b/smartClass/Assets.xcassets/iconClock.imageset/iconClock.png new file mode 100644 index 0000000..5e1e38b Binary files /dev/null and b/smartClass/Assets.xcassets/iconClock.imageset/iconClock.png differ diff --git a/smartClass/Assets.xcassets/iconProfile.imageset/Contents.json b/smartClass/Assets.xcassets/iconProfile.imageset/Contents.json new file mode 100644 index 0000000..d62eb6f --- /dev/null +++ b/smartClass/Assets.xcassets/iconProfile.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconProfile.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconProfile.imageset/iconProfile.png b/smartClass/Assets.xcassets/iconProfile.imageset/iconProfile.png new file mode 100644 index 0000000..34b1762 Binary files /dev/null and b/smartClass/Assets.xcassets/iconProfile.imageset/iconProfile.png differ diff --git a/smartClass/Assets.xcassets/iconTabCalendar.imageset/Contents.json b/smartClass/Assets.xcassets/iconTabCalendar.imageset/Contents.json new file mode 100644 index 0000000..aa64746 --- /dev/null +++ b/smartClass/Assets.xcassets/iconTabCalendar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconTapCalendar.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconTabCalendar.imageset/iconTapCalendar.png b/smartClass/Assets.xcassets/iconTabCalendar.imageset/iconTapCalendar.png new file mode 100644 index 0000000..c5ec5cd Binary files /dev/null and b/smartClass/Assets.xcassets/iconTabCalendar.imageset/iconTapCalendar.png differ diff --git a/smartClass/Assets.xcassets/iconTabClock.imageset/Contents.json b/smartClass/Assets.xcassets/iconTabClock.imageset/Contents.json new file mode 100644 index 0000000..3ad9a8a --- /dev/null +++ b/smartClass/Assets.xcassets/iconTabClock.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconTapClock.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconTabClock.imageset/iconTapClock.png b/smartClass/Assets.xcassets/iconTabClock.imageset/iconTapClock.png new file mode 100644 index 0000000..6cf150a Binary files /dev/null and b/smartClass/Assets.xcassets/iconTabClock.imageset/iconTapClock.png differ diff --git a/smartClass/Assets.xcassets/iconTabProfile.imageset/Contents.json b/smartClass/Assets.xcassets/iconTabProfile.imageset/Contents.json new file mode 100644 index 0000000..dba5b67 --- /dev/null +++ b/smartClass/Assets.xcassets/iconTabProfile.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "iconTapProfile.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/smartClass/Assets.xcassets/iconTabProfile.imageset/iconTapProfile.png b/smartClass/Assets.xcassets/iconTabProfile.imageset/iconTapProfile.png new file mode 100644 index 0000000..c9355a3 Binary files /dev/null and b/smartClass/Assets.xcassets/iconTabProfile.imageset/iconTapProfile.png differ diff --git a/smartClass/ContentView.swift b/smartClass/ContentView.swift deleted file mode 100644 index 9c02f9a..0000000 --- a/smartClass/ContentView.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// ContentView.swift -// smartClass -// -// Created by Ислам Батыргереев on 24.05.2023. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundColor(.accentColor) - Text("Hello, world!") - .customFont(font: FontManager.Nunito.black, size: 20) - Text("Hello, world!") - .customFont(font: FontManager.Nunito.black, size: 20) - } - .padding() - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} diff --git a/smartClass/Extension/Color.ext.swift b/smartClass/Extension/Color.ext.swift new file mode 100644 index 0000000..110bee6 --- /dev/null +++ b/smartClass/Extension/Color.ext.swift @@ -0,0 +1,19 @@ +// +// Color.ext.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +extension Color{ + + static var mBlue = Color("BlueColor") + static var mRed = Color("Red") + static var mGray = Color("BackgroundGrayColor") + static var lGray = Color("ClassLightGrayColor") + static var textGray = Color("TextGrayColor") + + +} diff --git a/smartClass/Extension/Date.ext.swift b/smartClass/Extension/Date.ext.swift new file mode 100644 index 0000000..df7fa0d --- /dev/null +++ b/smartClass/Extension/Date.ext.swift @@ -0,0 +1,58 @@ +// +// Date.ext.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import Foundation + +extension Date{ + + func formatDate() -> String{ + //dd.MM.yy + let formatter = DateFormatter() + formatter.dateFormat = "dd MMM yyyy" + + return formatter.string(from: self) + } + + func formatTime() -> String{ + //dd.MM.yy + let formatter = DateFormatter() + formatter.dateFormat = "HH:mm" + + return formatter.string(from: self) + } + + func getAllDates() -> [Date]{ + let calendar = Calendar.current + + let startDate = calendar.date(from: Calendar.current.dateComponents([.year, .month], from: self))! + + let range = calendar.range(of: .day, in: .month, for: startDate)! + + //range.removeLast() + + return range.compactMap { day -> Date in + return calendar.date(byAdding: .day, value: day - 1, to: startDate)! + } + + } + + + func startOfMonth() -> Date { + return Calendar.current.date(from: Calendar.current.dateComponents([.year, .month], from: self))! + } + + + func endOfMonth() -> Date { + return Calendar.current.date(byAdding: DateComponents(month: 1, day: -1), to: self.startOfMonth())! + } + + + func getCurentDateStart()->Date{ + let date = Calendar.current.date(bySettingHour: 10, minute: 0, second: 0, of: self)! + return date + } +} diff --git a/smartClass/Extension/View.ext.swift b/smartClass/Extension/View.ext.swift index a993893..99b292e 100644 --- a/smartClass/Extension/View.ext.swift +++ b/smartClass/Extension/View.ext.swift @@ -11,5 +11,65 @@ extension View{ func customFont(font: String, size: CGFloat = 18) -> some View { modifier(CustomFont(font: font, size: size)) } + + + + func sameDate(date1: Date, date2: Date) -> Bool{ + let calendar = Calendar.current + + return calendar.isDate(date1, equalTo: date2, toGranularity: .day) + //return calendar.isDate(date1, inSameDayAs: date2) + } + + func extraDate(currentDate: Date) -> [String]{ + let formatter = DateFormatter() + formatter.dateFormat = "MMMM YYYY" + + let data = formatter.string(from: currentDate) + + return data.components(separatedBy: " ") + } + + + func getCurrenMonth(curentMonth: Int) -> Date{ + + let calendar = Calendar.current + + guard let curentMonth = calendar.date(byAdding: .month, value: curentMonth, to: Date()) else { return Date() } + + return curentMonth + + } + + func extractDate(curentMonth: Int) -> [DateValue]{ + let calendar = Calendar.current + + + let curentMonth = getCurrenMonth(curentMonth: curentMonth) + + + var days = curentMonth.getAllDates().compactMap { date -> DateValue in + let day = calendar.component(.day, from: date) + + return DateValue(day: day, date: date.getCurentDateStart()) + } + + let firstDay = calendar.component(.weekday, from: curentMonth.startOfMonth()) + //let firstDay = calendar.component(.weekday, from: days.first?.date ?? Date()) + + if firstDay == 1 { + for _ in 0..<6{ + days.insert(DateValue(day: -1, date: Date()), at: 0) + } + } else { + for _ in 1.. + + + + CLIENT_ID + 920975416585-n062cgnmilvpeo4bl6dfhviv9nuo0mas.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.920975416585-n062cgnmilvpeo4bl6dfhviv9nuo0mas + API_KEY + AIzaSyDcvLivDcphJDdwwtjbQg9fOhwAliWpBtA + GCM_SENDER_ID + 920975416585 + PLIST_VERSION + 1 + BUNDLE_ID + ru.namari.smartClass + PROJECT_ID + smartclass-e6d30 + STORAGE_BUCKET + smartclass-e6d30.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:920975416585:ios:22218b9785efc01c73c7d8 + + \ No newline at end of file diff --git a/smartClass/Model/Messages/MessageModel.swift b/smartClass/Model/Messages/MessageModel.swift new file mode 100644 index 0000000..2db5c85 --- /dev/null +++ b/smartClass/Model/Messages/MessageModel.swift @@ -0,0 +1,30 @@ +// +// MessageModel.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct MessageModel { + let section: SectionMessage + let date: String + let title: String + let text: String + + static let exempleMessage: [MessageModel] = [ + MessageModel(section: SectionMessage.newsLetterMessage, date: "15 мая", title: "Перенос занятия", text: "Lorem ipsum dolor sit amet"), + MessageModel(section: SectionMessage.newsLetterMessage, date: "12 мая", title: "Субботник", text: "Перенос занятия Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"), + MessageModel(section: SectionMessage.privateMessage, date: "18 мая", title: "В деканат", text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua"), + MessageModel(section: SectionMessage.privateMessage, date: "19 мая", title: "В деканат1", text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua") + ] +} + + +//Section +enum SectionMessage: String { + case privateMessage = "Личное" + case newsLetterMessage = "Рассылка" + +} diff --git a/smartClass/Model/TabBar/TabBarModel.swift b/smartClass/Model/TabBar/TabBarModel.swift new file mode 100644 index 0000000..d372b3c --- /dev/null +++ b/smartClass/Model/TabBar/TabBarModel.swift @@ -0,0 +1,21 @@ +// +// TabBarModel.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import Foundation + +struct TabBarModel: Hashable { + let text: String + let icon: String + let tapIcon: String + + static let exampleTapBar: [TabBarModel] = + [ + TabBarModel(text: "Календарь", icon: Icons.iconCalendar, tapIcon: Icons.iconTabCalendar), + TabBarModel(text: "Уведомления", icon: Icons.iconClock, tapIcon: Icons.iconTabClock), + TabBarModel(text: "Профиль", icon: Icons.iconProfile, tapIcon: Icons.iconTabProfile) + ] +} diff --git a/smartClass/Model/UserModel.swift b/smartClass/Model/UserModel.swift new file mode 100644 index 0000000..a871814 --- /dev/null +++ b/smartClass/Model/UserModel.swift @@ -0,0 +1,39 @@ +// +// UserModel.swift +// smartClass +// +// Created by Владимир Ширяев on 24.06.2023. +// + +import Foundation + +struct UserModel:Identifiable, Codable { + let id: String + let email: String + let password: String + + // личная информация + let surname: String + let firstName: String + let fatherName: String + let birthDate: Date + + // проф. сведения + let university: String + let specialty: String + let group: String + let course: String + + var fullname: String { + surname + " " + firstName + } + + var initials: String{ + let formatter = PersonNameComponentsFormatter() + if let components = formatter.personNameComponents(from: fullname){ + formatter.style = .abbreviated + return formatter.string(from: components) + } + return "" + } +} diff --git a/smartClass/Resources/Colors.swift b/smartClass/Resources/Colors.swift new file mode 100644 index 0000000..c5b09f1 --- /dev/null +++ b/smartClass/Resources/Colors.swift @@ -0,0 +1,14 @@ +// +// Colors.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct Colors { + static let iconColorBG = Color(red: 153/255, green: 153/255, blue: 153/255, opacity: 1) + static let tabIconColor = Color(red: 38/255, green: 110/255, blue: 241/255, opacity: 1) + static let buttonTabBG = Color(red: 244/255, green: 244/255, blue: 244/255, opacity: 1) +} diff --git a/smartClass/Resources/Icons.swift b/smartClass/Resources/Icons.swift new file mode 100644 index 0000000..152be24 --- /dev/null +++ b/smartClass/Resources/Icons.swift @@ -0,0 +1,17 @@ +// +// Icons.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import Foundation + +struct Icons { + static let iconCalendar: String = "iconCalendar" + static let iconTabCalendar: String = "iconTabCalendar" + static let iconClock: String = "iconClock" + static let iconTabClock: String = "iconTabClock" + static let iconProfile: String = "iconProfile" + static let iconTabProfile: String = "iconTabProfile" +} diff --git a/smartClass/View/App/Student/Calendar/Calendar View/CalendarView.swift b/smartClass/View/App/Student/Calendar/Calendar View/CalendarView.swift new file mode 100644 index 0000000..79cf2cc --- /dev/null +++ b/smartClass/View/App/Student/Calendar/Calendar View/CalendarView.swift @@ -0,0 +1,177 @@ +// +// CalendarView.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct CalendarView: View { + let daysName = ["пн","вт","ср","чт","пт","сб","вс"] + @ObservedObject var calendarViewModel = CalendarViewModel() + @State var curentMonth: Int = 0 + @State var currentDate = Date() + let calendarGrid = Array(repeating: GridItem(.flexible()), count: 7) + @State var today = Date() + + var body: some View { + + VStack(alignment: .leading){ + Text("Календарь") + .customFont(font: FontManager.main) + .padding(.leading, 20) + .foregroundColor(.gray) + VStack{ + + VStack(spacing: 30){ + VStack(spacing: 24){ + HStack{ + //left + HStack{ + Button { + curentMonth -= 1 + } label: { + Image(systemName: "chevron.left") + .foregroundColor(.black) + } + + } + Spacer() + VStack{ + Text(extraDate(currentDate: currentDate)[1]) + .customFont(font: FontManager.Nunito.bold, size: 14) + Text(extraDate(currentDate: currentDate)[0]) + .customFont(font: FontManager.Nunito.bold, size: 20) + .foregroundColor(.mBlue) + } + Spacer() + //right + HStack{ + Button { + curentMonth += 1 + } label: { + Image(systemName: "chevron.right") + .foregroundColor(.black) + } + + } + } + .padding(.horizontal, 20) + + HStack(spacing: 0){ + ForEach(daysName, id: \.self) { day in + Text(day) + .frame(maxWidth: .infinity) + .customFont(font: FontManager.Nunito.black) + } + } + } + + LazyVGrid(columns: calendarGrid, spacing: 10) { + ForEach(extractDate(curentMonth: curentMonth)) { value in + CardView(value: value) + .environmentObject(calendarViewModel) + .overlay { + if sameDate(date1: value.date, date2: today), value.day != -1 { + ZStack{ + Circle() + .stroke(Color.mBlue, lineWidth: 4) + .frame(width: 35, height: 35) + } + .zIndex(0) + } + } + .onTapGesture { + today = value.date + currentDate = value.date + // + } + } + } + .onChange(of: curentMonth) { newValue in + currentDate = getCurrenMonth(curentMonth: curentMonth) + today = Date() + } + } + + } + .padding(.vertical, 20) + .padding(.horizontal, 10) + .background(Color.mGray) + .cornerRadius(20) + + } + + } +} + + +struct CardView: View{ + @ObservedObject var calendarViewModel = CalendarViewModel() + var value: DateValue + + var body: some View{ + VStack{ + if value.day != -1 { + + if let selectDay = calendarViewModel.availableDays.first(where: { day in + return sameDate(date1: day.date, date2: value.date) + }){ + ZStack{ + Circle() + .frame(width: 35, height: 35) + .clipShape(Circle()) + .foregroundColor(Color.mBlue) + + Text("\(value.day)") + .foregroundColor(.white) + .overlay { + ZStack{ + Circle() + .frame(width: 20, height: 20) + .foregroundColor(Color.mRed) + Text("\(selectDay.times.count)") + .customFont(font: FontManager.main, size: 14) + .foregroundColor(.white) + } + .offset(x: -15, y: -15) + } + } + } else { + Text("\(value.day)") + .frame(width: 35, height: 35) + .clipShape(Circle()) + } + } + } + } +} + + + +struct DateValue: Identifiable{ + var id = UUID().uuidString + var day: Int + var date: Date + var isTime: Bool = false + var lessons: [Lesson] = [] +} + +struct Lesson: Identifiable, Equatable{ + var id = UUID().uuidString + var date: Date + var times: [Times] +} + +struct Times: Identifiable, Equatable{ + var id = UUID().uuidString + var time: String +} + + +struct CalendarView_Previews: PreviewProvider { + static var previews: some View { + CalendarView() + } +} diff --git a/smartClass/View/App/Student/Calendar/CalendarTabView.swift b/smartClass/View/App/Student/Calendar/CalendarTabView.swift new file mode 100644 index 0000000..f1e3e97 --- /dev/null +++ b/smartClass/View/App/Student/Calendar/CalendarTabView.swift @@ -0,0 +1,39 @@ +// +// CalendarView.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct CalendarTabView: View { + private var audience = "Физ. Тех. Группа 101" + private var currentdate = "18 мая" + private var lessonsCount = 3 + + + var body: some View { + ScrollView(showsIndicators: false) { + VStack(alignment: .leading) { + Text("\(audience)") + .customFont(font: FontManager.Nunito.bold, size: 19) + .foregroundColor(.lGray) + CalendarView() + + Text("\(currentdate)") + .customFont(font: FontManager.Nunito.bold, size: 18) + Text("Сегодня у тебя \(lessonsCount) занятия") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(.lGray) + + TimetableCard() + + } + .padding(.horizontal, 20) + .padding(.bottom, 70) + } + .navigationTitle(Text("Расписание")) + + } +} diff --git a/smartClass/View/App/Student/Calendar/TimetableCard.swift b/smartClass/View/App/Student/Calendar/TimetableCard.swift new file mode 100644 index 0000000..db5c17c --- /dev/null +++ b/smartClass/View/App/Student/Calendar/TimetableCard.swift @@ -0,0 +1,74 @@ +// +// TimetableCard.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct TimetableCard: View { + + private var lesson = "Основы программирования" + private var lessonTime = "17:00 - 18:30" + var buildingNumber = 9 + private var audienceNumber = 201 + + var body: some View { + VStack(alignment: .leading) { + HStack { + Text("\(lesson)") + .customFont(font: FontManager.Nunito.bold, size: 16) + .padding(.top, 19) + .padding(.leading, 25) + Spacer() + NavigationLink(destination: TimetableCardView()) { + Image("arrowIconRight") + .resizable() + .frame(width: 17, height: 17) + .padding(.top, 20) + .padding(.trailing, 25) + } + } + Text("\(lessonTime)") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color.mBlue) + .cornerRadius(12) + .padding(.leading, 25) + HStack { + Image("buildingIcon") + .resizable() + .frame(width: 16, height: 16) + .padding(.leading, 25) + Text("корпус: ") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(.textGray) + Text("\(buildingNumber)") + .customFont(font: FontManager.Nunito.regular, size: 14) + .padding(.leading, -8) + Image("audienceIcon") + .resizable() + .frame(width: 16, height: 16) + .padding(.leading, 25) + Text("аудитория: ") + .customFont(font: FontManager.Nunito.regular, size: 14) + .foregroundColor(.textGray) + Text("\(audienceNumber)") + .customFont(font: FontManager.Nunito.regular, size: 14) + .padding(.leading, -8) + } + .padding(.bottom, 33) + } + .background(Color.mGray) + .cornerRadius(20) + .tint(Color.black) + } +} + +struct TimetableCard_Previews: PreviewProvider { + static var previews: some View { + TimetableCard() + } +} diff --git a/smartClass/View/App/Student/Calendar/TimetableCardView.swift b/smartClass/View/App/Student/Calendar/TimetableCardView.swift new file mode 100644 index 0000000..7b1aa34 --- /dev/null +++ b/smartClass/View/App/Student/Calendar/TimetableCardView.swift @@ -0,0 +1,107 @@ +// +// TimetableCardView.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct TimetableCardView: View { + private var currentdate = "18 мая" + + var body: some View { + ScrollView{ + VStack(alignment: .leading) { + HStack { + Image("redRectangleIcon") + .resizable() + .frame(width: 15, height: 15) + Text("Семинар") + .customFont(font: FontManager.Nunito.bold, size: 16) + .foregroundColor(.textGray) + } + + HStack { + Text("Дата") + .customFont(font: FontManager.Nunito.bold, size: 16) + Text("18 мая") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color.mBlue) + .cornerRadius(12) + Text("Время") + .customFont(font: FontManager.Nunito.bold, size: 16) + Text("17:00 - 18:30") + .customFont(font: FontManager.Nunito.regular, size: 12) + .foregroundColor(.white) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color.mBlue) + .cornerRadius(12) + } + VStack(alignment: .leading){ + Text("Преподователь") + .customFont(font: FontManager.Nunito.bold, size: 14) + .padding(.top, 29) + Text("Александр Викторович") + .customFont(font: FontManager.Nunito.regular, size: 16) + } + + VStack(alignment: .leading){ + Text("Информатика в этом месяце") + .customFont(font: FontManager.Nunito.bold, size: 16) + .padding(.top, 34) + .padding(.bottom, 20) + + CalendarView() + } + .padding(.bottom, 30) + + Button { + + } label: { + ButtonView(btnText: "Оставить сообщение") + } + } + .padding(.horizontal, 20) + .padding(.bottom, 80) + } + .navigationBarBackButtonHidden(true) + .navigationBarItems(leading: BackButtonArrow()) + .navigationTitle("Информатика") + .toolbar { + ToolbarItem(placement: .principal) { + HStack { + Image("locationIcon") + .resizable() + .frame(width: 18, height: 18) + Text("Корпус \(TimetableCard().buildingNumber)") + .customFont(font: FontManager.Nunito.bold, size: 12) + } + } + } + } +} + +struct BackButtonArrow: View { + @Environment(\.presentationMode) var presentationMode + + var body: some View { + Button(action: { + self.presentationMode.wrappedValue.dismiss() + }) { + Image("arrowIconRight") + .resizable() + .frame(width: 17, height: 17) + .scaledToFit() + .scaleEffect(x: -1, y: 1) + } + } +} + +struct TimetableCardView_Previews: PreviewProvider { + static var previews: some View { + TimetableCardView() + } +} diff --git a/smartClass/View/App/Student/Messages/MessageItemView.swift b/smartClass/View/App/Student/Messages/MessageItemView.swift new file mode 100644 index 0000000..968832e --- /dev/null +++ b/smartClass/View/App/Student/Messages/MessageItemView.swift @@ -0,0 +1,36 @@ +// +// MessageItemView.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct MessageItemView: View { + let section: SectionMessage + let date: String + let title: String + let text: String + + var body: some View { + VStack(alignment: .leading, spacing: 4){ + HStack { + Text(title) + .customFont(font: FontManager.Nunito.bold, size: 16) + Spacer() + Text(date) + + .customFont(font: FontManager.Nunito.light, size: 14) + } + Text(text) + .customFont(font: FontManager.Nunito.regular, size: 16) + + } + .padding(.vertical, 17) + .frame(maxWidth: .infinity) + .padding(.horizontal, 20) + .background(Color.mGray) + .cornerRadius(20) + } +} diff --git a/smartClass/View/App/Student/Messages/MessagesView.swift b/smartClass/View/App/Student/Messages/MessagesView.swift new file mode 100644 index 0000000..0bcbaeb --- /dev/null +++ b/smartClass/View/App/Student/Messages/MessagesView.swift @@ -0,0 +1,60 @@ +// +// MessagesView.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import SwiftUI + +struct MessagesView: View { + + var body: some View { + ScrollView(showsIndicators: false) { + VStack(spacing: 20){ + Section { + ForEach(MessageModel.exempleMessage, id: \.title) { message in + + if message.section == .newsLetterMessage { + MessageItemView(section: message.section, date: message.date, title: message.title, text: message.text) + } + } + } header: { + HStack { + Text("Рассылка") + .customFont(font: FontManager.Nunito.bold) + .foregroundColor(.lGray) + Spacer() + } + } + + Section { + ForEach(MessageModel.exempleMessage, id: \.title) { message in + + if message.section == .privateMessage { + MessageItemView(section: message.section, date: message.date, title: message.title, text: message.text) + } + } + } header: { + HStack { + Text("Личное") + .customFont(font: FontManager.Nunito.bold) + .foregroundColor(.lGray) + Spacer() + } + + } + } + .padding(.horizontal, 20) + .padding(.bottom, 80) + } + + .navigationTitle("Уведомления") + } +} + +struct MessagesView_Previews: PreviewProvider { + static var previews: some View { + MessagesView() + } +} diff --git a/smartClass/View/App/Student/Profile/LessonView.swift b/smartClass/View/App/Student/Profile/LessonView.swift new file mode 100644 index 0000000..bc7a9f2 --- /dev/null +++ b/smartClass/View/App/Student/Profile/LessonView.swift @@ -0,0 +1,50 @@ +// +// LessonView.swift +// smartClass +// +// Created by Ислам Батыргереев on 04.06.2023. +// + +import SwiftUI + +struct LessonView: View { + var body: some View { + VStack { + VStack(alignment: .leading, spacing: 10) { + Text("Основы программирования") + .customFont(font: FontManager.Nunito.bold, size: 16) + HStack { + Circle() + .frame(width: 20, height: 20) + .foregroundColor(.mRed) + Text("Зачет") + .customFont(font: FontManager.main, size: 14) + Text("30 часов") + .foregroundColor(.white) + .customFont(font: FontManager.main, size: 14) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color.mBlue) + .cornerRadius(12) + + } + + HStack { + Text("Преподаватель: ") + .customFont(font: FontManager.Nunito.bold, size: 14) + Text("Александр Викторович") + .customFont(font: FontManager.main, size: 14) + } + } + .padding() + .frame(maxWidth: .infinity, alignment: .leading) + .background(Color.mGray) + .cornerRadius(10) + } + } +} + +struct LessonView_Previews: PreviewProvider { + static var previews: some View { + LessonView() + } +} diff --git a/smartClass/View/App/Student/Profile/ProfileView.swift b/smartClass/View/App/Student/Profile/ProfileView.swift new file mode 100644 index 0000000..2506c3f --- /dev/null +++ b/smartClass/View/App/Student/Profile/ProfileView.swift @@ -0,0 +1,71 @@ +// +// ProfileView.swift +// smartClass +// +// Created by Ислам Батыргереев on 04.06.2023. +// + +import SwiftUI + +struct ProfileView: View { + @EnvironmentObject var viewModel: FirebaseManager + + var body: some View { + //NavigationView { + if let user = viewModel.currentUser { + ScrollView { + + VStack(alignment: .leading){ + VStack(alignment: .leading){ + Text("\(user.course) курс") + .customFont(font: FontManager.main, size: 18) + .foregroundColor(.textGray) + + } + HStack { + Text("Специальность") + .customFont(font: FontManager.Nunito.black, size: 18) + Text(user.specialty) + .foregroundColor(.white) + .customFont(font: FontManager.main, size: 14) + .padding(EdgeInsets(top: 3, leading: 10, bottom: 2, trailing: 10)) + .background(Color.mBlue) + .cornerRadius(12) + + } + .padding(.bottom, 20) + HStack { + Text("Предметы в этом семестре") + .fontWeight(.bold) + Spacer() + } + LessonView() + LessonView() + LessonView() + } + .padding(.bottom, 70) + + } + .navigationTitle(user.fullname) + .padding(.horizontal) + .toolbar { + ToolbarItem { + NavigationLink(destination: SettingView()) { + Image(systemName: "gear") + .resizable() + .scaledToFit() + .frame(width: 30) + .foregroundColor(.blue) + } + } + } + //} + } + } +} + +struct ProfileView_Previews: PreviewProvider { + static var previews: some View { + ProfileView() + } +} diff --git a/smartClass/View/App/Student/Profile/SettingTextFieldView.swift b/smartClass/View/App/Student/Profile/SettingTextFieldView.swift new file mode 100644 index 0000000..1208d16 --- /dev/null +++ b/smartClass/View/App/Student/Profile/SettingTextFieldView.swift @@ -0,0 +1,59 @@ +// +// SettingTextFieldView.swift +// smartClass +// +// Created by Ислам Батыргереев on 04.06.2023. +// + +import SwiftUI + +struct SettingTextFieldView: View { + + + @State var name = "" + @State var surname = "" + @State var nameSurname = "" + @State var date = Date() + + @EnvironmentObject var viewModel: FirebaseManager + + var body: some View { + if let user = viewModel.currentUser { + VStack { + HStack { + Text("Личные данные") + .foregroundColor(.gray) + Spacer() + } + .padding(.horizontal) + .padding(.top) + VStack { + TextFieldView(customStateProperty: $name, customText: user.firstName, color: .white) + + TextFieldView(customStateProperty: $surname, customText: user.surname, color: .white) + + + TextFieldView(customStateProperty: $nameSurname, customText: user.fatherName, color: .white) + + HStack { + Text("Дата рождения") + .fontWeight(.bold) + Spacer() + + DatePicker("", selection: $date, displayedComponents: .date) + } + .padding() + } + .padding() + .background(Color(.systemGray6)) + .cornerRadius(20) + } + } + } +} + +struct SettingTextFieldView_Previews: PreviewProvider { + static var previews: some View { + SettingTextFieldView() + } +} diff --git a/smartClass/View/App/Student/Profile/SettingView.swift b/smartClass/View/App/Student/Profile/SettingView.swift new file mode 100644 index 0000000..afe78e1 --- /dev/null +++ b/smartClass/View/App/Student/Profile/SettingView.swift @@ -0,0 +1,47 @@ +// +// SettingView.swift +// smartClass +// +// Created by Ислам Батыргереев on 04.06.2023. +// + +import SwiftUI + +struct SettingView: View { + @EnvironmentObject var viewModel: FirebaseManager + + var body: some View { + ZStack{ + ScrollView{ + VStack { + SettingTextFieldView() + + VStack { + Button { + // + } label: { + ButtonView(btnText: "Сохранить") + } + + Button { + viewModel.singOut() + } label: { + Text("Выйти") + .foregroundColor(.red) + } + } + } + } + + .navigationTitle("Настройки") + } + .padding(.horizontal) + .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top) + } +} + +struct SettingView_Previews: PreviewProvider { + static var previews: some View { + SettingView() + } +} diff --git a/smartClass/View/App/Student/StudentAppView.swift b/smartClass/View/App/Student/StudentAppView.swift new file mode 100644 index 0000000..c9d10d6 --- /dev/null +++ b/smartClass/View/App/Student/StudentAppView.swift @@ -0,0 +1,87 @@ +// +// StudentAppView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct StudentAppView: View { + @State var selectedTab: TabBarModel = TabBarModel(text: "Календарь", icon: Icons.iconCalendar, tapIcon: Icons.iconTabCalendar) + @State var selected: String = "Календарь" + + init() { + UITabBar.appearance().isHidden = true + UINavigationBar.appearance().largeTitleTextAttributes = [.font: UIFont(name: FontManager.Nunito.black, size: 30)!] + } + + var body: some View { + ZStack(alignment: .bottom) { + TabView(selection: $selected) { + NavigationView{ + CalendarTabView() + } + .tag("Календарь") + + NavigationView{ + MessagesView() + } + .tag("Уведомления") + + NavigationView{ + ProfileView() + } + .tag("Профиль") + + } + HStack { + Spacer() + ForEach(TabBarModel.exampleTapBar, id: \.self) { tap in + TapBarItemView(tab: tap, selected: $selected) + Spacer() + } + } + .padding(.top, 10) + .frame(maxWidth: .infinity) + .background(.white) + } + } +} + +struct StudentAppView_Previews: PreviewProvider { + static var previews: some View { + StudentAppView() + } +} + +struct TapBarItemView: View { + @State var tab: TabBarModel + @Binding var selected: String + + var body: some View { + VStack { + Button { + withAnimation(.spring()) { + selected = tab.text + } + } label: { + HStack { + Image(selected == tab.text ? tab.tapIcon : tab.icon) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 21, height: 21) + if selected == tab.text { + Text(tab.text) + .foregroundColor(Colors.tabIconColor) + .customFont(font: FontManager.main, size: 14) + } + } + } + } + .padding(.vertical, 10) + .padding(.horizontal, 15) + .background(selected == tab.text ? Colors.buttonTabBG : .white) + .clipShape(Capsule()) + } +} diff --git a/smartClass/View/ContentView.swift b/smartClass/View/ContentView.swift new file mode 100644 index 0000000..187d3dc --- /dev/null +++ b/smartClass/View/ContentView.swift @@ -0,0 +1,27 @@ +// +// ContentView.swift +// smartClass +// +// Created by Ислам Батыргереев on 24.05.2023. +// + +import SwiftUI + +struct ContentView: View { + @EnvironmentObject var viewModel: FirebaseManager + var body: some View { + Group { + if viewModel.userSession != nil { + StudentAppView() + } else { + GreetingView() + } + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/smartClass/View/Login/GreetingTwoView.swift b/smartClass/View/Login/GreetingTwoView.swift new file mode 100644 index 0000000..0d3ad05 --- /dev/null +++ b/smartClass/View/Login/GreetingTwoView.swift @@ -0,0 +1,63 @@ +// +// GreetingTwoView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct GreetingTwoView: View { + var body: some View { + VStack{ + ZStack{ + VStack{ + Image("SecondStart") + Spacer() + } + VStack{ + HStack{ + Text("SmartClass") + .font(.custom("Nunito-Bold", size: 36)) + Spacer() + } + .padding(.horizontal,20) + .padding(.top,40) + Spacer() + } + + } + NavigationLink{ + LoginView() + } label: { + Text("Войти") + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 52) + .background(Color(UIColor(red: 0.149, green: 0.431, blue: 0.945, alpha: 1))) + .cornerRadius(10) + } + .padding(.horizontal, 20) + + NavigationLink { + RegistrationView() + } label: { + Text("Регистрация") + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 52) + .background(.black) + .cornerRadius(10) + } + .padding(.horizontal, 20) + + } + .navigationBarBackButtonHidden(true) + } +} + +struct GreetingTwoView_Previews: PreviewProvider { + static var previews: some View { + GreetingTwoView() + } +} diff --git a/smartClass/View/Login/GreetingView.swift b/smartClass/View/Login/GreetingView.swift new file mode 100644 index 0000000..ea41e1f --- /dev/null +++ b/smartClass/View/Login/GreetingView.swift @@ -0,0 +1,62 @@ +// +// GreetingView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct GreetingView: View { + var body: some View { + NavigationView { + ZStack(alignment: .bottom){ + VStack{ + Image("StartScreen") + .frame(width: 400, height: 420) + .ignoresSafeArea() + Spacer() + } + VStack{ + Text("Добро пожаловать!") + .font(.custom("Nunito-Bold", size: 24)) + .padding(.top,40) + Text("Lorem Ipsum - это текст-\"рыба\", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной \"рыбой\" для текстов на латинице с начала XVI века. \n\nIpsum для распечатки образцов. Lorem Ipsum не только успешно пережил без заметных изменений пять веков.") + .foregroundColor(Color(UIColor(red: 0.629, green: 0.629, blue: 0.629, alpha: 1))) + .padding(.horizontal,36) + .font(.custom("Nunito-Regular", size: 16)) + .padding(.top,10) + + NavigationLink { + GreetingTwoView() + } label: { + Text("Продолжить") + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 52) + .background(Color(UIColor(red: 0.149, green: 0.431, blue: 0.945, alpha: 1))) + .cornerRadius(10) + } + .padding(.top,10) + .padding() + .padding(.bottom,24) + + } + + .padding() + .background(.white) + .cornerRadius(30) + .shadow(radius: 10) + } + .ignoresSafeArea() + .navigationBarBackButtonHidden(true) + } + + } +} + +struct GreetingView_Previews: PreviewProvider { + static var previews: some View { + GreetingView() + } +} diff --git a/smartClass/View/Login/LoginView.swift b/smartClass/View/Login/LoginView.swift new file mode 100644 index 0000000..bc62ba4 --- /dev/null +++ b/smartClass/View/Login/LoginView.swift @@ -0,0 +1,98 @@ +// +// LoginView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct LoginView: View { + @Environment(\.dismiss) var dismiss + + var body: some View { + ZStack(alignment: .bottom){ + VStack{ + Image("hello") + Spacer() + } + + VStack{ + VStack{ + HStack{ + Button{ + dismiss() + } label:{ + Image(systemName: "chevron.left") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 15) + .foregroundColor(.black) + } + Text("Войти") + .padding(.horizontal, 10) + .customFont(font: FontManager.Nunito.bold, size: 30) + Spacer() + } + .padding(.horizontal, 20) + Spacer() + } + + VStack{ + EmailPasswordView() + } + .padding(.bottom, 40) + .background(.white) + .cornerRadius(30) + .shadow(radius: 10) + } + + } + .padding(.top, 50) + .navigationBarBackButtonHidden(true) + .ignoresSafeArea() + } +} + +struct LoginView_Previews: PreviewProvider { + static var previews: some View { + LoginView() + } +} + +struct EmailPasswordView: View { + @State private var emailState: String = "" + @State private var passwordState: String = "" + //@EnvironmentObject var appViewModel: AppViewModel + @EnvironmentObject var viewModel: FirebaseManager + + var body: some View { + VStack{ + HStack{ + Text("Авторизация") + .customFont(font: FontManager.Nunito.bold, size: 20) + + Spacer() + } + .padding(.horizontal,39) + .padding(.top,50) + + VStack(spacing: 20){ + TextFieldView(customStateProperty: $emailState, customText: "Email") + + TextFieldView(customStateProperty: $passwordState, customText: "Пароль", isSecure: true) + + + Button { + // appViewModel.isLogin.toggle() + Task { + try await viewModel.singIn(withEmail: emailState, password: passwordState) + } + } label: { + ButtonView(btnText: "Войти") + } + } + .padding(.horizontal, 20) + } + } +} diff --git a/smartClass/View/Login/Parts/TextFieldView.swift b/smartClass/View/Login/Parts/TextFieldView.swift new file mode 100644 index 0000000..609b508 --- /dev/null +++ b/smartClass/View/Login/Parts/TextFieldView.swift @@ -0,0 +1,30 @@ +// +// TextFieldView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI + +struct TextFieldView: View { + @Binding var customStateProperty: String + var customText: String + var color = Color.mGray + var isSecure = false + var body: some View { + VStack { + if isSecure { + SecureField(customText, text: $customStateProperty) + } else { + TextField(customText, text: $customStateProperty) + } + } + .frame(height: 52) + .padding(.horizontal,23) + .background(color) + .cornerRadius(10) + .customFont(font: FontManager.main, size: 18) + } +} + diff --git a/smartClass/View/Login/RegistrationView.swift b/smartClass/View/Login/RegistrationView.swift new file mode 100644 index 0000000..628b4ae --- /dev/null +++ b/smartClass/View/Login/RegistrationView.swift @@ -0,0 +1,205 @@ +// +// RegistrationView.swift +// smartClass +// +// Created by Ислам Батыргереев on 03.06.2023. +// + +import SwiftUI +import Firebase + +struct RegistrationView: View { + + @State private var emailNewUser: String = "" + @State private var passwordNewUser: String = "" + @State private var passwordTwoNewUser: String = "" + + @State private var surnameState: String = "" + @State private var firstNameState: String = "" + @State private var fatherNameState: String = "" + @State private var birthDate = Date.now + + @State private var universityState: String = "" + @State private var specialtyState: String = "" + @State private var groupState: String = "" + @State private var courseState: String = "" + + @Environment(\.dismiss) var dismiss + @EnvironmentObject var viewModel: FirebaseManager + + var body: some View { + ScrollView{ + VStack{ + HStack{ + Button{ + dismiss() + } label:{ + Image(systemName: "chevron.left") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 15) + .foregroundColor(.black) + } + Text("Регистрация") + .padding(.horizontal, 10) + .customFont(font: FontManager.Nunito.bold, size: 30) + Spacer() + } + .padding(.horizontal, 20) + Spacer() + } + EmailView(emailNewUser: $emailNewUser, passwordNewUser: $passwordNewUser, passwordTwoNewUser: $passwordTwoNewUser) + .padding(.top,25) + .padding(.bottom,25) + PersonalityView(surnameState: $surnameState, firstNameState: $firstNameState, fatherNameState: $fatherNameState, birthDate: $birthDate) + .padding(.bottom,25) + UniversityView(universityState: $universityState, specialtyState: $specialtyState, groupState: $groupState, courseState: $courseState) + + Button { + Task { + try await viewModel.createUser(withEmail: emailNewUser, password: passwordNewUser, surname: surnameState, firstName: firstNameState, fatherName: firstNameState, birthDate: birthDate, university: universityState, specialtyState: specialtyState, group: groupState, courseState: courseState) + } + } label: { + Text("Далее") + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 52) + .background(Color(UIColor(red: 0.149, green: 0.431, blue: 0.945, alpha: 1))) + .cornerRadius(10) + } + .padding(.top,10) + .padding() + } + .background(Color(UIColor(red: 0.958, green: 0.958, blue: 0.958, alpha: 1))) + .navigationBarBackButtonHidden(true) + } +} + +struct RegistrationView_Previews: PreviewProvider { + static var previews: some View { + RegistrationView() + } +} + +struct EmailView: View { + @Binding var emailNewUser: String + @Binding var passwordNewUser: String + @Binding var passwordTwoNewUser: String + + var body: some View { + VStack(spacing: 10){ + HStack{ + Text("Email и пароль") + .padding(.horizontal,19) + .foregroundColor(.textGray) + Spacer() + } + VStack(spacing: 15){ + TextFieldView(customStateProperty: $emailNewUser, customText: "Email") + TextFieldView(customStateProperty: $passwordNewUser, customText: "Пароль", isSecure: true) + TextFieldView(customStateProperty: $passwordTwoNewUser, customText: "Повторить пароль", isSecure: true) + } + .padding(20) + .background(.white) + .cornerRadius(30) + } + .padding(.horizontal,20) + } +} + + +struct PersonalityView: View { + @Binding var surnameState: String + @Binding var firstNameState: String + @Binding var fatherNameState: String + @Binding var birthDate: Date + + + var body: some View { + VStack(spacing: 10) { + HStack{ + Text("Личные данные") + .padding(.horizontal,19) + .foregroundColor(.textGray) + Spacer() + } + VStack(spacing: 15){ + TextFieldView(customStateProperty: $surnameState, customText: "Фамилия") + TextFieldView(customStateProperty: $firstNameState, customText: "Имя") + TextFieldView(customStateProperty: $fatherNameState, customText: "Отчество") + + DatePicker(selection: $birthDate, in: ...Date.now, displayedComponents: .date) { + Text("Дата рождения") + } + .environment(\.locale, Locale.init(identifier: "ru")) + .padding(.horizontal,20) + } + .padding(20) + .background(.white) + .cornerRadius(30) + } + .padding(.horizontal,20) + } +} + + +struct UniversityView: View { + @Binding var universityState: String + @Binding var specialtyState: String + @Binding var groupState: String + @Binding var courseState: String + + var body: some View { + VStack { + HStack{ + Text("Университет и группа") + .padding(.horizontal,19) + .foregroundColor(.textGray) + Spacer() + } + VStack(spacing: 15){ + VStack(alignment: .leading){ + Text("Выберите университет") + .customFont(font: FontManager.Nunito.bold) + .padding(.horizontal,19) + + TextFieldView(customStateProperty: $universityState, customText: "Университет") + + } + + VStack(alignment: .leading){ + Text("Выберите специальность") + .customFont(font: FontManager.Nunito.bold) + .padding(.horizontal,19) + + TextFieldView(customStateProperty: $specialtyState, customText: "Специальность") + + } + HStack(spacing: 13){ + VStack(alignment: .leading){ + Text("Группа") + .customFont(font: FontManager.Nunito.bold) + .padding(.horizontal,19) + + TextFieldView(customStateProperty: $groupState, customText: "") + .frame(width: 188) + + } + VStack(alignment: .leading){ + Text("Курс") + .customFont(font: FontManager.Nunito.bold) + .padding(.horizontal,19) + + TextFieldView(customStateProperty: $courseState, customText: "") + + } + } + + } + .padding(20) + .background(.white) + .cornerRadius(30) + } + .padding(.horizontal,20) + } +} diff --git a/smartClass/View/Parts/ButtonView.swift b/smartClass/View/Parts/ButtonView.swift new file mode 100644 index 0000000..ad5d580 --- /dev/null +++ b/smartClass/View/Parts/ButtonView.swift @@ -0,0 +1,21 @@ +// +// ButtonView.swift +// smartClass +// +// Created by Ислам Батыргереев on 04.06.2023. +// + +import SwiftUI + +struct ButtonView: View { + var btnText: String + var body: some View { + Text(btnText) + .padding() + .frame(maxWidth: .infinity) + .foregroundColor(.white) + .background(Color.mBlue) + .cornerRadius(12) + } +} + diff --git a/smartClass/ViewModel/AppViewModel.swift b/smartClass/ViewModel/AppViewModel.swift new file mode 100644 index 0000000..3e96a26 --- /dev/null +++ b/smartClass/ViewModel/AppViewModel.swift @@ -0,0 +1,12 @@ +// +// AppViewModel.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import Foundation + +class AppViewModel: ObservableObject{ + @Published var isLogin = false +} diff --git a/smartClass/ViewModel/CalendarViewModel.swift b/smartClass/ViewModel/CalendarViewModel.swift new file mode 100644 index 0000000..269a469 --- /dev/null +++ b/smartClass/ViewModel/CalendarViewModel.swift @@ -0,0 +1,87 @@ +// +// CalendarViewModel.swift +// smartClass +// +// Created by Ислам Батыргереев on 05.06.2023. +// + +import Foundation + +class CalendarViewModel: ObservableObject{ + @Published var availableDays = [Lesson]() + + init(){ + self.availableDays = getDateForMonth(moth: 0) + } + + + func addDayTime(day: Date, time: Times){ + if let toDay = checkToday(days: availableDays, completion: { date in + return sameDate(date1: day, date2: date) + }) { + if let index = availableDays.firstIndex(of: toDay){ + availableDays[index].times.append(time) + } + } else { + let newDate = Lesson(date: day, times: [time]) + availableDays.append(newDate) + } + + } + + func getDateForMonth(moth: Int) -> [Lesson]{ + return [ + Lesson(date: getSumpleDate(1), times: [ + Times(time: "18:00"), + Times(time: "19:00"), + Times(time: "20:00"), + Times(time: "21:00") + ]), + Lesson(date: getSumpleDate(3), times: [ + Times(time: "18:00"), + Times(time: "19:00"), + Times(time: "21:00") + ]), + Lesson(date: getSumpleDate(4), times: [ + Times(time: "18:00"), + Times(time: "19:00"), + Times(time: "21:00") + ]), + Lesson(date: getSumpleDate(6), times: [ + Times(time: "17:00"), + Times(time: "19:00"), + Times(time: "21:00") + ]), + Lesson(date: getSumpleDate(10), times: [ + Times(time: "17:00"), + Times(time: "19:00") + ]) + ] + } + + + private func checkToday(days: [Lesson], completion: (Date) -> (Bool)) -> Lesson?{ + + var resultDates: Lesson? + for day in days { + if completion(day.date) { + resultDates = day + } + } + return resultDates + } + + + private func sameDate(date1: Date, date2: Date) -> Bool{ + let calendar = Calendar.current + + return calendar.isDate(date1, equalTo: date2, toGranularity: .day) + //return calendar.isDate(date1, inSameDayAs: date2) + } +} + +func getSumpleDate(_ offset: Int) -> Date{ + let calendar = Calendar.current + let date = calendar.date(byAdding: .day, value: offset, to: Date()) + return date ?? Date() +} diff --git a/smartClass/ViewModel/FirebaseManager.swift b/smartClass/ViewModel/FirebaseManager.swift new file mode 100644 index 0000000..62e95b6 --- /dev/null +++ b/smartClass/ViewModel/FirebaseManager.swift @@ -0,0 +1,71 @@ +// +// FirebaseManager.swift +// smartClass +// +// Created by Ислам Батыргереев on 19.06.2023. +// + +import Foundation +import Firebase +import FirebaseFirestoreSwift + +@MainActor +class FirebaseManager: ObservableObject { + @Published var userSession: FirebaseAuth.User? + @Published var currentUser: UserModel? + + init (){ + // self.userSession = Auth.auth().currentUser + + Task { + await fetchUser() + } + } + + func singIn(withEmail email: String, password: String) async throws{ + do { + let result = try await Auth.auth().signIn(withEmail: email, password: password) + self.userSession = result.user + await fetchUser() + }catch{ + print ("Debug: sing in \(error.localizedDescription)") + } + } + + func createUser (withEmail email: String, password: String, surname: String, firstName: String, fatherName: String, birthDate: Date, university: String, specialtyState: String, group: String, courseState: String) async throws{ + do { + let result = try await Auth.auth().createUser(withEmail: email, password: password) + self.userSession = result.user + let user = UserModel(id: result.user.uid, email: email, password: password, surname: surname, firstName: firstName, fatherName: fatherName, birthDate: birthDate, university: university, specialty: specialtyState, group: group, course: courseState) + let encodedUser = try Firestore.Encoder().encode(user) + try await Firestore.firestore().collection("users").document(user.id).setData(encodedUser) + await fetchUser() + } catch { + print ("Debug: create user\(error.localizedDescription)") + } + } + + func singOut(){ + do { + try Auth.auth().signOut() + self.userSession = nil + self.currentUser = nil + } catch{ + print("Debug: error sing out: \(error.localizedDescription)") + } + + } + + func deleteAccount(){ + + } + + func fetchUser() async { + guard let uid = Auth.auth().currentUser?.uid else {return} + guard let snapshot = try? await Firestore.firestore().collection("users").document(uid).getDocument() else {return} + self.currentUser = try? snapshot.data(as: UserModel.self) + + print ("Debug: \(String(describing: self.currentUser))") + } +} + diff --git a/smartClass/smartClassApp.swift b/smartClass/smartClassApp.swift index 86e1f79..8655371 100644 --- a/smartClass/smartClassApp.swift +++ b/smartClass/smartClassApp.swift @@ -6,12 +6,34 @@ // import SwiftUI +import Firebase + +class AppDelegate: NSObject, UIApplicationDelegate { + func application(_ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { + FirebaseApp.configure() + + return true + } +} @main struct smartClassApp: App { + @StateObject var viewModel = FirebaseManager() + // @ObservedObject var appViewModel = AppViewModel() + + @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate + var body: some Scene { WindowGroup { - ContentView() +// if appViewModel.isLogin{ +// StudentAppView() +// } else { + ContentView() + //GreetingView() + //.environmentObject(appViewModel) + .environmentObject(viewModel) + //} } } }