diff --git a/MVMCoreUI/Atoms/Views/Label.swift b/MVMCoreUI/Atoms/Views/Label.swift index 3b35764a..10b9220e 100644 --- a/MVMCoreUI/Atoms/Views/Label.swift +++ b/MVMCoreUI/Atoms/Views/Label.swift @@ -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 diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json new file mode 100644 index 00000000..07a5a9f8 --- /dev/null +++ b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/Contents.json @@ -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" + } +} \ No newline at end of file diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png new file mode 100644 index 00000000..34f6d7e9 Binary files /dev/null and b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack.png differ diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png new file mode 100644 index 00000000..c6de73e8 Binary files /dev/null and b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@2x.png differ diff --git a/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png new file mode 100644 index 00000000..15f13e32 Binary files /dev/null and b/MVMCoreUI/SupportingFiles/Media.xcassets/externalLink.imageset/exportBlack@3x.png differ diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h index 5f49eb13..9850cca3 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertView.h @@ -50,4 +50,7 @@ // Get the background color based on the type - (nonnull UIColor *)getBackgroundColorForType:(nullable NSString *)type; +// Set the status bar color. Used for updating the status bar when the view changes. +- (void)setStatusBarColor:(nullable UIColor *)statusBarColor statusBarStyle:(UIStatusBarStyle)style; + @end