Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
e9f9a8e0
Commit
e9f9a8e0
authored
Jul 31, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue-472: Added @objc to all enums to allow Obj-C to see the enum types and associated methods.
parent
137e8bdc
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
96 additions
and
56 deletions
+96
-56
Sources/iOS/Animation.swift
+2
-1
Sources/iOS/Border.swift
+2
-1
Sources/iOS/BottomNavigationController.swift
+2
-1
Sources/iOS/Capture.swift
+2
-1
Sources/iOS/CaptureSession.swift
+2
-1
Sources/iOS/CornerRadius.swift
+2
-1
Sources/iOS/Depth.swift
+2
-1
Sources/iOS/Direction.swift
+2
-1
Sources/iOS/EdgeInsets.swift
+2
-3
Sources/iOS/Grid.swift
+2
-1
Sources/iOS/InterimSpace.swift
+2
-1
Sources/iOS/KeyframeAnimation.swift
+2
-1
Sources/iOS/Material+UIImage.swift
+50
-29
Sources/iOS/MaterialGravity.swift
+3
-3
Sources/iOS/NavigationBar.swift
+2
-1
Sources/iOS/NavigationDrawerController.swift
+1
-1
Sources/iOS/PulseAnimation.swift
+2
-1
Sources/iOS/Shape.swift
+2
-1
Sources/iOS/Switch.swift
+6
-3
Sources/iOS/TabBar.swift
+2
-1
Sources/iOS/TransitionAnimation.swift
+4
-2
No files found.
Sources/iOS/Animation.swift
View file @
e9f9a8e0
...
...
@@ -32,7 +32,8 @@ import UIKit
public
typealias
AnimationFillModeType
=
String
public
enum
AnimationFillMode
{
@objc
public
enum
AnimationFillMode
:
Int
{
case
forwards
case
backwards
case
both
...
...
Sources/iOS/Border.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
BorderWidthPreset
{
@objc
public
enum
BorderWidthPreset
:
Int
{
case
none
case
border1
case
border2
...
...
Sources/iOS/BottomNavigationController.swift
View file @
e9f9a8e0
...
...
@@ -53,7 +53,8 @@ public class BottomNavigationFadeAnimatedTransitioning : NSObject, UIViewControl
}
}
public
enum
BottomNavigationTransitionAnimation
{
@objc
public
enum
BottomNavigationTransitionAnimation
:
Int
{
case
none
case
fade
}
...
...
Sources/iOS/Capture.swift
View file @
e9f9a8e0
...
...
@@ -31,7 +31,8 @@
import
UIKit
import
AVFoundation
public
enum
CaptureMode
{
@objc
public
enum
CaptureMode
:
Int
{
case
photo
case
video
}
...
...
Sources/iOS/CaptureSession.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Sources/iOS/CornerRadius.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
CornerRadiusPreset
{
@objc
public
enum
CornerRadiusPreset
:
Int
{
case
none
case
cornerRadius1
case
cornerRadius2
...
...
Sources/iOS/Depth.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
DepthPreset
{
@objc
public
enum
DepthPreset
:
Int
{
case
none
case
depth1
case
depth2
...
...
Sources/iOS/Direction.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Sources/iOS/EdgeInsets.swift
View file @
e9f9a8e0
...
...
@@ -30,9 +30,8 @@
import
UIKit
import
UIKit
public
enum
EdgeInsetsPreset
{
@objc
public
enum
EdgeInsetsPreset
:
Int
{
case
none
// square
...
...
Sources/iOS/Grid.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
GridAxisDirection
{
@objc
public
enum
GridAxisDirection
:
Int
{
case
none
case
horizontal
case
vertical
...
...
Sources/iOS/InterimSpace.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
InterimSpacePreset
{
@objc
public
enum
InterimSpacePreset
:
Int
{
case
none
case
interimSpace1
case
interimSpace2
...
...
Sources/iOS/KeyframeAnimation.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
AnimationRotationMode
{
@objc
public
enum
AnimationRotationMode
:
Int
{
case
none
case
auto
case
autoReverse
...
...
Sources/iOS/Material+UIImage.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Sources/iOS/MaterialGravity.swift
View file @
e9f9a8e0
...
...
@@ -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
}
Sources/iOS/NavigationBar.swift
View file @
e9f9a8e0
...
...
@@ -31,7 +31,8 @@
import
UIKit
/// NavigationBar styles.
public
enum
NavigationBarStyle
{
@objc
public
enum
NavigationBarStyle
:
Int
{
case
Tiny
case
Default
case
Medium
...
...
Sources/iOS/NavigationDrawerController.swift
View file @
e9f9a8e0
...
...
@@ -31,7 +31,7 @@
import
UIKit
@objc
public
enum
NavigationDrawerPosition
:
NSInteger
{
public
enum
NavigationDrawerPosition
:
Int
{
case
left
case
right
}
...
...
Sources/iOS/PulseAnimation.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
PulseAnimation
{
@objc
public
enum
PulseAnimation
:
Int
{
case
none
case
center
case
centerWithBacking
...
...
Sources/iOS/Shape.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Sources/iOS/Switch.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Sources/iOS/TabBar.swift
View file @
e9f9a8e0
...
...
@@ -30,7 +30,8 @@
import
UIKit
public
enum
TabBarLineAlignment
{
@objc
public
enum
TabBarLineAlignment
:
Int
{
case
top
case
bottom
}
...
...
Sources/iOS/TransitionAnimation.swift
View file @
e9f9a8e0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment