Commit e9f9a8e0 by Daniel Dahan

issue-472: Added @objc to all enums to allow Obj-C to see the enum types and associated methods.

parent 137e8bdc
...@@ -32,7 +32,8 @@ import UIKit ...@@ -32,7 +32,8 @@ import UIKit
public typealias AnimationFillModeType = String public typealias AnimationFillModeType = String
public enum AnimationFillMode { @objc
public enum AnimationFillMode: Int {
case forwards case forwards
case backwards case backwards
case both case both
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum BorderWidthPreset { @objc
public enum BorderWidthPreset: Int {
case none case none
case border1 case border1
case border2 case border2
......
...@@ -53,7 +53,8 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl ...@@ -53,7 +53,8 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl
} }
} }
public enum BottomNavigationTransitionAnimation { @objc
public enum BottomNavigationTransitionAnimation: Int {
case none case none
case fade case fade
} }
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
import UIKit import UIKit
import AVFoundation import AVFoundation
public enum CaptureMode { @objc
public enum CaptureMode: Int {
case photo case photo
case video case video
} }
......
...@@ -33,7 +33,8 @@ import AVFoundation ...@@ -33,7 +33,8 @@ import AVFoundation
private var CaptureSessionAdjustingExposureContext: UInt8 = 1 private var CaptureSessionAdjustingExposureContext: UInt8 = 1
public enum CaptureSessionPreset { @objc
public enum CaptureSessionPreset: Int {
case presetPhoto case presetPhoto
case presetHigh case presetHigh
case presetMedium case presetMedium
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum CornerRadiusPreset { @objc
public enum CornerRadiusPreset: Int {
case none case none
case cornerRadius1 case cornerRadius1
case cornerRadius2 case cornerRadius2
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum DepthPreset { @objc
public enum DepthPreset: Int {
case none case none
case depth1 case depth1
case depth2 case depth2
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
public enum Direction { @objc
public enum Direction: Int {
case up case up
case down case down
case left case left
......
...@@ -30,9 +30,8 @@ ...@@ -30,9 +30,8 @@
import UIKit import UIKit
import UIKit @objc
public enum EdgeInsetsPreset: Int {
public enum EdgeInsetsPreset {
case none case none
// square // square
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum GridAxisDirection { @objc
public enum GridAxisDirection: Int {
case none case none
case horizontal case horizontal
case vertical case vertical
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum InterimSpacePreset { @objc
public enum InterimSpacePreset: Int {
case none case none
case interimSpace1 case interimSpace1
case interimSpace2 case interimSpace2
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum AnimationRotationMode { @objc
public enum AnimationRotationMode: Int {
case none case none
case auto case auto
case autoReverse case autoReverse
......
...@@ -30,28 +30,48 @@ ...@@ -30,28 +30,48 @@
import UIKit import UIKit
public enum ImageFormat { @objc
public enum ImageFormat: Int {
case png case png
case jpeg case jpeg
} }
public extension UIImage { public extension UIImage {
/** /// Width of the UIImage.
:name: width
*/
public var width: CGFloat { public var width: CGFloat {
return size.width return size.width
} }
/** /// Height of the UIImage.
:name: height
*/
public var height: CGFloat { public var height: CGFloat {
return size.height return size.height
} }
}
public extension UIImage {
/**
Resizes an image based on a given width.
- Parameter toWidth w: A width value.
- Returns: An optional UIImage.
*/
public func resize(toWidth w: CGFloat) -> UIImage? {
return internalResize(toWidth: w)
}
/** /**
:name: internalResize Resizes an image based on a given height.
- Parameter toHeight h: A height value.
- Returns: An optional UIImage.
*/
public func resize(toHeight h: CGFloat) -> UIImage? {
return internalResize(toHeight: h)
}
/**
Internally resizes the image.
- Parameter toWidth tw: A width.
- Parameter toHeight th: A height.
- Returns: An optional UIImage.
*/ */
private func internalResize(toWidth tw: CGFloat = 0, toHeight th: CGFloat = 0) -> UIImage? { private func internalResize(toWidth tw: CGFloat = 0, toHeight th: CGFloat = 0) -> UIImage? {
var w: CGFloat? var w: CGFloat?
...@@ -72,21 +92,9 @@ public extension UIImage { ...@@ -72,21 +92,9 @@ public extension UIImage {
return g return g
} }
}
/**
:name: resize public extension UIImage {
*/
public func resize(toWidth w: CGFloat) -> UIImage? {
return internalResize(toWidth: w)
}
/**
:name: resize
*/
public func resize(toHeight h: CGFloat) -> UIImage? {
return internalResize(toHeight: h)
}
/** /**
Creates a new image with the passed in color. Creates a new image with the passed in color.
- Parameter color: The UIColor to create the image from. - Parameter color: The UIColor to create the image from.
...@@ -112,7 +120,9 @@ public extension UIImage { ...@@ -112,7 +120,9 @@ public extension UIImage {
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image
} }
}
public extension UIImage {
/** /**
Creates an Image that is a color. Creates an Image that is a color.
- Parameter color: The UIColor to create the image from. - Parameter color: The UIColor to create the image from.
...@@ -128,9 +138,14 @@ public extension UIImage { ...@@ -128,9 +138,14 @@ public extension UIImage {
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image
} }
}
public extension UIImage {
/** /**
:name: crop Crops an image to a specified width and height.
- Parameter toWidth tw: A specified width.
- Parameter toHeight th: A specified height.
- Returns: An optional UIImage.
*/ */
public func crop(toWidth tw: CGFloat, toHeight th: CGFloat) -> UIImage? { public func crop(toWidth tw: CGFloat, toHeight th: CGFloat) -> UIImage? {
let g: UIImage? let g: UIImage?
...@@ -148,7 +163,9 @@ public extension UIImage { ...@@ -148,7 +163,9 @@ public extension UIImage {
return g return g
} }
}
public extension UIImage {
/** /**
Creates an clear image. Creates an clear image.
- Returns: A UIImage that is clear. - Returns: A UIImage that is clear.
...@@ -159,7 +176,9 @@ public extension UIImage { ...@@ -159,7 +176,9 @@ public extension UIImage {
UIGraphicsEndImageContext() UIGraphicsEndImageContext()
return image return image
} }
}
public extension UIImage {
/** /**
Asynchronously load images with a completion block. Asynchronously load images with a completion block.
- Parameter URL: A URL destination to fetch the image from. - Parameter URL: A URL destination to fetch the image from.
...@@ -177,7 +196,9 @@ public extension UIImage { ...@@ -177,7 +196,9 @@ public extension UIImage {
} }
}.resume() }.resume()
} }
}
public extension UIImage {
/** /**
Adjusts the orientation of the image from the capture orientation. Adjusts the orientation of the image from the capture orientation.
This is an issue when taking images, the capture orientation is not set correctly This is an issue when taking images, the capture orientation is not set correctly
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum MaterialGravity { @objc
public enum MaterialGravity: Int {
case Center case Center
case Top case Top
case Bottom case Bottom
...@@ -73,4 +74,4 @@ public func MaterialGravityToValue(gravity: MaterialGravity) -> String { ...@@ -73,4 +74,4 @@ public func MaterialGravityToValue(gravity: MaterialGravity) -> String {
case .ResizeAspectFill: case .ResizeAspectFill:
return kCAGravityResizeAspectFill return kCAGravityResizeAspectFill
} }
} }
\ No newline at end of file
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
import UIKit import UIKit
/// NavigationBar styles. /// NavigationBar styles.
public enum NavigationBarStyle { @objc
public enum NavigationBarStyle: Int {
case Tiny case Tiny
case Default case Default
case Medium case Medium
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
import UIKit import UIKit
@objc @objc
public enum NavigationDrawerPosition: NSInteger { public enum NavigationDrawerPosition: Int {
case left case left
case right case right
} }
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum PulseAnimation { @objc
public enum PulseAnimation: Int {
case none case none
case center case center
case centerWithBacking case centerWithBacking
......
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
public enum ShapePreset { @objc
public enum ShapePreset: Int {
case none case none
case square case square
case circle case circle
......
...@@ -30,17 +30,20 @@ ...@@ -30,17 +30,20 @@
import UIKit import UIKit
public enum SwitchStyle { @objc
public enum SwitchStyle: Int {
case light case light
case dark case dark
} }
public enum SwitchState { @objc
public enum SwitchState: Int {
case on case on
case off case off
} }
public enum SwitchSize { @objc
public enum SwitchSize: Int {
case small case small
case medium case medium
case large case large
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
import UIKit import UIKit
public enum TabBarLineAlignment { @objc
public enum TabBarLineAlignment: Int {
case top case top
case bottom case bottom
} }
......
...@@ -33,14 +33,16 @@ import UIKit ...@@ -33,14 +33,16 @@ import UIKit
public typealias AnimationTransitionType = String public typealias AnimationTransitionType = String
public typealias AnimationTransitionSubTypeType = String public typealias AnimationTransitionSubTypeType = String
public enum AnimationTransition { @objc
public enum AnimationTransition: Int {
case Fade case Fade
case MoveIn case MoveIn
case Push case Push
case Reveal case Reveal
} }
public enum AnimationTransitionSubType { @objc
public enum AnimationTransitionSubType: Int {
case Right case Right
case Left case Left
case Top case Top
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment