Skip to content

Commit 4071985

Browse files
authored
Merge pull request #47 from layoutBox/update_readme
Update readme + codecov.io
2 parents f176ec7 + 079c9ce commit 4071985

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.travis.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ script:
2727
fi
2828
2929
after_success:
30-
- |
31-
if [[ $SCHEME = "FlexLayout" ]]; then
32-
slather coverage -s --workspace FlexLayout.xcworkspace --scheme FlexLayout --coveralls --travis FlexLayout.xcodeproj
33-
fi
34-
30+
- bash <(curl -s https://codecov.io/bash) -J 'FlexLayout' -J 'FlexLayoutTests'
31+

Cartfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
github "layoutBox/yoga" "flexlayout_branch"
2-
#github "layoutBox/yoga" "move_yogakit_to_flexlayout"

Example/FlexLayoutSample/UI/Examples/TableViewExample/Subviews/MethodCell.swift

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import UIKit
1616
import PinLayout
17+
import FlexLayout
1718

1819
class MethodCell: UITableViewCell {
1920
static let reuseIdentifier = "MethodCell"

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
<a href='https://coveralls.io/github/layoutBox/FlexLayout?branch=master'><img src='https://coveralls.io/repos/github/layoutBox/FlexLayout/badge.svg?branch=master' alt='Coverage Status' /></a>
99
<a href='https://img.shields.io/cocoapods/v/FlexLayout.svg'><img src="https://img.shields.io/cocoapods/v/FlexLayout.svg" /></a>
1010
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" /></a>
11-
<a href="https://raw.githubusercontent.com/layoutBox/FlexLayout/master/LICENSE"><img src="https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat" /></a>
11+
<a href="https://github.com/layoutBox/FlexLayout/issues"><img src="https://img.shields.io/github/issues/layoutBox/FlexLayout.svg?style=flat" /></a>
12+
</p></p>
13+
14+
<p align="center">
15+
<a href='https://cocoapods.org/pods/FlexLayout'><img src="https://img.shields.io/cocoapods/v/FlexLayout.svg" /></a>
16+
<a href='https://cocoapods.org/pods/FlexLayout'><img src="https://img.shields.io/cocoapods/dm/FlexLayout.svg" /></a>
17+
<a href='https://cocoapods.org/pods/FlexLayout'><img src="https://img.shields.io/cocoapods/dt/FlexLayout.svg" /></a>
1218
</p>
1319

1420
<br>

Sources/Impl/UIView+FlexLayout.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ private var flexLayoutAssociatedObjectHandle = 72_399_923
2222

2323
public extension UIView {
2424
public var flex: Flex {
25-
get {
26-
return objc_getAssociatedObject(self, &flexLayoutAssociatedObjectHandle) as? Flex ?? Flex(view: self)
27-
}
28-
set {
29-
objc_setAssociatedObject(self, &flexLayoutAssociatedObjectHandle, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
25+
if let flex = objc_getAssociatedObject(self, &flexLayoutAssociatedObjectHandle) as? Flex {
26+
return flex
27+
} else {
28+
let flex = Flex(view: self)
29+
objc_setAssociatedObject(self, &flexLayoutAssociatedObjectHandle, flex, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
30+
return flex
3031
}
3132
}
3233
}

0 commit comments

Comments
 (0)