@@ -147,26 +147,40 @@ extension ASAttributedString.Attribute {
147
147
}
148
148
}
149
149
150
- extension AttributedStringInterpolation {
150
+ extension ASAttributedStringInterpolation {
151
151
152
152
public typealias Attribute = ASAttributedString . Attribute
153
153
public typealias WrapMode = ASAttributedString . WrapMode
154
154
155
155
public mutating func appendInterpolation< T> ( _ value: T , _ attributes: Attribute ... ) {
156
156
appendInterpolation ( value, with: attributes)
157
157
}
158
-
159
158
public mutating func appendInterpolation< T> ( _ value: T , with attributes: [ Attribute ] ) {
160
159
self . value. append ( ASAttributedString ( " \( value) " , with: attributes) . value)
161
160
}
162
161
162
+ public mutating func appendInterpolation( _ value: NSAttributedString , _ attributes: Attribute ... ) {
163
+ appendInterpolation ( value, with: attributes)
164
+ }
165
+ public mutating func appendInterpolation( _ value: NSAttributedString , with attributes: [ Attribute ] ) {
166
+ self . value. append ( ASAttributedString ( value, with: attributes) . value)
167
+ }
168
+
169
+ public mutating func appendInterpolation( _ value: ASAttributedString , _ attributes: Attribute ... ) {
170
+ appendInterpolation ( value, with: attributes)
171
+ }
172
+ public mutating func appendInterpolation( _ value: ASAttributedString , with attributes: [ Attribute ] ) {
173
+ self . value. append ( ASAttributedString ( value, with: attributes) . value)
174
+ }
175
+
163
176
// 嵌套包装
164
177
public mutating func appendInterpolation( wrap string: ASAttributedString , _ attributes: Attribute ... ) {
165
178
appendInterpolation ( wrap: string, with: attributes)
166
179
}
167
180
public mutating func appendInterpolation( wrap string: ASAttributedString , with attributes: [ Attribute ] ) {
168
- self . value. append ( ASAttributedString ( wrap : . embedding ( string) , with: attributes) . value)
181
+ self . value. append ( ASAttributedString ( string, with: attributes) . value)
169
182
}
183
+
170
184
public mutating func appendInterpolation( wrap mode: WrapMode , _ attributes: Attribute ... ) {
171
185
appendInterpolation ( wrap: mode, with: attributes)
172
186
}
0 commit comments