From 7ab4e36a0bf962c5db4d11bf46b571d5a1a1cb52 Mon Sep 17 00:00:00 2001 From: Neil Robichaud Date: Tue, 7 Mar 2017 11:02:08 -0500 Subject: [PATCH] added comments to your files --- .DS_Store | Bin 0 -> 8196 bytes Dropit/.DS_Store | Bin 0 -> 6148 bytes Dropit/Dropit/.DS_Store | Bin 0 -> 6148 bytes Dropit/Dropit/DropitBehavior.swift | 11 +++-- Dropit/Dropit/DropitViewController.swift | 54 +++++++++++++---------- 5 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 .DS_Store create mode 100644 Dropit/.DS_Store create mode 100644 Dropit/Dropit/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..976258edad3c0190d787bd07a22c6ebf57703130 GIT binary patch literal 8196 zcmeHM%}(1u5S|4}oP!NpGk~>_)q@w&$DO`F3ZmafnEiI`uiCX(G~4S?YN- z0}4OqdZCO&ccvf(@I(%obVMF?D7c`lZYTy61BwB~fMP%~a1|K9JDZC(t0Rjpz` zF>oyz;Pb&iWm$}5Ka}$5KqFHC$T8fO1%2cJ5@STN7|DJpB@{Np>_J3O5v3R+gyXrv z>X5}q_Cp!MNrZ3`(a0joP=p*EI76zFD27tCiUGyIMFu!`&(X5X*u8lE{>1V2YK~XK za}KFTsP|4~L62y15C$>3hU|Y2UjZDl=`~qYPucmAvZKS!A@qDIQyaK0`fZxUbr%+1 zQIN!ojTAmZCHcL<#i&50w11|w^`tiDTLmh>&nA}|ywz*8Ct;{ef(J8PHD4m zaqV&GlSeIR5Ax##`r`ByEm1o@5(iRe71+u`+j`#nv{LAC8Vp4-5E z#!S#-EJaI_>&gw}%k8(2Tol1uAigNWaEnPCFTK!WOFuysEc+3*SrZ%1L2Y1J{q({T zHbDY6IShx{R$!%tdN5$?VxuSQ=>M>@g>AW(oIm@Wz-MWLRuODvT8Esa{R^SV9v{X$ zzKP&qU%QZDFt5l10^2`1mh?G})PUHRfzm{1nbb(?a}Xy+nxIV?{DxWW8(8zQgQl{gO=YJTYZ$OnX#Ypx;i90C&<3m7{&?Mfo N>isX5Lp9fgfxpUmy;T4J literal 0 HcmV?d00001 diff --git a/Dropit/.DS_Store b/Dropit/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ea5458920a529fef6d9b13c94005d7f1409c491e GIT binary patch literal 6148 zcmeHK&2G~`5S~rb){ZYmfK-W#k436bssQC^LO|kx6yd5BqA1w4MHX4!$ab2dD3Z_c z7W}^lf)g*mqi_l{yW1*m$Q2>jk!HWy@qBCTXM5KR0IWNXcL7`gu+Rw`Ha5R8x=y}i z4V_s>WO57+<-=4QN2!RGs!if=RDhn{2J|2Y0VAkCKYA%1pl_qI`5fB|wb7&)>1X{j z8l}7_+wC8$vDRGQ*tG1H<2WtHz0`UZ48We+z-p)S-dYqdLD<- z0Z%3a_sTtyl_AfPe1Up&$g@~Xx?-Hg#ZjQfJLGXW9Jp8ed2)i(ewZZ(yxNb7 z7{1`rE^9o4Zy3}BJPGnF71;~S6USW?7jD2Q9HZ1RBq%qD{&L}iA;G_+Z_lM+1mM*8 z`^YPxgrd%3k1wz!)ig!{qkvIhl>&N6vz%20CT|ol3jDVU(E8w^6Z#q}g>vb@MjinW zo0yh{G5y65$J6L*tQ6uEG^VJCipum6gDE=ZJzeK(tQ0CbFn#!7`p!(BP?)?sj_=8G zV7@}r8U>63bp_T`*QNdc{_698on(4O0i(b_r2uR8f?gM=r1#dP$iR3h9Bhz_&54yc10+l zH)G69v-`Hwd9%B3n{F3?t3O;H0962MEP|zVRtrp?OPRA$@T?M@=17ntK?heD%|)Bz zFDf8ww}nFtcs00oU+b5kh9So2;Rd5-nzdVL)?&20Dkm)a?`muT71X)rL-K3PFu*-B z+!i>m1%hfp{+`ZRwE1-Xf(~Pklm;L8JPq2 z-D8fzTBsV+98Sv26fgx$fgcp$o-MYv;n8YSz!WeACJM;+Az~4X1Lhv})4@uQ0K_ug zYHZ67qHv;salqUopU|AA5xX`l;Clsf>Gk>JvaIr_L zO#xG2R)H0NTb2F)c=`E%mSlIPfGO~=6maFnd85uLg}rrda 0 + } while dropsToRemove.count == 0 && dropFrame.origin.y > 0 //remove all rows above the bottom of the screen for drop in dropsToRemove { dropitBehavior.removeDrop(drop) @@ -150,7 +156,7 @@ class DropitViewController: UIViewController, UIDynamicAnimatorDelegate } // MARK: - Constants - + //good programming practice to use structs rather than strings struct PathNames { static let MiddleBarrier = "Middle Barrier" static let Attachment = "Attachment" @@ -158,13 +164,13 @@ class DropitViewController: UIViewController, UIDynamicAnimatorDelegate } // MARK: - Extensions - +//allows easy access to a random CGFloat private extension CGFloat { static func random(max: Int) -> CGFloat { return CGFloat(arc4random() % UInt32(max)) } } - +//allows easy access to several basic UIColors private extension UIColor { class var random: UIColor { switch arc4random()%5 {