From 5649362ecd8812b1f0f6a5807bba833c920389bb Mon Sep 17 00:00:00 2001 From: Sophia Liu Date: Sat, 17 Feb 2024 00:19:08 -0600 Subject: [PATCH] added staff shifts to schedule page --- HIAPI/Models/Staff.swift | 4 +- HackIllinois.xcodeproj/project.pbxproj | 8 +- .../GrayPotion.imageset/Contents.json | 23 +++ .../GrayPotion.imageset/GrayPotion1x.png | Bin 0 -> 1803 bytes .../GrayPotion.imageset/GrayPotion2x.png | Bin 0 -> 3254 bytes .../GrayPotion.imageset/GrayPotion3x.png | Bin 0 -> 4803 bytes .../GreenPotion.imageset/Contents.json | 23 +++ .../GreenPotion.imageset/greenPotion.png | Bin 0 -> 1813 bytes .../GreenPotion.imageset/greenPotion2x.png | Bin 0 -> 3316 bytes .../GreenPotion.imageset/greenPotion3x.png | Bin 0 -> 4896 bytes .../HIScheduleViewController.swift | 145 +++++++++++++++++- 11 files changed, 191 insertions(+), 12 deletions(-) create mode 100644 HackIllinois/Assets.xcassets/GrayPotion.imageset/Contents.json create mode 100644 HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion1x.png create mode 100644 HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion2x.png create mode 100644 HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion3x.png create mode 100644 HackIllinois/Assets.xcassets/GreenPotion.imageset/Contents.json create mode 100644 HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion.png create mode 100644 HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion2x.png create mode 100644 HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion3x.png diff --git a/HIAPI/Models/Staff.swift b/HIAPI/Models/Staff.swift index 20d1c983..3a088cc8 100644 --- a/HIAPI/Models/Staff.swift +++ b/HIAPI/Models/Staff.swift @@ -39,10 +39,10 @@ public struct Staff: Codable { case isPrivate case displayOnStaffCheckIn } - public let isPro: String + public let isPro: Bool public let eventId: String public let isStaff: Bool - public let name: Int + public let name: String public let description: String public let startTime: Date public let endTime: Date diff --git a/HackIllinois.xcodeproj/project.pbxproj b/HackIllinois.xcodeproj/project.pbxproj index 2779e95b..f63fe346 100644 --- a/HackIllinois.xcodeproj/project.pbxproj +++ b/HackIllinois.xcodeproj/project.pbxproj @@ -140,11 +140,11 @@ D158EC312B5A2D440003D799 /* HIQRAttendeeScannerSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = D158EC302B5A2D440003D799 /* HIQRAttendeeScannerSelection.swift */; }; D158EC332B5A2DFE0003D799 /* HIScanPointsShopViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D158EC322B5A2DFE0003D799 /* HIScanPointsShopViewController.swift */; }; D187BF582B781A1100AD7356 /* HIShiftCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF572B781A1100AD7356 /* HIShiftCell.swift */; }; - D1BBA5682B70AB940017BD13 /* Staff.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5672B70AB940017BD13 /* Staff.swift */; }; - D1BBA56A2B70ACCC0017BD13 /* StaffService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5692B70ACCC0017BD13 /* StaffService.swift */; }; D187BF5A2B78317600AD7356 /* Mentor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF592B78317600AD7356 /* Mentor.swift */; }; D187BF5C2B78318000AD7356 /* MentorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D187BF5B2B78318000AD7356 /* MentorService.swift */; }; D19D4C932B794F9100376E1B /* HIScanMentorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D19D4C922B794F9100376E1B /* HIScanMentorViewController.swift */; }; + D1BBA5682B70AB940017BD13 /* Staff.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5672B70AB940017BD13 /* Staff.swift */; }; + D1BBA56A2B70ACCC0017BD13 /* StaffService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1BBA5692B70ACCC0017BD13 /* StaffService.swift */; }; D1BE81172AC8FC680042C078 /* HIAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 95E3142A21FAD5B30092C22E /* HIAPI.framework */; }; D1BE81182AC8FC690042C078 /* HIAPI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 95E3142A21FAD5B30092C22E /* HIAPI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D1C5B6582B732E44000E766D /* refresh.json in Resources */ = {isa = PBXBuildFile; fileRef = D1C5B6572B732E44000E766D /* refresh.json */; }; @@ -358,11 +358,11 @@ D158EC302B5A2D440003D799 /* HIQRAttendeeScannerSelection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIQRAttendeeScannerSelection.swift; sourceTree = ""; }; D158EC322B5A2DFE0003D799 /* HIScanPointsShopViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIScanPointsShopViewController.swift; sourceTree = ""; }; D187BF572B781A1100AD7356 /* HIShiftCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIShiftCell.swift; sourceTree = ""; }; - D1BBA5672B70AB940017BD13 /* Staff.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Staff.swift; sourceTree = ""; }; - D1BBA5692B70ACCC0017BD13 /* StaffService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaffService.swift; sourceTree = ""; }; D187BF592B78317600AD7356 /* Mentor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Mentor.swift; sourceTree = ""; }; D187BF5B2B78318000AD7356 /* MentorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentorService.swift; sourceTree = ""; }; D19D4C922B794F9100376E1B /* HIScanMentorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HIScanMentorViewController.swift; sourceTree = ""; }; + D1BBA5672B70AB940017BD13 /* Staff.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Staff.swift; sourceTree = ""; }; + D1BBA5692B70ACCC0017BD13 /* StaffService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StaffService.swift; sourceTree = ""; }; D1C5B6572B732E44000E766D /* refresh.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = refresh.json; sourceTree = ""; }; D1F146392B605C57004E7FC9 /* Hack_Mushroom_Loading.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Hack_Mushroom_Loading.json; sourceTree = ""; }; D3A309BA221116A600CBA351 /* HackIllinois.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HackIllinois.entitlements; sourceTree = ""; }; diff --git a/HackIllinois/Assets.xcassets/GrayPotion.imageset/Contents.json b/HackIllinois/Assets.xcassets/GrayPotion.imageset/Contents.json new file mode 100644 index 00000000..75944daa --- /dev/null +++ b/HackIllinois/Assets.xcassets/GrayPotion.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "GrayPotion1x.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "GrayPotion2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "GrayPotion3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion1x.png b/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion1x.png new file mode 100644 index 0000000000000000000000000000000000000000..0e2445204d0b54e6b85f503115d1fd0a78217b9c GIT binary patch literal 1803 zcmb`I`#%#3AICRlW+K;`%do9*T#rjgI__rfgol(^bKBh7geC_Qa$2NvTM@#L3@Z+D z88tlQxIYt`OLAA39CCS_=Wlp^_~wQ@V5*NJ=} z;FGxvw4j|pDALxO1ONz2{v#lO_8fK+0!eOY3qZ|){PM{H3Nm*z2LS3ag%A7%003|i z#>(717PwyE=q!hZC35q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S7W$9%6x6^^Ytdar`~O&) zR(s||#A4%g-gB)ZZ6IH%V*N6RJUxqFgYNkaKv>Vk|JSeo|6wy?%iC+<;cP0kinVt4 ze)w1z91R)hT>cTLs?C&JD2fpZKQ*1Su9SM;_{tED?CpQh% z(@RGKAK=V?7t^p_kz=bcN=WRhF^+%S`Z0@eN@!O0Y4$OXjuIjm(P&K*pZ31&kw=^n zekIdS>Q>HqhJwUfdX~d8N_&2}T#mkt#*`j)n9gQb#1|d|E0odm_x(56C%+4Tv39bm IvGAk(7r=%_h5!Hn literal 0 HcmV?d00001 diff --git a/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion2x.png b/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion2x.png new file mode 100644 index 0000000000000000000000000000000000000000..28724cb08548385aca2c32458916989189909a78 GIT binary patch literal 3254 zcmdT{=R4aC8~vfJS~Y641jR!Yl@6n=Rjt|*6}814p%r_@C~DTIDq32q#H_@s6cNv_LFf57|UT<0F&?(3X$U3a1}M2CY_kQD#`4n18hlT*f?qW=83 ze=37%sZ(O{*0uBl0Dj4Tz@TUH*XHSv!OukJ0f6ZTt(-Pz+%%0e0iZgK?a<*Y0I(bA zX=$1UGptWr8-hr}MB2%_3AQFVWxt!_TuiBAodNRa8XlW=r*4@^W|};DoS|B`%Jih1 z@F?7CWT_GP#JR$E=7)YIZ<$`MfVmG^Tkom6jmoS0>|#=j5pEOoUjO4Bv<*MXH7IK{ zen!XY`da^N$Fc7nlxv`|f2$?crnHEsyog;9t6mid)t0m@zeO)FxvI2o(hz7(!uOa{ z2(|?NwUg(uptQ6#a;h1w_H$=STBgg)FSa5jHEQjy(O`5aEfj-A*-P{Ehn_sB6<*A6 zzTBrZd9g#&=VMZPP0q?7Orq`}rOICC8P_pCvQ9Cp@|FAO+f{(fX zTfpcNsRw?%Y02|l=fU)$xYhn*X2IglMf50zx7a&T+bBSCrx{WOlXEbZLkurFN4sX5 z?1aBo7q)4P^fe%a!sPI z*D=R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EaD zP`BHqOoj=3e9M{?bd+4xC(Bx~^b3<0*56|fbeas-Ma_s+PnlStUjBNy34Ap%#&g~~ zO4otEFJ$X9HOAlO4CWLZ2pM_D&cJJ+N!uE#7Q!(HfxO?o&Fc|yVUjM6j>P|xGnQwQo?`3aB7U`QC@@lrMxj{;vc)iTFf!4@9A`e8BiM=)zn?=T>AMT9vg8y{cb3 zwb4i%g*Cj_SV0@emD6_01E)#8QC#-7CW6No1OA9G@J=jo&rCsZ0U#<}XSB>1Sbit7OSkPO*dg_Yy})(AVMF77wT>hUYm^ zigDEu`T_**ma)519Lv-{?}Ai3081&XN&;!Ud!sHQm!{X+r#)7dx5OK^>BX%BHyL9D z?vQ(kN0^dAa^(-sevTOrSn*?R`J<<*NBXvtt7CG$&0vrhetS~X3`ww_4?2R`z|2+) zGi-xuDmac!6|n6ss-t!)Ji&_Po>ZRaOnAr6!u6>y1kx5u_T_65s9w!VjaSs=CXB2; z$AFx3KGHd^2Kxr;LD~)gSb;XE;dxNu_XTh#1i7OJ%jg0?Wp!8BIE;ozSI12t& zFKDc|tdd-HFCZgzg7{J5{DJpu`rkF#Pj72IrpF$graTj_XY@~A0(Lf|DY&s}Tu^Y? zyaaaGFnQ?g28CM4lBN{;$Wwk(fXKH|#dea-?ag$LB&bEhQL`4A!`+SjI$wkEA9o|^QrL00G~XJlg_Bhnw?gZY8hu~ z1fW`nw_Tdiq5gCQho<cqfCiZeMF>~+Bu}3{Z0BpX6=^X4D}xiJ?H1dB!1zBkr*8(J_Xwhe Id0-#?Uz}!B-v9sr literal 0 HcmV?d00001 diff --git a/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion3x.png b/HackIllinois/Assets.xcassets/GrayPotion.imageset/GrayPotion3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f0c3da79da01021908238459a10b41c6b4ad718e GIT binary patch literal 4803 zcmeHLS5VVml>P;f(5v)-L{J1oMG~r^M35q2sD>JffOJB~fCNw=2mu9^DugCQni%=h zm0koyK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9RgfETM;k*f)2Jz;S8}^@)znP|VXW0tz1J)h}mBv2ii`UK|BGCP?Z^u;n#V(9u z3oc^uQO%waXZDfbgx{KFY19~Mt@fv5|5K1tRI_2HxLaSwnSMdFb4p$In~9@dRk>l+ zA;)&k*US#TH7JL72UR>-?BY!#6lUr>8*z_9q`$fEN~V5(cqO1jEDAuWi9FVlS3H!Y1FiY| zY|HZsMS#g_^D9vu?qn1c2!3h!!>Rt-rC2Xyg;qFrFD5D*-Aw18Yo@U_fDA_FDAr8k zl#<%Zzz+}X>-cIJ(_H~IGx=YG=LByknKU%M&6exdGFj#F<~@kIMl59DBCaR$8+gld zl*coC{%d}AtqHM9MPSO8zLh4-ReQjBR`R5aMKqmJYIrFGvF(Z8e6|eo28H^1pl$p$~$~Jz27tFLM;N%u^>aRS_w$`K=d$Bx!f6 z_k0Awn&@?HL$z$)Mm%LOLC2qH_Kx*2x@EFwp?2%*y9jp`1;y(;Jw;;UhkWs2&&kgg S?f>050s1<|+LcI$=>Gsy497(P literal 0 HcmV?d00001 diff --git a/HackIllinois/Assets.xcassets/GreenPotion.imageset/Contents.json b/HackIllinois/Assets.xcassets/GreenPotion.imageset/Contents.json new file mode 100644 index 00000000..c7479437 --- /dev/null +++ b/HackIllinois/Assets.xcassets/GreenPotion.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "greenPotion.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "greenPotion2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "greenPotion3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion.png b/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion.png new file mode 100644 index 0000000000000000000000000000000000000000..7783e5e065a592a0ae27c3117663ebd1c2a43d41 GIT binary patch literal 1813 zcmchY`9BkmAIB$Wu4=BZ@M&T0G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n$NKw|v6B}y*jt9vf>#9QjtL*k zyskSPZYM(g3gN2vlp^%BaQG_frJ2cB_zxywq@4ZLz|4Vf((p;ag4i5kJS=P2UcD}f5j;S)&7E<4v2GcKpTfOb^RRz z71Y7)O|4ATr_-#gwi!EeRt^fO6+s51!jeb#7p#x?JKNBfT2Vs}IV}dTvvsm*w)Ri` E9|ERfEdT%j literal 0 HcmV?d00001 diff --git a/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion2x.png b/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5e77a4c177f661fb65b23c3cf5b331770b62ad8a GIT binary patch literal 3316 zcmd^C`8N~_8=jez31f+}#8@JA$-eK6vNa=2mUJyOcA{(Sh=Ka7N)@0IeP5*N>XOFb7K*pk_q!$C2Rjy^OdF0Muc4 zIk%4{_>!%!T)q(nT&24O-TE%oyKxwnhFP7wzpB-BckB(M6yi2r|2gs=<@u|}I`0E0 z*y2+Y!ZNFoUq9C9_y;+U$xn7SA}#pefsv`X{&1 z*R6;C^dbKhkw3f_J@+7_66aZc8tM{r$QtV2b;pvEbp(oz$WVIC@l2364zTL zk%$3!<_~It9HiV)q6ztRqG+IT?6ZGr2+P3hmqUC_XfCFAs4VS?!t*Cy%R~nf-IKoP z!K6tt5>uYwS35P><3Tx`W;?B_;-6Y?Y#Ae7gIRYi2+MGyR_luZWi~Xf2(@dn@O{0l zfs)&1R(ZzK`0U=D_mb?T!$zia{t|y9zUdN%xf9>^V|P@EN7j7%F~*5$iO&L&EVk~i zI+0H?%V?#8CI=KYB|=(VQ3#JVqJCeeH0|ADsOsG~4%-Hr{1H#pBrY77?xV1t60q%L z3|X>z<-_o|a~o#OR%#I0JuZ)AR+XU}X}D6vcLXE&HKD**n!VB~W=z)fL1^<#cHH8U z-5Y8tqIYE85zldD@yWSEVJBo+kpYykF=5h|t;@c_%81z)PI;vWfwdo;@uK*d#`wcH zk6%}JHwE{elF6d@>~ztdM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1 zJHk)^=;9ZD$&(U!ywbJA?p=M$d*u!yi_}G9EM2d`C5Vs&nmB z3oFi?^%+rgkKW{j54qdQf$nu8``!|S!e~13CySv*PhYE~)*eK~ZS?|i-N-)9Y>y4o zGtM+V;i8#w)XY?V9P=N9!Kda7SUn8q-eYfA)q+!Q+b|zFJebn}8ePzn0m01rWVoL2 z{lC)eRH9wxv`)i~8tF^`uqiWDhq6(??T?gKf8f!qW-HCvG1V$rtS(fOOHhjW9qYgI z^0-i#_40D|wq(gYvyy07->gk<4?)CLmKx=ads+V9hP^7`pozFUKc0x~$XZ49`5RxMxnq>aQSz z>sPH#^Og%mD6bx{rv=qDSMT9GX#Ba4&3yeb&6g%DmF1E$9 zH$F{#XNe!3DLqYqog zS%wU83X)^`2w*gu0**15JAcR8K6I_|J;IScN#x_)oM-g{%aglEv$ATAq?ol*eUwf? zQfmGRfP9vWp4XGOkIr3vmmG)Jm2~#D>PAiDyQVj;VY!X|v8X7xk%N8&aB8=lZ4i&9 zA=_`ldBId(2&|5!$(ZhPpCcnMl|NZ+)-mjV1uE9P&JEa(Tm9^=Jd8I(^kc0he{PsIg zBNxAbyRC~0Nz!J;^!rD;bCEk*CSSq zdL#RoQU>uRXT0&3-@W=GkKlC`UIzo4%GD|YI%G@@vIp}QMNFsR{3IT6SS5hejZ-ac?#K|i_SfIQUKOhZLie8JRkoD%=1H# literal 0 HcmV?d00001 diff --git a/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion3x.png b/HackIllinois/Assets.xcassets/GreenPotion.imageset/greenPotion3x.png new file mode 100644 index 0000000000000000000000000000000000000000..743a1bb09ad9dca4bd91988c5a5eac1ef2a47745 GIT binary patch literal 4896 zcmeI0S5On|m&Owe0*O>16se-35Ghgwlp-w@Lq~#05fCs^L_m;kp*InP5C|YeLopCV zlo}916%Yx%NjFFcMLHzw_ut)_z1Y3knZ4VKGiToCIalYLnctZ=-rN+<4i*9f004F) zLp@6X00{XTP}Y-w6+e*={C^YMLqj`%06;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l)W@*uGUP>6 zhQgKWlN4HJHCt359P6b#IiOIih(SLXB3zUdYCd>lz?12n>M+rCyo8dps98d0lzJwa zA(YRIdBx7F8Uf9(l5_Ril%#Isox~1zX_3Ujzz5PPq&tfbgQIo2zq!4-8OJol_jj?i zywD$DGN<*#m%vI;h{kTBlU|Jawe)!8w}hofnO7B0f4ZEgTcxc%mu86PN}U)Bn_d$Z g>IMnMM$^USqA;aCTZ&)*erN%V^iB2fI?m7j4dXZ&Q~&?~ literal 0 HcmV?d00001 diff --git a/HackIllinois/ViewControllers/HIScheduleViewController.swift b/HackIllinois/ViewControllers/HIScheduleViewController.swift index 85ea1672..31750b72 100644 --- a/HackIllinois/ViewControllers/HIScheduleViewController.swift +++ b/HackIllinois/ViewControllers/HIScheduleViewController.swift @@ -18,6 +18,9 @@ import HIAPI class HIScheduleViewController: HIEventListViewController { // MARK: - Properties var staffShifts: [Staff] = [] + private var labelColor: UIColor = .white // Default color + var hasSelectedShift = false + var segmentedControl: HIScheduleSegmentedControl! lazy var fetchedResultsController: NSFetchedResultsController = { let fetchRequest: NSFetchRequest = Event.fetchRequest() @@ -85,6 +88,10 @@ class HIScheduleViewController: HIEventListViewController { // MARK: - Actions extension HIScheduleViewController { @objc func didSelectTab(_ sender: HISegmentedControl) { + if hasSelectedShift { + removeStaffShiftContainerViews() + setUpShiftCells() + } currentTab = sender.selectedIndex updatePredicate() animateReload() @@ -137,7 +144,7 @@ extension HIScheduleViewController { super.loadView() let items = dataStore.map { $0.displayText } - let segmentedControl = HIScheduleSegmentedControl(titles: items, nums: [23, 24, 25]) + segmentedControl = HIScheduleSegmentedControl(titles: items, nums: [23, 24, 25]) segmentedControl.addTarget(self, action: #selector(didSelectTab(_:)), for: .valueChanged) segmentedControl.translatesAutoresizingMaskIntoConstraints = false view.addSubview(segmentedControl) @@ -155,9 +162,11 @@ extension HIScheduleViewController { let now = Date() if now > HITimeDataSource.shared.eventTimes.sundayStart { segmentedControl.selectedIndex = 2 + currentTab = 2 } else if now > HITimeDataSource.shared.eventTimes.saturdayStart { segmentedControl.selectedIndex = 1 + currentTab = 1 } let tableView = HITableView() @@ -191,6 +200,7 @@ extension HIScheduleViewController { } // MARK: - Staff Shifts Control Setup + extension HIScheduleViewController { @objc func setStaffShiftsControl() { let customFontSize = UIDevice.current.userInterfaceIdiom == .pad ? 44 : 24 @@ -202,7 +212,7 @@ extension HIScheduleViewController { let flexibleSpaceLeft3 = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) let scheduleButton = UIBarButtonItem(title: "SCHEDULE", style: .plain, target: self, action: #selector(scheduleButtonTapped(_:))) - scheduleButton.setTitleTextAttributes([NSAttributedString.Key.font: customFont], for: .normal) + scheduleButton.setTitleTextAttributes([NSAttributedString.Key.font: customFont, NSAttributedString.Key.foregroundColor: labelColor], for: .normal) // Add the flexible space items and custom button to the leftBarButtonItems array navigationItem.leftBarButtonItems = [flexibleSpaceLeft1, flexibleSpaceLeft2, flexibleSpaceLeft3, scheduleButton] @@ -213,30 +223,49 @@ extension HIScheduleViewController { // Create custom right bar button item let customButton = UIBarButtonItem(title: "SHIFTS", style: .plain, target: self, action: #selector(shiftsButtonTapped(_:))) - customButton.setTitleTextAttributes([NSAttributedString.Key.font: customFont], for: .normal) + customButton.setTitleTextAttributes([NSAttributedString.Key.font: customFont, NSAttributedString.Key.foregroundColor: labelColor], for: .normal) // Add the flexible space items and custom button to the rightBarButtonItems array navigationItem.rightBarButtonItems = [flexibleSpaceRight1, flexibleSpaceRight2, customButton] self.navigationItem.leftItemsSupplementBackButton = true } - + + func removeStaffShiftContainerViews() { + // Iterate through all subviews and remove container views for staff shifts + for subview in self.view.subviews { + if let containerView = subview as? UIView, containerView.backgroundColor == #colorLiteral(red: 1, green: 0.9803921569, blue: 0.8, alpha: 1) { + containerView.removeFromSuperview() + } + } + } + // Actions for left and right buttons @objc func scheduleButtonTapped(_ sender: UIButton) { if onlyShifts { onlyShifts = false backgroundView.image = #imageLiteral(resourceName: "PurpleBackground") + if UIDevice.current.userInterfaceIdiom != .pad { + labelColor = .white // Set label color to brown + setStaffShiftsControl() + } + // Call removeStaffShiftContainerViews to remove container views for staff shifts + hasSelectedShift = false + removeStaffShiftContainerViews() updatePredicate() animateReload() } } - @objc func shiftsButtonTapped(_ sender: UIButton) { if !onlyShifts { onlyShifts = !onlyShifts backgroundView.image = #imageLiteral(resourceName: "Pink Background") - //let label = HILabel(style: (UIDevice.current.userInterfaceIdiom == .pad) ? .viewTitle : .viewTitleBrown) + hasSelectedShift = true + if UIDevice.current.userInterfaceIdiom != .pad { + labelColor = #colorLiteral(red: 0.337254902, green: 0.1411764706, blue: 0.06666666667, alpha: 1) // Set label color to brown + setStaffShiftsControl() + } guard let user = HIApplicationStateController.shared.user else { return } @@ -248,9 +277,13 @@ extension HIScheduleViewController { print("Staff shifts: ", self.staffShifts) DispatchQueue.main.async { + // Set up shift cells + self.setUpShiftCells() + // Update predicate and animate reload self.updatePredicate() self.animateReload() } + } catch { print("An error has occurred in getting staff shifts \(error)") } @@ -258,6 +291,106 @@ extension HIScheduleViewController { .launch() } } + + func setUpShiftCells() { + // Get filtered events by date + let sundayStart = HITimeDataSource.shared.eventTimes.sundayStart + let saturdayStart = HITimeDataSource.shared.eventTimes.saturdayStart + + // Iterate through all subviews and remove container views for staff shifts + var padding = 0.0 + // Iterate through each staff shift and add a label to the container view + for (index, staffShift) in self.staffShifts.enumerated() { + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss Z" + let dateString = staffShift.startTime + let calendar = Calendar.current + let dayComponent = calendar.component(.day, from: dateString) + var curr_idx = segmentedControl.selectedIndex + print("Day:", dayComponent) + print("Current tab:", curr_idx) + if curr_idx == 0 && dayComponent != 23 { + continue + } else if curr_idx == 1 && dayComponent != 24 { + continue + } else if curr_idx == 2 && dayComponent != 25 { + continue + } + // Set fixed width and height for the container view + let containerViewWidth: CGFloat = 340.0 + let containerViewHeight: CGFloat = 130.0 + + // Create a container view with a yellow background + let containerView = UIView() + containerView.translatesAutoresizingMaskIntoConstraints = false + containerView.backgroundColor = #colorLiteral(red: 1, green: 0.9803921569, blue: 0.8, alpha: 1) + containerView.layer.cornerRadius = 20.0 + containerView.layer.masksToBounds = true + + // Add the container view to the main view + self.view.addSubview(containerView) + + // Set up constraints for the fixed width and height + NSLayoutConstraint.activate([ + containerView.widthAnchor.constraint(equalToConstant: containerViewWidth), + containerView.heightAnchor.constraint(equalToConstant: containerViewHeight), + containerView.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), + containerView.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 275 + padding) + ]) + let label = UILabel() + label.text = staffShift.name + label.font = HIAppearance.Font.eventTitle! + label.translatesAutoresizingMaskIntoConstraints = false + + // Add the label to the container view + containerView.addSubview(label) + + // Set up constraints for the labels within the container view + NSLayoutConstraint.activate([ + label.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 15.0), + label.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: 20.0) + ]) + + // Add time, location, and description labels to shift cells + // Time label set up + var eventCellSpacing: CGFloat = 8.0 + var locationImageView = UIImageView(image: #imageLiteral(resourceName: "LocationSign")); var timeImageView = UIImageView(image: #imageLiteral(resourceName: "Clock")) + let timeLabel = HILabel(style: .time) + timeLabel.text = Formatter.simpleTime.string(from: staffShift.startTime) + " - " + Formatter.simpleTime.string(from: staffShift.endTime) + containerView.addSubview(timeImageView) + timeImageView.translatesAutoresizingMaskIntoConstraints = false + timeImageView.leadingAnchor.constraint(equalTo: label.leadingAnchor).isActive = true + timeImageView.bottomAnchor.constraint(equalTo: label.bottomAnchor, constant: 25.0).isActive = true + containerView.addSubview(timeLabel) + timeLabel.leadingAnchor.constraint(equalTo: timeImageView.trailingAnchor, constant: eventCellSpacing + 1).isActive = true + timeLabel.centerYAnchor.constraint(equalTo: timeImageView.centerYAnchor).isActive = true + + // Location label set up + let locationLabel = HILabel(style: .newLocation) + if staffShift.locations.count > 0 { + locationLabel.text = staffShift.locations.map { $0.name }.joined(separator: ", ") + } else { + locationLabel.text = "No Location" + } + containerView.addSubview(locationImageView) + locationImageView.translatesAutoresizingMaskIntoConstraints = false + containerView.addSubview(locationLabel) + locationImageView.leadingAnchor.constraint(equalTo: timeImageView.leadingAnchor, constant: 1.0).isActive = true + locationImageView.bottomAnchor.constraint(equalTo: timeImageView.bottomAnchor, constant: 25.0).isActive = true + locationLabel.leadingAnchor.constraint(equalTo: timeLabel.leadingAnchor).isActive = true + locationLabel.centerYAnchor.constraint(equalTo: locationImageView.centerYAnchor).isActive = true + + // Description label set up + let descriptionLabel = HILabel(style: .cellDescription) + descriptionLabel.numberOfLines = 1 + descriptionLabel.text = "\(staffShift.description)" + containerView.addSubview(descriptionLabel) + descriptionLabel.translatesAutoresizingMaskIntoConstraints = false + descriptionLabel.leadingAnchor.constraint(equalTo: locationImageView.leadingAnchor).isActive = true + descriptionLabel.bottomAnchor.constraint(equalTo: locationImageView.bottomAnchor, constant: 25.0).isActive = true + padding += 150.0 + } + } }