Skip to content

Commit dec8b44

Browse files
committed
Merge branch 'master' into develop
2 parents 6e97b40 + 657562e commit dec8b44

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ExampleiOS/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ class ViewController: UIViewController {
9494

9595
public class MyXMLDynamicAttributesResolver: StandardXMLAttributesResolver {
9696

97-
public override func styleForUnknownXMLTag(_ tag: String, to attributedString: inout AttributedString, attributes: [String : String]?) {
98-
super.styleForUnknownXMLTag(tag, to: &attributedString, attributes: attributes)
97+
public override func styleForUnknownXMLTag(_ tag: String, to attributedString: inout AttributedString, attributes: [String : String]?, fromStyle forStyle: StyleXML) {
98+
super.styleForUnknownXMLTag(tag, to: &attributedString, attributes: attributes, fromStyle: forStyle)
9999

100100
if tag == "rainbow" {
101101
let colors = UIColor.randomColors(attributedString.length)

Sources/SwiftRichString/Style/StyleGroup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class StyleXML: StyleProtocol {
5656

5757
/// Image provider is called to provide custom image when `StyleXML` encounter a `img` tag image.
5858
/// If not implemented the image is automatically searched inside any bundled `xcassets`.
59-
public var imageProvider: ((String) -> UIImage?)? = nil
59+
public var imageProvider: ((String) -> Image?)? = nil
6060

6161
/// Dynamic attributes resolver.
6262
/// By default the `StandardXMLAttributesResolver` instance is used.

Sources/SwiftRichString/Support/XMLDynamicAttributesResolver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public protocol XMLDynamicAttributesResolver {
4747
/// - Parameters:
4848
/// - name: name of the image to get.
4949
/// - fromStyle: caller instance of `StyleXML.
50-
func imageWithName(_ name: String, fromStyle style: StyleXML) -> UIImage?
50+
func imageWithName(_ name: String, fromStyle style: StyleXML) -> Image?
5151

5252
/// You are receiving this event when SwiftRichString correctly render an existing tag but the tag
5353
/// contains extra attributes you may want to handle.
@@ -75,9 +75,9 @@ public protocol XMLDynamicAttributesResolver {
7575

7676
extension XMLDynamicAttributesResolver {
7777

78-
public func imageWithName(_ name: String, fromStyle style: StyleXML) -> UIImage? {
78+
public func imageWithName(_ name: String, fromStyle style: StyleXML) -> Image? {
7979
guard let mappedImage = style.imageProvider?(name) else {
80-
return UIImage(named: name) // xcassets fallback
80+
return Image(named: name) // xcassets fallback
8181
}
8282

8383
// origin xml style contains mapped image.

0 commit comments

Comments
 (0)