Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attendance #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added Attendance./.DS_Store
Binary file not shown.
457 changes: 457 additions & 0 deletions Attendance./Attendance.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CC2473892733AC2B00AE5094"
BuildableName = "Attendance.app"
BlueprintName = "Attendance"
ReferencedContainer = "container:Attendance.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CC2473892733AC2B00AE5094"
BuildableName = "Attendance.app"
BlueprintName = "Attendance"
ReferencedContainer = "container:Attendance.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CC2473892733AC2B00AE5094"
BuildableName = "Attendance.app"
BlueprintName = "Attendance"
ReferencedContainer = "container:Attendance.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
10 changes: 10 additions & 0 deletions Attendance./Attendance.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>
48 changes: 48 additions & 0 deletions Attendance./Attendance/1 TabBar.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// File1.swift
// Attendance
//
// Created by Fawaz on 08/11/2021.
//

import UIKit
//============================================================================
class TabBar: UITabBarController, UITabBarControllerDelegate {

//==========================================================================
override func viewDidLoad() {
super.viewDidLoad()

delegate = self

let item1 = Date_TabBar()
let item2 = Student_TabBar()

let icon1 = UITabBarItem(
title: "days", image: UIImage(systemName: "calendar.circle"),
selectedImage: UIImage(systemName: "calendar.circle")
)

let icon2 = UITabBarItem(
title: "students", image: UIImage(systemName: "person.circle"),
selectedImage: UIImage(systemName: "person.circle")
)

item1.tabBarItem = icon1
item2.tabBarItem = icon2

let controllers = [item1,item2]

self.viewControllers = controllers
}
//==========================================================================
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
//==========================================================================
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
print("Should select viewController: \(viewController.title ?? "") ?")
return true;
}
//==========================================================================
} // end class
130 changes: 130 additions & 0 deletions Attendance./Attendance/2 DatePage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
//
// File4.swift
// Attendance
//
// Created by Fawaz on 08/11/2021.
//

import UIKit
import Firebase
import FirebaseFirestore
//==========================================================================
class DatePage: UIViewController {

var enterDateTextF = UITextField()
let datePicker = UIDatePicker()
let daySelectOKButton = UIButton()
var callbackClosure: (() -> Void)?

//==========================================================================
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

callbackClosure?()
}
//==========================================================================
func birthDateTxt_func() {

view.addSubview(enterDateTextF)
enterDateTextF.translatesAutoresizingMaskIntoConstraints = false

enterDateTextF.placeholder = "Date"
enterDateTextF.textAlignment = .center
enterDateTextF.textColor = .black
enterDateTextF.font = UIFont.systemFont(ofSize: 18)
enterDateTextF.backgroundColor = .systemGray5

NSLayoutConstraint.activate([
enterDateTextF.centerXAnchor.constraint(equalTo: view.centerXAnchor),
enterDateTextF.centerYAnchor.constraint(equalTo: view.centerYAnchor),
enterDateTextF.widthAnchor.constraint(equalToConstant: 300)
])
}
//==========================================================================
func daySelectOKButton_func() {

view.addSubview(daySelectOKButton)
daySelectOKButton.translatesAutoresizingMaskIntoConstraints = false

daySelectOKButton.backgroundColor = .systemBlue
daySelectOKButton.setTitle("OK", for: .normal)

daySelectOKButton.addTarget(self,
action: #selector(butunp),
for: .touchUpInside)

func buttonAction(sender: UIButton!) {

let btnsendtag: UIButton = sender

if btnsendtag.tag == 1 {

dismiss(animated: true, completion: nil)
}
}
NSLayoutConstraint.activate([
daySelectOKButton.centerXAnchor.constraint(equalTo: view.centerXAnchor),
daySelectOKButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -300),

daySelectOKButton.heightAnchor.constraint(equalToConstant: 50),
daySelectOKButton.widthAnchor.constraint(equalToConstant: 300)
])
}
//==========================================================================
override func viewDidLoad(){
super.viewDidLoad()

createDatePicker()
birthDateTxt_func()
daySelectOKButton_func()

view.backgroundColor = .white
}
//==========================================================================
func createDatePicker(){

enterDateTextF.textAlignment = .center

let toolbar = UIToolbar()
toolbar.sizeToFit()

let doneBtn = UIBarButtonItem(barButtonSystemItem: .done, target: nil, action: #selector (donePressed))

toolbar.setItems ([doneBtn], animated: true)

enterDateTextF.inputAccessoryView = toolbar

datePicker.preferredDatePickerStyle = .wheels
enterDateTextF.inputView = datePicker
datePicker.datePickerMode = .date
}
//==========================================================================
@objc func donePressed() {

let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .none

enterDateTextF.text = formatter.string(from: datePicker.date)
self.view.endEditing(true)
}
//==========================================================================
@objc func butunp(){

let date = datePicker.date
let uuid = UUID().uuidString

DaysService.shared.addDay(

day: Day(
timestamp: Timestamp(date: date),
pStudents: [],
id: uuid
)
)
dismiss(animated: true, completion: nil)
}
//==========================================================================
} //class end


Loading