Merge branch 'feature/label_export_box' into 'develop'
Added convenience function which adds the new images to attributed string. See merge request BPHV_MIPS/mvm_core_ui!92
This commit is contained in:
commit
eaa8397493
@ -341,6 +341,25 @@ public typealias ActionBlock = () -> Void
|
||||
standardFontSize = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///Appends an external link image to the end of the attributed string.
|
||||
public func addExternalLinkIcon() {
|
||||
|
||||
let size = round(font.pointSize * 0.8)
|
||||
|
||||
guard let attributedText = self.attributedText else { return }
|
||||
|
||||
let fullString = NSMutableAttributedString(attributedString: attributedText)
|
||||
|
||||
let imageAttachment = NSTextAttachment()
|
||||
imageAttachment.image = MVMCoreUIUtility.imageNamed("externalLink")
|
||||
imageAttachment.bounds = CGRect(x: 0, y: 0, width: size, height: size)
|
||||
|
||||
fullString.append(NSAttributedString(string: " "))
|
||||
fullString.append(NSAttributedString(attachment: imageAttachment))
|
||||
self.attributedText = fullString
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Atomization
|
||||
|
||||
6
MVMCoreUI/SupportingFiles/Media.xcassets/Contents.json
Normal file
6
MVMCoreUI/SupportingFiles/Media.xcassets/Contents.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
23
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json
vendored
Normal file
23
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "exportBlack.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "exportBlack@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "exportBlack@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 345 B |
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 589 B |
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png
vendored
Normal file
BIN
MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 869 B |
Loading…
Reference in New Issue
Block a user