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