Skip to content

Commit 3137152

Browse files
committed
#38 Added shadow attribute for Style
1 parent f9882cb commit 3137152

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ The following properties are available:
487487
| font | `FontConvertible` | font used in text |
488488
| color | `ColorConvertible` | foreground color of the text |
489489
| backColor | `ColorConvertible` | background color of the text |
490+
| shadow | `NSShadow` | shadow effect of the text |
490491
| underline | `(NSUnderlineStyle?,ColorConvertible?)` | underline style and color (if color is nil foreground is used) |
491492
| strikethrough | `(NSUnderlineStyle?,ColorConvertible?)` | strikethrough style and color (if color is nil foreground is used) |
492493
| baselineOffset | `Float` | character’s offset from the baseline, in point |

Sources/SwiftRichString/Style/Style.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,20 @@ public class Style: StyleProtocol {
325325
}
326326
}
327327

328+
#if os(iOS) || os(tvOS) || os(macOS)
329+
330+
/// The value of this attribute is an `NSShadow` object. The default value of this property is nil.
331+
public var shadow: NSShadow? {
332+
set {
333+
self.set(attribute: shadow, forKey: .shadow)
334+
}
335+
get {
336+
return self.get(attributeForKey: .shadow)
337+
}
338+
}
339+
340+
#endif
341+
328342
#if os(iOS) || os(tvOS) || os(watchOS)
329343

330344
/// Enable spoken of all punctuation in the text.

0 commit comments

Comments
 (0)