From cd2b1223d674ab426e4e134c696a58c58ae83b82 Mon Sep 17 00:00:00 2001 From: Cem Olcay Date: Mon, 22 Dec 2014 11:40:44 +0200 Subject: [PATCH] added CGPoint & CGSize operators --- .../UserInterfaceState.xcuserstate | Bin 20761 -> 21903 bytes CEMKit-Swift/CEMKit.swift | 33 +++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/CEMKit-Swift.xcodeproj/project.xcworkspace/xcuserdata/cem.xcuserdatad/UserInterfaceState.xcuserstate b/CEMKit-Swift.xcodeproj/project.xcworkspace/xcuserdata/cem.xcuserdatad/UserInterfaceState.xcuserstate index 8f9cac607919fbf3e81a0d38a8b91970c855373c..a44da98884fa36667605298a2b5554c1ca3f2d1f 100644 GIT binary patch delta 7879 zcmeHLheK1>_rK!-Q5@hRg9J!ImY{4%$j%EP3E)6+i-@Qwhy&|x?o+GQ*43v~YaI-= zqIK_CTl>{o7mm8>>dbR401sa&ag#3ug`yUyC2ECQqc$iE36Tgzph%=bY7~zWP$Eh~X~=`TC<|qy z9Ml1IM4eD))DIP+0jLNKM8nYtGzLvVZz3O>f~KPx=v_1m@n|7hf<8n`Q3a|*>(K_Z z5p6=7(SCFQeS!|6Ptg(d1v=?Nr_ecc1zkng&~6d=UE%-Yx#27in1<6rRu{2P9VAK~Be zU-&8hn?Xz<(}Zctv|@yeh>u`zbW!LW>z$zWVeCgWy2jF-t_ zIx$_CZcI<6A2W~{#*{I`nX$|`W;`>QnZitE-eqR-B3v8lB)Oy;8A#qGvxuDjD7QSp za){H2lJ6Oy>*2XKLyD!>9K$RMpq7!g&0OyC9{A|cTvjwsK7Y^s(6 zI)IL#6Tc=P96I?qtHgDK^M>!^+ zKg3#R*j^qeYBy?3@xa%V3hI=^d`_e6_Vu0(0L37t8We$nU=SEg!iki~NJKRl0)_$| zC?%03iY`q-*A&^9SJk^R7L3aeX_=FoJ-WQ0e@PKrTv%RQHmqRexGFFfj0fHMYeB8! zCxXc!W+j*e-UL2C07q0rO*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L*&;^VE zb09h338Vzl0=)u#0-1p^fky)MfyV+10?z~@&jpqQmIhV^8UxLN)q&RnuLnL3d>fPm zH9>oj3%Y{dU}`Wu=noDEW(V_v`N4;SrNMA;e6S)|9jpn~1!o1H2nxYv!4<)mf(^mu z;F{ptU`z1b;Qrvj;E~{`!4tug!ArqkgTDoD25*HVAzA2wQ0Gv$Q1_4} CGPoint { + return CGPoint (x: left.x + right.x, y: left.y + right.y) +} + +func - (left: CGPoint, right: CGPoint) -> CGPoint { + return CGPoint (x: left.x - right.x, y: left.y - right.y) +} + + enum AnchorPosition: CGPoint { case TopLeft = "{0 ,0}" case TopCenter = "{0.5, 0}" @@ -340,6 +354,20 @@ extension CGPoint: StringLiteralConvertible { +// MARK: CGSize + +func + (left: CGSize, right: CGSize) -> CGSize { + return CGSize (width: left.width + right.width, height: left.height + right.height) +} + +func - (left: CGSize, right: CGSize) -> CGSize { + return CGSize (width: left.width - right.width, height: left.width - right.width) +} + + + +// MARK: UIFont + extension UIFont { enum FontType: String { @@ -393,6 +421,9 @@ extension UIFont { } + +// MARK: CEMKit + var ScreenWidth : CGFloat { get { return UIScreen.mainScreen().bounds.size.width @@ -484,7 +515,7 @@ func barButtonItem (title: String, color: UIColor, action: (AnyObject)->()) -> U -// MARK: - Button +// MARK: - UIButton class BlockButton: UIButton {