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

Commit

Permalink
Fix caption layout within the image view
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinoa committed Jul 22, 2017
1 parent 4a4a144 commit 5b2f24a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DIImageView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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

s.homepage = 'https://github.com/danielinoa/DIImageView'
Expand Down
3 changes: 2 additions & 1 deletion DIImageView/Classes/DIImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ open class DIImageView: UIImageView, UITextFieldDelegate {
super.layoutSubviews()
let captionSize = CGSize(width: bounds.size.width, height: 32)
caption.bounds = CGRect(origin: CGPoint.zero, size: captionSize)
caption.center = CGPoint(x: center.x, y: captionCenterY)
let centerX = bounds.width/2
caption.center = CGPoint(x: centerX, y: captionCenterY)
}

// MARK: - Gestures
Expand Down
4 changes: 2 additions & 2 deletions Example/DIImageView/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2</string>
<string>3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DIImageView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'DIImageView' => '1.0.1'
pod 'DIImageView' => '1.0.2'
```

## Contributors
Expand Down

0 comments on commit 5b2f24a

Please sign in to comment.