From c838d7fdc525939deac2cca09900aeec5aa0e7c3 Mon Sep 17 00:00:00 2001 From: Mikhail Stepkin Date: Wed, 29 Jul 2015 10:55:25 +0300 Subject: [PATCH] ZLSwipeableViewDirection static 'constructors' are public now. It's easier to create using ZLSwipeableViewDirection.Up than ZLSwipeableViewDirection(rawValue: 0b0100). Especcially if that ZLSwipeableViewDirection.Up is already implemented but hidden from your code by implicit internal keyword. --- ZLSwipeableViewSwift/ZLSwipeableView.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ZLSwipeableViewSwift/ZLSwipeableView.swift b/ZLSwipeableViewSwift/ZLSwipeableView.swift index 40b33a4..af5b8ab 100644 --- a/ZLSwipeableViewSwift/ZLSwipeableView.swift +++ b/ZLSwipeableViewSwift/ZLSwipeableView.swift @@ -33,16 +33,16 @@ public struct ZLSwipeableViewDirection : RawOptionSetType, Printable { return self(rawValue: 0) } - static var None: ZLSwipeableViewDirection { return self(rawValue: 0b0000) } - static var Left: ZLSwipeableViewDirection { return self(rawValue: 0b0001) } - static var Right: ZLSwipeableViewDirection { return self(rawValue: 0b0010) } - static var Up: ZLSwipeableViewDirection { return self(rawValue: 0b0100) } - static var Down: ZLSwipeableViewDirection { return self(rawValue: 0b1000) } - static var Horizontal: ZLSwipeableViewDirection { return Left | Right } - static var Vertical: ZLSwipeableViewDirection { return Up | Down } - static var All: ZLSwipeableViewDirection { return Horizontal | Vertical } + public static var None: ZLSwipeableViewDirection { return self(rawValue: 0b0000) } + public static var Left: ZLSwipeableViewDirection { return self(rawValue: 0b0001) } + public static var Right: ZLSwipeableViewDirection { return self(rawValue: 0b0010) } + public static var Up: ZLSwipeableViewDirection { return self(rawValue: 0b0100) } + public static var Down: ZLSwipeableViewDirection { return self(rawValue: 0b1000) } + public static var Horizontal: ZLSwipeableViewDirection { return Left | Right } + public static var Vertical: ZLSwipeableViewDirection { return Up | Down } + public static var All: ZLSwipeableViewDirection { return Horizontal | Vertical } - static func fromPoint(point: CGPoint) -> ZLSwipeableViewDirection { + public static func fromPoint(point: CGPoint) -> ZLSwipeableViewDirection { switch (point.x, point.y) { case let (x, y) where abs(x)>=abs(y) && x>=0: return .Right