Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 5b2f24a

Browse files
committed
Fix caption layout within the image view
1 parent 4a4a144 commit 5b2f24a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

DIImageView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'DIImageView'
11-
s.version = '1.0.1'
11+
s.version = '1.0.2'
1212
s.summary = 'A Snapchat-inspired caption integrated within a regular UIImageView'
1313

1414
s.homepage = 'https://github.com/danielinoa/DIImageView'

DIImageView/Classes/DIImageView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ open class DIImageView: UIImageView, UITextFieldDelegate {
6868
super.layoutSubviews()
6969
let captionSize = CGSize(width: bounds.size.width, height: 32)
7070
caption.bounds = CGRect(origin: CGPoint.zero, size: captionSize)
71-
caption.center = CGPoint(x: center.x, y: captionCenterY)
71+
let centerX = bounds.width/2
72+
caption.center = CGPoint(x: centerX, y: captionCenterY)
7273
}
7374

7475
// MARK: - Gestures

Example/DIImageView/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.1</string>
18+
<string>1.0.2</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>2</string>
22+
<string>3</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
2525
<key>UILaunchStoryboardName</key>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DIImageView is available through [CocoaPods](http://cocoapods.org). To install
3232
it, simply add the following line to your Podfile:
3333

3434
```ruby
35-
pod 'DIImageView' => '1.0.1'
35+
pod 'DIImageView' => '1.0.2'
3636
```
3737

3838
## Contributors

0 commit comments

Comments
 (0)