Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c48b2482a | |||
| 83416d6870 | |||
| 4f9540b4df | |||
| 304c3e61f6 | |||
| 026153f502 | |||
| 6e53ee01c7 |
+2
-3
@@ -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
@@ -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" }
|
||||
|
||||
@@ -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 = (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
carthage bootstrap
|
||||
cp Cartfile.resolved Carthage
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! cmp -s Cartfile.resolved Carthage/Cartfile.resolved; then
|
||||
bin/bootstrap
|
||||
fi
|
||||
+2
-3
@@ -4,9 +4,8 @@ machine:
|
||||
|
||||
dependencies:
|
||||
override:
|
||||
- bin/bootstrap-if-needed
|
||||
cache_directories:
|
||||
- "Carthage"
|
||||
- rm -rf Carthage
|
||||
- carthage update
|
||||
|
||||
test:
|
||||
override:
|
||||
|
||||
Reference in New Issue
Block a user