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
aad07d33
Commit
aad07d33
authored
Jul 12, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated associated objects
parent
d1f68623
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
30 deletions
+32
-30
Sources/iOS/BottomTabBar.swift
+2
-2
Sources/iOS/Grid.swift
+3
-2
Sources/iOS/Layout.swift
+2
-2
Sources/iOS/Material+Obj-C.swift
+23
-22
Sources/iOS/NavigationItem.swift
+2
-2
No files found.
Sources/iOS/BottomTabBar.swift
View file @
aad07d33
...
@@ -276,12 +276,12 @@ public extension UITabBar {
...
@@ -276,12 +276,12 @@ public extension UITabBar {
/// TabBarItem reference.
/// TabBarItem reference.
public
internal(set)
var
item
:
MaterialAssociatedObjectTabBar
{
public
internal(set)
var
item
:
MaterialAssociatedObjectTabBar
{
get
{
get
{
return
MaterialA
ssociatedObject
(
self
,
key
:
&
MaterialAssociatedObjectTabBarKey
)
{
return
a
ssociatedObject
(
self
,
key
:
&
MaterialAssociatedObjectTabBarKey
)
{
return
MaterialAssociatedObjectTabBar
(
depth
:
.
None
)
return
MaterialAssociatedObjectTabBar
(
depth
:
.
None
)
}
}
}
}
set
(
value
)
{
set
(
value
)
{
MaterialA
ssociateObject
(
self
,
key
:
&
MaterialAssociatedObjectTabBarKey
,
value
:
value
)
a
ssociateObject
(
self
,
key
:
&
MaterialAssociatedObjectTabBarKey
,
value
:
value
)
}
}
}
}
...
...
Sources/iOS/Grid.swift
View file @
aad07d33
...
@@ -244,12 +244,12 @@ public extension UIView {
...
@@ -244,12 +244,12 @@ public extension UIView {
/// Grid reference.
/// Grid reference.
public
private(set)
var
grid
:
Grid
{
public
private(set)
var
grid
:
Grid
{
get
{
get
{
return
MaterialA
ssociatedObject
(
self
,
key
:
&
GridKey
)
{
return
a
ssociatedObject
(
self
,
key
:
&
GridKey
)
{
return
Grid
()
return
Grid
()
}
}
}
}
set
(
value
)
{
set
(
value
)
{
MaterialA
ssociateObject
(
self
,
key
:
&
GridKey
,
value
:
value
)
a
ssociateObject
(
self
,
key
:
&
GridKey
,
value
:
value
)
}
}
}
}
}
}
\ No newline at end of file
Sources/iOS/Layout.swift
View file @
aad07d33
...
@@ -908,12 +908,12 @@ public extension UIView {
...
@@ -908,12 +908,12 @@ public extension UIView {
/// Layout reference.
/// Layout reference.
public
private(set)
var
layout
:
Layout
{
public
private(set)
var
layout
:
Layout
{
get
{
get
{
return
MaterialA
ssociatedObject
(
self
,
key
:
&
LayoutKey
)
{
return
a
ssociatedObject
(
self
,
key
:
&
LayoutKey
)
{
return
Layout
(
parent
:
self
)
return
Layout
(
parent
:
self
)
}
}
}
}
set
(
value
)
{
set
(
value
)
{
MaterialA
ssociateObject
(
self
,
key
:
&
LayoutKey
,
value
:
value
)
a
ssociateObject
(
self
,
key
:
&
LayoutKey
,
value
:
value
)
}
}
}
}
...
...
Sources/iOS/Material+Obj-C.swift
View file @
aad07d33
...
@@ -29,29 +29,29 @@
...
@@ -29,29 +29,29 @@
*/
*/
/**
/**
Gets the Obj-C reference for the Grid
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.
- Parameter key: Memory key pointer.
- Parameter key: Memory key pointer.
- 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
func
MaterialA
ssociatedObject
<
T
:
AnyObject
>
(
base
:
AnyObject
,
key
:
UnsafePointer
<
UInt8
>
,
initializer
:
()
->
T
)
->
T
{
internal
func
a
ssociatedObject
<
T
:
AnyObject
>
(
base
:
AnyObject
,
key
:
UnsafePointer
<
UInt8
>
,
initializer
:
()
->
T
)
->
T
{
if
let
v
:
T
=
objc_getAssociatedObject
(
base
,
key
)
as?
T
{
if
let
v
:
T
=
objc_getAssociatedObject
(
base
,
key
)
as?
T
{
return
v
return
v
}
}
let
v
:
T
=
initializer
()
let
v
:
T
=
initializer
()
objc_setAssociatedObject
(
base
,
key
,
v
,
.
OBJC_ASSOCIATION_RETAIN
)
objc_setAssociatedObject
(
base
,
key
,
v
,
.
OBJC_ASSOCIATION_RETAIN
)
return
v
return
v
}
}
/**
/**
Sets the Obj-C reference for the Grid
object within the UIView extension.
Sets the Obj-C reference for the instance
object within the UIView extension.
- Parameter base: Base object.
- Parameter base: Base object.
- Parameter key: Memory key pointer.
- Parameter key: Memory key pointer.
- 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
func
MaterialA
ssociateObject
<
T
:
AnyObject
>
(
base
:
AnyObject
,
key
:
UnsafePointer
<
UInt8
>
,
value
:
T
)
{
internal
func
a
ssociateObject
<
T
:
AnyObject
>
(
base
:
AnyObject
,
key
:
UnsafePointer
<
UInt8
>
,
value
:
T
)
{
objc_setAssociatedObject
(
base
,
key
,
value
,
.
OBJC_ASSOCIATION_RETAIN
)
objc_setAssociatedObject
(
base
,
key
,
value
,
.
OBJC_ASSOCIATION_RETAIN
)
}
}
\ No newline at end of file
Sources/iOS/NavigationItem.swift
View file @
aad07d33
...
@@ -83,12 +83,12 @@ public extension UINavigationItem {
...
@@ -83,12 +83,12 @@ public extension UINavigationItem {
/// NavigationItem reference.
/// NavigationItem reference.
public
internal(set)
var
item
:
MaterialAssociatedObjectNavigationItem
{
public
internal(set)
var
item
:
MaterialAssociatedObjectNavigationItem
{
get
{
get
{
return
MaterialA
ssociatedObject
(
self
,
key
:
&
MaterialAssociatedObjectNavigationItemKey
)
{
return
a
ssociatedObject
(
self
,
key
:
&
MaterialAssociatedObjectNavigationItemKey
)
{
return
MaterialAssociatedObjectNavigationItem
()
return
MaterialAssociatedObjectNavigationItem
()
}
}
}
}
set
(
value
)
{
set
(
value
)
{
MaterialA
ssociateObject
(
self
,
key
:
&
MaterialAssociatedObjectNavigationItemKey
,
value
:
value
)
a
ssociateObject
(
self
,
key
:
&
MaterialAssociatedObjectNavigationItemKey
,
value
:
value
)
}
}
}
}
...
...
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