From 888cb9612d4d19d92deb07d7e7a18b1554c91778 Mon Sep 17 00:00:00 2001 From: Ted Work Date: Tue, 14 Apr 2015 18:14:43 -0700 Subject: [PATCH] Fixed Deprecations This sync fixes all the deprecationscations that were in the previous version. --- .../Resources/CalendarPreviousMonth.png | Bin 0 -> 925 bytes .../Resources/CalendarPreviousMonth@2x.png | Bin 0 -> 931 bytes TimesSquare/Resources/CalendarRow.png | Bin 0 -> 1068 bytes TimesSquare/Resources/CalendarRow@2x.png | Bin 0 -> 1267 bytes TimesSquare/Resources/CalendarRowBottom.png | Bin 0 -> 1070 bytes .../Resources/CalendarRowBottom@2x.png | Bin 0 -> 1270 bytes .../Resources/CalendarSelectedDate.png | Bin 0 -> 1037 bytes .../Resources/CalendarSelectedDate@2x.png | Bin 0 -> 1247 bytes TimesSquare/Resources/CalendarTodaysDate.png | Bin 0 -> 1042 bytes .../Resources/CalendarTodaysDate@2x.png | Bin 0 -> 1242 bytes TimesSquare/Resources/Default-568h@2x.png | Bin 0 -> 18594 bytes TimesSquare/Resources/Default.png | Bin 0 -> 6540 bytes TimesSquare/Resources/Default@2x.png | Bin 0 -> 16107 bytes TimesSquare/TSQCalendarCell.m | 2 +- TimesSquare/TSQCalendarRowCell.m | 10 +- TimesSquare/TSQCalendarView.m | 20 ++-- TimesSquare/TSQTACalendarRowCell.h | 14 +++ TimesSquare/TSQTACalendarRowCell.m | 42 +++++++++ TimesSquare/TSQTAViewController.h | 16 ++++ TimesSquare/TSQTAViewController.m | 86 ++++++++++++++++++ TimesSquare/TimesSquare.h | 6 +- 21 files changed, 177 insertions(+), 19 deletions(-) create mode 100644 TimesSquare/Resources/CalendarPreviousMonth.png create mode 100644 TimesSquare/Resources/CalendarPreviousMonth@2x.png create mode 100644 TimesSquare/Resources/CalendarRow.png create mode 100644 TimesSquare/Resources/CalendarRow@2x.png create mode 100644 TimesSquare/Resources/CalendarRowBottom.png create mode 100644 TimesSquare/Resources/CalendarRowBottom@2x.png create mode 100644 TimesSquare/Resources/CalendarSelectedDate.png create mode 100644 TimesSquare/Resources/CalendarSelectedDate@2x.png create mode 100644 TimesSquare/Resources/CalendarTodaysDate.png create mode 100644 TimesSquare/Resources/CalendarTodaysDate@2x.png create mode 100644 TimesSquare/Resources/Default-568h@2x.png create mode 100644 TimesSquare/Resources/Default.png create mode 100644 TimesSquare/Resources/Default@2x.png create mode 100644 TimesSquare/TSQTACalendarRowCell.h create mode 100644 TimesSquare/TSQTACalendarRowCell.m create mode 100644 TimesSquare/TSQTAViewController.h create mode 100644 TimesSquare/TSQTAViewController.m diff --git a/TimesSquare/Resources/CalendarPreviousMonth.png b/TimesSquare/Resources/CalendarPreviousMonth.png new file mode 100644 index 0000000000000000000000000000000000000000..35edb79a4eef64a8f5df3adb3577f66b267e387b GIT binary patch literal 925 zcmaJ=zi-n(6m|`V49rN}rE$tYux#JGr|vo>*?>*R)Bx&D0vwM8q z5#Q}y{=dxnKlpN=IYZVbW0oO`rA9zT7`PFd;2uW7;?*}?m!umH!@-aZy=TxTk%9z9 z$)kj`C8>UrC&-^+21a-i#+Ll^%U2nMfhE7FdYYHC@H9MIQrus52L5v9*8=(E38?3g z3q+V9kVofn3Uf=2%A~*RZ>H*3tEI?P*ut$U(sH$0(DOp(|bfW6DT1{veMu{Uz=^|z* zFU9FWp;0;aijw1dH;t-(FUEe z9=^`^pTg;2kzlolQ!=MMZ`}Amgi2tGV#Ej?5OQ8ru{$M96nA8UYz&;6`YQ`xphQXJ2q#k_vaj;fRgA$IvH{f&@m% zqJ*<0seYOz$e&{d#&{aWwtVs7vkbz(mY-BT%}ZK%7M`ss9;~}Ve?9lDKt6p4>KWt$ z5oQQv(RrN0%$7I0kne?CmB9wW=C*v9)X3|B7NHnam2%0~bRC$cqF1V>sXqXQrW>lp zU$dlFVAX`i3D`a|k4A$D>^q%pENTLHz|rx32ae}7@CtGDF_`*S(j%T;+Ys%Y(Bt%@Ij-@;A4qg|3Ui=W(#%*_<_syp- F{{SE(98UlM literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarRow.png b/TimesSquare/Resources/CalendarRow.png new file mode 100644 index 0000000000000000000000000000000000000000..990588162b8dbc42668caf47f76a987d0ef7eddc GIT binary patch literal 1068 zcmaJ=&ubGw7~Ql|+S;NXgsLFpR-sC>znW~CrQ0^mq&DEzkVcwQ>1KD*EbZ>ByHm5R z2tiR0`X31X1A^eWhbnkb>cLYLFXFWbdbSs5(j@iJxa_w(^YPyM-pqXSys&tCc<}Nd z$8p2?1z6;`*eo3j{XO)1@Nn6pze^-nCQGSlnrjEyS@QO#M{4$#u} zV#(TGx6(F0GYzI9jS9Gkm>_aDyikjDzNxFxF-wa)XhO)k&L5j98wHTX0Rl;3B5p~t z3{+K+6G>H-$AKcriYU=njmrrwscK3Jv>u*T3+$>^g!8Rhbf)t)LVQgW>-D-&pAc}c zCd%n_nrSFXoFd}kmPgDe?uDam1&Bf`aD3um4=_cuf;WlIQ>VvEaQ%*~7q+&EZkQOE zz9IrudT`ZIR?6410Wt{=N*Hgncd<~z z1cx>3gY1$D#thSPJeIiGWEh5)_d;TN7Rp1Nry7Fe*qWSzs+!F}C6$_&<(x7(C&@XO z%cRn30!r#!n+vhE=^~G`x%LS+*Okkf!S!inhyv#UvgZTrg65(%=M*oJqRLQ7bk}Qf z?e1Q(UA>6ZjL44mpQCQ4X#cQbr*Y||)B4Dx{T|T9ejk5vm0pUMd6+3h-+msv8)y`U zVCLeHIQI0>^h)C1hra5qulr}yuMW9qhmG&twTbaJ_QB5Xm6fCX@CSTMk8pjhllH_-3ByNwv9|M~Rg@WY=u0whN literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarRow@2x.png b/TimesSquare/Resources/CalendarRow@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5446039ff7030da5eb6755334a5c56b5738cbc62 GIT binary patch literal 1267 zcmd^9&ui2`6dv14Tdh{bgW_RK1r@sa)lIe=x|Z%{)2^6Ow+k*e4Q(=MGIi5l zEP7EYBKQaFt)K_bLI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%}_24Hw34lKKZ2%JUpuCH^u&tGuRb#(4Z(v-{~i^}f! zN{FUcCW`h-#ZEii$T>J1Ym~r4#DcN6;73}lb9G*gj+tBJU_FFXbZ)Pxk~sylI7Bch z4Dz-l%TQGXIgwOV`7Bf;}KoMRFZF+EX11wdbWkX~U92PNN zXm)X`j0uj)IDpw{6`nRN+x3~_OdVmGTHcR{<=ZH4=p5w`T-VVgMU@RDF{GqYW3rr6 zhDIehXXG-ew3;v^b+m~!u)X9VpER+~J~rJJ%f#RXG_!$1_a<`2LhQl%rZu;HEoxi7 z2G(g`OR6naq{WErX#Y6sridv_`VA7eUjG09 literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarSelectedDate.png b/TimesSquare/Resources/CalendarSelectedDate.png new file mode 100644 index 0000000000000000000000000000000000000000..ab2f830d8d400a04258630cf42331b33f24948ee GIT binary patch literal 1037 zcmaJ=Pe>F|9G?ECpc$PCjA4{aY-e`%&#W`L{@I;T7afyzqa}$PXP)k;GjE!Cy5nM4 zB1DixL68x3EFrpdil8E-h$s;1U=Y#4LmukT#Y@neb$9KsHq6X>zsK+Ue&74O?_C?{ z@2;vmR!I;IyE=~$b_Mcfh170nTzj0 zD?#k3*HdYfmiq)18noi&(5_)&G(ohsyOyF(07Q;}G2M((zn;IONL`CkXT!2zw&Eb8 z_vCCanCnlexe1lmsP;Cp)fF&-0gytv#-!;8Zj{RN3V7}6R6om-97nUEFvqc{$bg>>Fn;`UJ~kwTIUx`s3lD{>+1jX(6uSzwa1^C72w4Kd zWV2a18>FE<#;`okdmMp)4`=wC851e4&vfdF3?gt;Tepx7P10jjM&J~RQdsHM77VLI zYdVEC;f67;Vlgc3_qJ3_l;!`Y8b&GGK}oQ!w=A)fny~^^fP@OV>iHcZl8ynsc>zTo@aAgtL`ZUnGY-o`AO$&M% zEj%9ybCIBk`LGAdY1zVRWwaEq(vDaLi($N@{pYBQOV~f&v}9Zyl&lX->~|X*TUZ`? zh%d!lLhMYrUuJLgR(EvNhzCBbG>G+&n{N+2TV9#pT%2RmHRG#GpL$Q9X-eGvVLn>A zAG=q3u7S<2r`PumZ?gQA@$@ZUyyf%0;|o>9*Tt0ipf7aCxp4T!>;0GC)J|7?{P`6A xVPj1T@2|HUs-BIVU)xwc()PW2ZR66n6R(J?jndofE;Hv{(1g@4K8X#_{{<0^OlAN8 literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarSelectedDate@2x.png b/TimesSquare/Resources/CalendarSelectedDate@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..ffa18cc9dde1fce5d630b2e61c9cc76510a43f0a GIT binary patch literal 1247 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1SD^+kpz+qk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m{l@EB1$5BeXNr6bM+EIYV;~{3qaZ#Z0suv5|gu2OB9k) z(=+pImEP~(ucVNfVyhHx>TBRz;GCL~=}}db8eHWUl3bOYY?-2DZ>L~WVFffGH?<^D zp&~aYuh^=>Rtapb6_5=Q)>l#hD=EpgRf0Gw!Z$#{Ilm}X!Bo#!H`&0@P{GVh&(Orw z%*;?n!N|bSNZ$a6%ybP+tW3?UjLa3FKnZADQA(Oskc%7CE+EfVDWjyMz)D}gyu4hm z+*mKaC|%#s($W%ShLMpjP=#)BWnM{Qg>GK4GRy>*)Z*l#%z~24{5%DaiHS-1r6smX zK$k+ikXryZHm?{OOuzusuShJ=H`Fr#c?qV_*B8Ii++4Wo;*y|LgnO|XTpUtakg6Y) zTAW{6lnjixG-Z%g1y;^Qsfi`|MIrh5Ij~R+$jC3rFV4s>P;d@5Q_%2DOwP;$321_K z`1)FT<`tJD<|U_ky4WfK&CtutOtG@GG&eOfH+C{Iw*-c}tC5A1fuXC5tE0K4nTd;m znG;N}OMY@`Zfaf$Om7N8uQN`)pu~_{0JPa9wJ5VJHN~wcKUV?lX{$`!Zn4B^9#n4% zZnrq%)TkpMZknDeX3?I0|R5Ar;B4q#jQP) zbNvn*2)Jy1ooknIly!$t_@iqV%>3SbxW<>O;d(%RQD|u7=RM!vM9iBPzvXuJ?*+RZ z*NS>MDPM}&*Q&2ueCA5YsgE;`n>Ta*O@6`07yUfq#@(b$ts5K@u0$CBI?!^^Gn1W{ zHF$55W%E-J(|MEF?yH}FmcCf=?k{J{EPk~`v(x%cmYma`Tq4)|`^U`}&bQ0-MYX#` zPoFgWnXt^b!*gTf=F0i8>)#geZ@y#FWq5f;_q`j(N@pi^r!{w~NN|1*RX%vf#B1vB z3rBumx$kX0<7oJwLlL20q>umm^jAOa%+coZ^ScFgHK&MMhh*0cS=&bZCa zeEYhMe5B$9ngTe~ HDWM4f9?ih9 literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarTodaysDate.png b/TimesSquare/Resources/CalendarTodaysDate.png new file mode 100644 index 0000000000000000000000000000000000000000..35518261993ffdb284b57802bf65c7edae73f447 GIT binary patch literal 1042 zcmaJ=Pe>F|9G)~n1)+j6JIG@UQE2DS>dv}@ljzQ>3(X?CYwe*!3F%_uh~1`+k4l`Qg}L zW5dA)ilQ2$Lvoy~_1;%kL;h%eevmB9IFiB%G=}r41F1e8jY1GL)ijJlRi7MRggq2h zd&o$pa7sBUYRF_%55p8po3JUWr?+6MS{7n33e$!q(O(`trGcSK^znegDRvlUjG-w9 zCZ=LZZ7QpUbh`Hl=qZRqz=T)@1v6*4VnL#dx+2+oW|js;2+m6MR!}Kr7=)1nL4fJ> zX&lc3L16f7j`?M;{a8@<7QKIZ1Q|V_Rg|d_K?Q zI~nApSw0jBc^ZDdk05;Rq=nUj&vIMK3Nmyx$FQ-1EZ`}sqi6z4G>LR81=Fs`T5hRK zq+o18wOO9wyp+m7MfpF}G%IKq$KiIo{}gtUlQv}I&_xrDMjAKP>bbJTume?$oFqcI zautU&2qQOxY!FTepj}Zl!}1IrMTVk?QOm`urNO8y(L{qW3|$O`f&n4e8T1E3r0x-a zcR$BRkWfx6VEbqj8jk_aF7X#NsC7HSOQh` zN?g5qEJ9T-OM+p&*8bJ%vWd)(x2+5=IaEd;T4dfGGT6$}%2jeH=Av?6vhZ&DqO^CG z+dc3qce<_p`o1&iwVH(wzw7oV@4dJ*_j2ty&~{k!%TL};e{8Y7o%?!!A=WW6)Asq= zvjb-z0A}UQ_sf~Y`zy=ckAJLoaI4-J4;j{pDw literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/CalendarTodaysDate@2x.png b/TimesSquare/Resources/CalendarTodaysDate@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..e54c1a8a868124e3b0fe379fd54071dda0d42ce3 GIT binary patch literal 1242 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1SD^+kpz+qk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m{l@EB1$5BeXNr6bM+EIYV;~{3qaZ#Z0suv5|gu2OB9k) z(=+pImEP~(ucVNfVyhHx>TBRz;GCL~=}}db8eHWUl3bOYY?-2DZ>L~WVFffGH?<^D zp&~aYuh^=>Rtapb6_5=Q)>l#hD=EpgRf0Gw!Z$#{Ilm}X!Bo#!H`&0@P{GVh&(Orw z%*;?n!N|bSNZ$a6%ybP+tW3?UjLa3FKnZADQA(Oskc%7CE+EfVDWjyMz)D}gyu4hm z+*mKaC|%#s($W%ShLMpjP=#)BWnM{Qg>GK4GRy>*)Z*l#%z~24{5%DaiHS-1r6smX zK$k+ikXryZHm?{OOuzusuShJ=H`Fr#c?qV_*B8Ii++4Wo;*y|LgnO|XTpUtakg6Y) zTAW{6lnjixG-Z%g1y;^Qsfi`|MIrh5Ij~R+$jC3rFV4s>P;d@5Q_%2DOwP;$321_K z`1)FT<`tJD<|U_ky4WfK&CtutOtErwHFhyFv@kF-w=gs`bTzVYGB9*?adkAeG&6BA zFmr_=rzQt7nB%s3xGDeq!wkCrKY$Q<>xAZJ#CeV(=Fz%IL(9V zO~L6Fb2prN^?{Dj2SqJXRKtXT=?BDwCtM&0p7c}mfa$#mn6S^hwAN-|VD#~HaSW-r zwP&)U-w^{ISLx%P?Yu%l#~(20?ED`&VM3be`I_r6id2H*Mnm&$pqJu=6*dCt1ojF&`@Y})d)q^3Ic z2xBmRdFs54Er~4+(R&0pE>ZSSiWcNZKddz)C|ytV$@7S8+lhZyF>IWoW1h16V^>8hfG90xsY)}*~`G_a|uG+&>x@7S>oEuO|FUo}Ve z`KsifIJ=7fwyLFOTD$+!8^&_8{$2Se{`g~|MV(#Ou1MYzbv@~g!5s4^NUyI7Hm|8z z8`x|s*0kqGLW^_$>asoW!d}mQJS~s!VQ2i|EA3%#9oRp$?zq(?cdqTBp2PKpfu*uF z%1_Je4oh;BANE@q_~Na)ID7svsk-{Qa^L%`5)8`i<_%pdDg!~Kji;-h%Q~loCIE$S Bt}y@r literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/Default-568h@2x.png b/TimesSquare/Resources/Default-568h@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0891b7aabfcf3422423b109c8beed2bab838c607 GIT binary patch literal 18594 zcmeI4X;f257Jx&9fS`ixvS;&$x8J@slQFSel)6zJN=?13FB7H(lQjRkSy8x_-S~tvu2gzn1oS+dLcF#eqtq$ z%tf9TTvX?`)R@}3uBI;jzS-=ZR-Td&MHaS&;!0?Ni*#$#`n*~CcQK)Q9vAQ~TUpnI!j)a2biYK^R)M~A5wUDZhx?ULMX z3x1P&qt=trOY6P2U67L=m=U?F|5#Uj(eCueNTZaHs_ceWiHeET+j+tp3Jt9g(ekqP z2WOvfR{qV+9r+o4J5?qK>7;;^+I7tGv-i)es$X_D=EoKF+S?zsyj^oRFElP}c}JT< zd8SUs-?O?}2YD#ngKbnHgzHBcboxK_2r9l(?eNCl-pEzkJm}fY?WC*jnS?VBE4EpY zO$fEejz6fU;W2Kl>JeQBZBl-%Irg`obSlg*@4QB;Dd1H7^Oi5wvt4d{RZ!8Og?^aE z)k0$1g+V3fd(gdQ3d&q2q-FL*uy#}|bc^=VhFsl0jBgUGJ+-s3U8MK9A!YJJMxpci z5hJ%|{DwV48fZn0{n5l$N_KcSb#NKE4plB`9I6Zt=Z!~-zw0{9tg$L&Ju1F0X)Cy8 zKF;(&lJ>x)Jw(=;p~sF(Sd9VWGwFE2rnyS9!f^DZ8+aCLq zQ};>lcJ1GDLqjm6Hd>|Eabno@P`~Bn(~6^aD_#yoEH(a?Nm1S<;S+hSxI5d16^<1lEM3NPFi zkqPrpL)+ zgnseFikg`gJVBha1&7C4;O6>h=dt~`ND+;Zd?W(4v2JIb7Pt>Td42%M-Ju-XAH#Pns762L}K3 zDhvsRqN0Ni(1UrishD2YvV?4*h2iFj$+&N||Fn$4n|^NSU+o?~jq`0jVQt8T9l{7b zXiwwODFh2V!Q6sqP9S>WH$oOf$N~=d0-bqTlD61!=`&0eAP-F>XN?*|gtOXX{ zQVTWyYo4ZK0GAw!GHf|pz9`D;-bbb*5LBX*{bnz|+)$@&P9|ORM2o?95{;ejvo&r- zq8cBhTN6nn)7~W>54U)%-F_-b?YKdfk5I8MHcuzBD5)!;yv#Z&R&^y=@=>VTIMy#r zX&U<=BsPkdqcMe<_}2+>H%XKyrr5ZR8_KVe>ZqYN z^=^~TFD};;rHJ$U;{~w^hYojl4hRI@SH$^K{YEo=sg)WY87r!*7blQK&qnpDo0`Vn zkl)9u9g=mCh&ZCJS(L4yN3k0kQ zuvg$h2KEEk51T+O0JQ+r0`R>g{jvqM0Mr6d3qUOZwE!?PI7HY@CE|dr sfw?Q;rAv?G4&^^8-z_>&sWXMxvD*gPOU4CBe-*@OtE+wfmVJNyHv)PfH~;_u literal 0 HcmV?d00001 diff --git a/TimesSquare/Resources/Default.png b/TimesSquare/Resources/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..4c8ca6f693f96d511e9113c0eb59eec552354e42 GIT binary patch literal 6540 zcmeAS@N?(olHy`uVBq!ia0y~yU~~ZD2OMlbkt;o0To@QwR5G2N13aCb6#|O#(=u~X z85k@CTSM>X-wqM6>&y>YB4)1;;ojbLbbV-W^iFB1wa3^zCog^LCARe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esSquare/TSQCalendarCell.m +++ b/TimesSquare/TSQCalendarCell.m @@ -55,7 +55,7 @@ - (NSUInteger)daysInWeek; { static NSUInteger daysInWeek = 0; if (daysInWeek == 0) { - daysInWeek = [self.calendar maximumRangeOfUnit:NSWeekdayCalendarUnit].length; + daysInWeek = [self.calendar maximumRangeOfUnit:NSCalendarUnitWeekday].length; } return daysInWeek; } diff --git a/TimesSquare/TSQCalendarRowCell.m b/TimesSquare/TSQCalendarRowCell.m index 0cf087b..1952ab4 100644 --- a/TimesSquare/TSQCalendarRowCell.m +++ b/TimesSquare/TSQCalendarRowCell.m @@ -141,7 +141,7 @@ - (void)setBeginningDate:(NSDate *)date; [self.notThisMonthButtons[index] setTitle:title forState:UIControlStateDisabled]; [self.notThisMonthButtons[index] setAccessibilityLabel:accessibilityLabel]; - NSDateComponents *thisDateComponents = [self.calendar components:NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit fromDate:date]; + NSDateComponents *thisDateComponents = [self.calendar components:NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear fromDate:date]; [self.dayButtons[index] setHidden:YES]; [self.notThisMonthButtons[index] setHidden:YES]; @@ -232,9 +232,9 @@ - (void)selectColumnForDate:(NSDate *)date; NSInteger newIndexOfSelectedButton = -1; if (date) { - NSInteger thisDayMonth = [self.calendar components:NSMonthCalendarUnit fromDate:date].month; + NSInteger thisDayMonth = [self.calendar components:NSCalendarUnitMonth fromDate:date].month; if (self.monthOfBeginningDate == thisDayMonth) { - newIndexOfSelectedButton = [self.calendar components:NSDayCalendarUnit fromDate:self.beginningDate toDate:date options:0].day; + newIndexOfSelectedButton = [self.calendar components:NSCalendarUnitDay fromDate:self.beginningDate toDate:date options:0].day; if (newIndexOfSelectedButton >= (NSInteger)self.daysInWeek) { newIndexOfSelectedButton = -1; } @@ -279,7 +279,7 @@ - (NSDateFormatter *)accessibilityFormatter; - (NSInteger)monthOfBeginningDate; { if (!_monthOfBeginningDate) { - _monthOfBeginningDate = [self.calendar components:NSMonthCalendarUnit fromDate:self.firstOfMonth].month; + _monthOfBeginningDate = [self.calendar components:NSCalendarUnitMonth fromDate:self.firstOfMonth].month; } return _monthOfBeginningDate; } @@ -293,7 +293,7 @@ - (void)setFirstOfMonth:(NSDate *)firstOfMonth; - (NSDateComponents *)todayDateComponents; { if (!_todayDateComponents) { - self.todayDateComponents = [self.calendar components:NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit fromDate:[NSDate date]]; + self.todayDateComponents = [self.calendar components:NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear fromDate:[NSDate date]]; } return _todayDateComponents; } diff --git a/TimesSquare/TSQCalendarView.m b/TimesSquare/TSQCalendarView.m index 4b73585..f922f07 100644 --- a/TimesSquare/TSQCalendarView.m +++ b/TimesSquare/TSQCalendarView.m @@ -109,13 +109,13 @@ - (void)setPinsHeaderToTop:(BOOL)pinsHeaderToTop; - (void)setFirstDate:(NSDate *)firstDate; { // clamp to the beginning of its month - _firstDate = [self clampDate:firstDate toComponents:NSMonthCalendarUnit|NSYearCalendarUnit]; + _firstDate = [self clampDate:firstDate toComponents:NSCalendarUnitMonth|NSCalendarUnitYear]; } - (void)setLastDate:(NSDate *)lastDate; { // clamp to the end of its month - NSDate *firstOfMonth = [self clampDate:lastDate toComponents:NSMonthCalendarUnit|NSYearCalendarUnit]; + NSDate *firstOfMonth = [self clampDate:lastDate toComponents:NSCalendarUnitMonth|NSCalendarUnitYear]; NSDateComponents *offsetComponents = [[NSDateComponents alloc] init]; offsetComponents.month = 1; @@ -126,7 +126,7 @@ - (void)setLastDate:(NSDate *)lastDate; - (void)setSelectedDate:(NSDate *)newSelectedDate; { // clamp to beginning of its day - NSDate *startOfDay = [self clampDate:newSelectedDate toComponents:NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit]; + NSDate *startOfDay = [self clampDate:newSelectedDate toComponents:NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear]; if ([self.delegate respondsToSelector:@selector(calendarView:shouldSelectDate:)] && ![self.delegate calendarView:self shouldSelectDate:startOfDay]) { return; @@ -186,7 +186,7 @@ - (TSQCalendarRowCell *)cellForRowAtDate:(NSDate *)date; - (NSInteger)sectionForDate:(NSDate *)date; { - return [self.calendar components:NSMonthCalendarUnit fromDate:self.firstDate toDate:date options:0].month; + return [self.calendar components:NSCalendarUnitMonth fromDate:self.firstDate toDate:date options:0].month; } - (NSIndexPath *)indexPathForRowAtDate:(NSDate *)date; @@ -198,8 +198,8 @@ - (NSIndexPath *)indexPathForRowAtDate:(NSDate *)date; NSInteger section = [self sectionForDate:date]; NSDate *firstOfMonth = [self firstOfMonthForSection:section]; - NSInteger firstWeek = [self.calendar components:NSWeekOfMonthCalendarUnit fromDate:firstOfMonth].weekOfMonth; - NSInteger targetWeek = [self.calendar components:NSWeekOfMonthCalendarUnit fromDate:date].weekOfMonth; + NSInteger firstWeek = [self.calendar components:NSCalendarUnitWeekOfMonth fromDate:firstOfMonth].weekOfMonth; + NSInteger targetWeek = [self.calendar components:NSCalendarUnitWeekOfMonth fromDate:date].weekOfMonth; return [NSIndexPath indexPathForRow:(self.pinsHeaderToTop ? 0 : 1) + targetWeek - firstWeek inSection:section]; } @@ -237,13 +237,13 @@ - (void)layoutSubviews; - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; { - return 1 + [self.calendar components:NSMonthCalendarUnit fromDate:self.firstDate toDate:self.lastDate options:0].month; + return 1 + [self.calendar components:NSCalendarUnitMonth fromDate:self.firstDate toDate:self.lastDate options:0].month; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; { NSDate *firstOfMonth = [self firstOfMonthForSection:section]; - NSRange rangeOfWeeks = [self.calendar rangeOfUnit:NSWeekCalendarUnit inUnit:NSMonthCalendarUnit forDate:firstOfMonth]; + NSRange rangeOfWeeks = [self.calendar rangeOfUnit:NSCalendarUnitWeekOfMonth inUnit:NSCalendarUnitMonth forDate:firstOfMonth]; return (self.pinsHeaderToTop ? 0 : 1) + rangeOfWeeks.length; } @@ -276,10 +276,10 @@ - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)ce NSDate *firstOfMonth = [self firstOfMonthForSection:indexPath.section]; [(TSQCalendarCell *)cell setFirstOfMonth:firstOfMonth]; if (indexPath.row > 0 || self.pinsHeaderToTop) { - NSInteger ordinalityOfFirstDay = [self.calendar ordinalityOfUnit:NSDayCalendarUnit inUnit:NSWeekCalendarUnit forDate:firstOfMonth]; + NSInteger ordinalityOfFirstDay = [self.calendar ordinalityOfUnit:NSCalendarUnitDay inUnit:NSCalendarUnitWeekOfMonth forDate:firstOfMonth]; NSDateComponents *dateComponents = [NSDateComponents new]; dateComponents.day = 1 - ordinalityOfFirstDay; - dateComponents.week = indexPath.row - (self.pinsHeaderToTop ? 0 : 1); + dateComponents.weekOfMonth = indexPath.row - (self.pinsHeaderToTop ? 0 : 1); [(TSQCalendarRowCell *)cell setBeginningDate:[self.calendar dateByAddingComponents:dateComponents toDate:firstOfMonth options:0]]; [(TSQCalendarRowCell *)cell selectColumnForDate:self.selectedDate]; diff --git a/TimesSquare/TSQTACalendarRowCell.h b/TimesSquare/TSQTACalendarRowCell.h new file mode 100644 index 0000000..f8b6799 --- /dev/null +++ b/TimesSquare/TSQTACalendarRowCell.h @@ -0,0 +1,14 @@ +// +// TSQTACalendarRowCell.h +// TimesSquare +// +// Created by Jim Puls on 12/5/12. +// Licensed to Square, Inc. under one or more contributor license agreements. +// See the LICENSE file distributed with this work for the terms under +// which Square, Inc. licenses this file to you. + +#import "TimesSquare.h" + +@interface TSQTACalendarRowCell : TSQCalendarRowCell + +@end diff --git a/TimesSquare/TSQTACalendarRowCell.m b/TimesSquare/TSQTACalendarRowCell.m new file mode 100644 index 0000000..2a44bf3 --- /dev/null +++ b/TimesSquare/TSQTACalendarRowCell.m @@ -0,0 +1,42 @@ +// +// TSQTACalendarRowCell.m +// TimesSquare +// +// Created by Jim Puls on 12/5/12. +// Licensed to Square, Inc. under one or more contributor license agreements. +// See the LICENSE file distributed with this work for the terms under +// which Square, Inc. licenses this file to you. + +#import "TSQTACalendarRowCell.h" + +@implementation TSQTACalendarRowCell + +- (void)layoutViewsForColumnAtIndex:(NSUInteger)index inRect:(CGRect)rect; +{ + // Move down for the row at the top + rect.origin.y += self.columnSpacing; + rect.size.height -= (self.bottomRow ? 2.0f : 1.0f) * self.columnSpacing; + [super layoutViewsForColumnAtIndex:index inRect:rect]; +} + +- (UIImage *)todayBackgroundImage; +{ + return [[UIImage imageNamed:@"CalendarTodaysDate.png"] stretchableImageWithLeftCapWidth:4 topCapHeight:4]; +} + +- (UIImage *)selectedBackgroundImage; +{ + return [[UIImage imageNamed:@"CalendarSelectedDate.png"] stretchableImageWithLeftCapWidth:4 topCapHeight:4]; +} + +- (UIImage *)notThisMonthBackgroundImage; +{ + return [[UIImage imageNamed:@"CalendarPreviousMonth.png"] stretchableImageWithLeftCapWidth:0 topCapHeight:0]; +} + +- (UIImage *)backgroundImage; +{ + return [UIImage imageNamed:[NSString stringWithFormat:@"CalendarRow%@.png", self.bottomRow ? @"Bottom" : @""]]; +} + +@end diff --git a/TimesSquare/TSQTAViewController.h b/TimesSquare/TSQTAViewController.h new file mode 100644 index 0000000..be8d30e --- /dev/null +++ b/TimesSquare/TSQTAViewController.h @@ -0,0 +1,16 @@ +// +// TSQTAViewController.h +// TimesSquare +// +// Created by Jim Puls on 12/5/12. +// Licensed to Square, Inc. under one or more contributor license agreements. +// See the LICENSE file distributed with this work for the terms under +// which Square, Inc. licenses this file to you. + +#import + +@interface TSQTAViewController : UIViewController + +@property (nonatomic, strong) NSCalendar *calendar; + +@end diff --git a/TimesSquare/TSQTAViewController.m b/TimesSquare/TSQTAViewController.m new file mode 100644 index 0000000..485e7fa --- /dev/null +++ b/TimesSquare/TSQTAViewController.m @@ -0,0 +1,86 @@ +// +// TSQTAViewController.m +// TimesSquare +// +// Created by Jim Puls on 12/5/12. +// Licensed to Square, Inc. under one or more contributor license agreements. +// See the LICENSE file distributed with this work for the terms under +// which Square, Inc. licenses this file to you. + +#import "TSQTAViewController.h" +#import "TSQTACalendarRowCell.h" +#import "TimesSquare.h" + + +@interface TSQTAViewController () + +@property (nonatomic, retain) NSTimer *timer; + +@end + + +@interface TSQCalendarView (AccessingPrivateStuff) + +@property (nonatomic, readonly) UITableView *tableView; + +@end + + +@implementation TSQTAViewController + +- (void)loadView; +{ + TSQCalendarView *calendarView = [[TSQCalendarView alloc] init]; + calendarView.calendar = self.calendar; + calendarView.rowCellClass = [TSQTACalendarRowCell class]; + //calendarView.firstDate = [NSDate dateWithTimeIntervalSinceNow:-60 * 60 * 24 * 365 * 1]; + calendarView.firstDate = [[NSDate alloc]init]; + calendarView.lastDate = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24 * 365 * 1]; + //calendarView.lastDate = [NSDate dateWithTimeIntervalSinceNow:60 * 60 * 24 * 365 * 5]; + calendarView.backgroundColor = [UIColor colorWithRed:0.84f green:0.85f blue:0.86f alpha:1.0f]; + calendarView.pagingEnabled = YES; + CGFloat onePixel = 1.0f / [UIScreen mainScreen].scale; + calendarView.contentInset = UIEdgeInsetsMake(0.0f, onePixel, 0.0f, onePixel); + + self.view = calendarView; +} + +- (void)setCalendar:(NSCalendar *)calendar; +{ + _calendar = calendar; + + self.navigationItem.title = calendar.calendarIdentifier; + self.tabBarItem.title = calendar.calendarIdentifier; +} + +- (void)viewDidLayoutSubviews; +{ + // Set the calendar view to show today date on start + [(TSQCalendarView *)self.view scrollToDate:[NSDate date] animated:NO]; +} + +- (void)viewDidAppear:(BOOL)animated; +{ + [super viewDidAppear:animated]; + + // Uncomment this to test scrolling performance of your custom drawing +// self.timer = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(scroll) userInfo:nil repeats:YES]; +} + +- (void)viewWillDisappear:(BOOL)animated; +{ + [self.timer invalidate]; + self.timer = nil; +} + +- (void)scroll; +{ + static BOOL atTop = YES; + TSQCalendarView *calendarView = (TSQCalendarView *)self.view; + UITableView *tableView = calendarView.tableView; + + [tableView setContentOffset:CGPointMake(0.f, atTop ? 10000.f : 0.f) animated:YES]; + atTop = !atTop; +} + +@end diff --git a/TimesSquare/TimesSquare.h b/TimesSquare/TimesSquare.h index 7b3e07e..addfc8a 100644 --- a/TimesSquare/TimesSquare.h +++ b/TimesSquare/TimesSquare.h @@ -7,6 +7,6 @@ // See the LICENSE file distributed with this work for the terms under // which Square, Inc. licenses this file to you. -#import -#import -#import +#import "TSQCalendarMonthHeaderCell.h" +#import "TSQCalendarRowCell.h" +#import "TSQCalendarView.h"