6 Commits

Author SHA1 Message Date
Khoa Pham 5c48b2482a Bump to 2.0.1 2017-11-02 13:03:21 +01:00
Khoa Pham 83416d6870 Merge pull request #147 from hyperoslo/fix/carthage
Update Carthage
2017-11-02 13:02:44 +01:00
Khoa Pham 4f9540b4df Update Cartfile 2017-11-02 12:57:58 +01:00
Khoa Pham 304c3e61f6 Just run carthage update 2017-11-02 12:51:28 +01:00
Khoa Pham 026153f502 Merge pull request #143 from bchrobot/fix-index-error
Refactored truncatedText getter to prevent occasional EXC_BREAKPOINT crash
2017-10-15 18:20:15 +02:00
Benjamin Chrobot 6e53ee01c7 Refactored truncatedText getter to prevent occassional 'EXC_BREAKPOINT: cannot decrement invalid index' crash. 2017-10-13 13:49:51 -04:00
7 changed files with 18 additions and 29 deletions
+2 -3
View File
@@ -1,4 +1,3 @@
github "hyperoslo/Cache" "4.0.2"
github "hyperoslo/Cache" "4.1.2"
github "hyperoslo/Hue" "3.0.0"
github "hyperoslo/Imaginary" "3.0.0"
github "onmyway133/SwiftHash" "2.0.1"
github "hyperoslo/Imaginary" "3.0.2"
+1 -1
View File
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Lightbox"
s.summary = "A a convenient and easy to use image viewer for your iOS app, packed with all the features you expect"
s.version = "2.0.0"
s.version = "2.0.1"
s.homepage = "https://github.com/hyperoslo/Lightbox"
s.license = 'MIT'
s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }
-1
View File
@@ -235,7 +235,6 @@
"$(SRCROOT)/Carthage/Build/iOS/Hue.framework",
"$(SRCROOT)/Carthage/Build/iOS/Imaginary.framework",
"$(SRCROOT)/Carthage/Build/iOS/Cache.framework",
"$(SRCROOT)/Carthage/Build/iOS/SwiftHash.framework",
);
name = "Copy frameworks with Carthage";
outputPaths = (
+13 -12
View File
@@ -48,19 +48,20 @@ open class InfoLabel: UILabel {
return truncatedText
}
// Perform quick "rough cut"
while numberOfLines(truncatedText) > numberOfVisibleLines * 2 {
truncatedText = String(truncatedText.characters.prefix(truncatedText.characters.count / 2))
}
// Capture the endIndex of truncatedText before appending ellipsis
var truncatedTextCursor = truncatedText.endIndex
truncatedText += ellipsis
let start = truncatedText.characters.index(truncatedText.endIndex, offsetBy: -(ellipsis.characters.count + 1))
let end = truncatedText.characters.index(truncatedText.endIndex, offsetBy: -ellipsis.characters.count)
var range = start..<end
// Remove characters ahead of ellipsis until the text is the right number of lines
while numberOfLines(truncatedText) > numberOfVisibleLines {
truncatedText.removeSubrange(range)
range = truncatedText.index(range.lowerBound, offsetBy: -1)..<truncatedText.index(range.upperBound, offsetBy: -1)
truncatedTextCursor = truncatedText.index(before: truncatedTextCursor)
truncatedText.remove(at: truncatedTextCursor)
}
return truncatedText
@@ -105,13 +106,13 @@ open class InfoLabel: UILabel {
}
fileprivate func updateText(_ string: String) {
let attributedString = NSMutableAttributedString(string: string,
attributes: LightboxConfig.InfoLabel.textAttributes)
let textAttributes = LightboxConfig.InfoLabel.textAttributes
let attributedString = NSMutableAttributedString(string: string, attributes: textAttributes)
if string.range(of: ellipsis) != nil {
let range = (string as NSString).range(of: ellipsis)
attributedString.addAttribute(NSAttributedStringKey.foregroundColor,
value: LightboxConfig.InfoLabel.ellipsisColor, range: range)
if let range = string.range(of: ellipsis) {
let ellipsisColor = LightboxConfig.InfoLabel.ellipsisColor
let ellipsisRange = NSRange(range, in: string)
attributedString.addAttribute(.foregroundColor, value: ellipsisColor, range: ellipsisRange)
}
attributedText = attributedString
-4
View File
@@ -1,4 +0,0 @@
#!/bin/sh
carthage bootstrap
cp Cartfile.resolved Carthage
-5
View File
@@ -1,5 +0,0 @@
#!/bin/sh
if ! cmp -s Cartfile.resolved Carthage/Cartfile.resolved; then
bin/bootstrap
fi
+2 -3
View File
@@ -4,9 +4,8 @@ machine:
dependencies:
override:
- bin/bootstrap-if-needed
cache_directories:
- "Carthage"
- rm -rf Carthage
- carthage update
test:
override: