Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Motion
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
Motion
Commits
2fd5d3b0
Commit
2fd5d3b0
authored
Jul 23, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made AssociatedObject internal for new submodule setup
parent
0846f0c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Sources/Extensions/Motion+Obj-C.swift
+3
-3
No files found.
Sources/Extensions/Motion+Obj-C.swift
View file @
2fd5d3b0
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
* THE SOFTWARE.
* THE SOFTWARE.
*/
*/
public
struct
AssociatedObject
{
internal
struct
AssociatedObject
{
/**
/**
Gets the Obj-C reference for the instance object within the UIView extension.
Gets the Obj-C reference for the instance object within the UIView extension.
- Parameter base: Base object.
- Parameter base: Base object.
...
@@ -31,7 +31,7 @@ public struct AssociatedObject {
...
@@ -31,7 +31,7 @@ public struct AssociatedObject {
- Parameter initializer: Object initializer.
- Parameter initializer: Object initializer.
- Returns: The associated reference for the initializer object.
- Returns: The associated reference for the initializer object.
*/
*/
public
static
func
get
<
T
:
Any
>
(
base
:
Any
,
key
:
UnsafePointer
<
UInt8
>
,
initializer
:
()
->
T
)
->
T
{
static
func
get
<
T
:
Any
>
(
base
:
Any
,
key
:
UnsafePointer
<
UInt8
>
,
initializer
:
()
->
T
)
->
T
{
if
let
v
=
objc_getAssociatedObject
(
base
,
key
)
as?
T
{
if
let
v
=
objc_getAssociatedObject
(
base
,
key
)
as?
T
{
return
v
return
v
}
}
...
@@ -48,7 +48,7 @@ public struct AssociatedObject {
...
@@ -48,7 +48,7 @@ public struct AssociatedObject {
- Parameter value: The object instance to set for the associated object.
- Parameter value: The object instance to set for the associated object.
- Returns: The associated reference for the initializer object.
- Returns: The associated reference for the initializer object.
*/
*/
public
static
func
set
<
T
:
Any
>
(
base
:
Any
,
key
:
UnsafePointer
<
UInt8
>
,
value
:
T
)
{
static
func
set
<
T
:
Any
>
(
base
:
Any
,
key
:
UnsafePointer
<
UInt8
>
,
value
:
T
)
{
objc_setAssociatedObject
(
base
,
key
,
value
,
.
OBJC_ASSOCIATION_RETAIN
)
objc_setAssociatedObject
(
base
,
key
,
value
,
.
OBJC_ASSOCIATION_RETAIN
)
}
}
}
}
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