@@ -268,7 +268,7 @@ public extension UIButton.Configuration {
268
268
269
269
/// SwiftlyUI extension for `UIButton.Configuration`.
270
270
@discardableResult
271
- func attributedSubTitle( _ title: AttributedString ) -> Self {
271
+ func attributedSubTitle( _ title: AttributedString ? ) -> Self {
272
272
var newConfig = self
273
273
newConfig. attributedSubtitle = title
274
274
return newConfig
@@ -294,7 +294,7 @@ public extension UIButton.Configuration {
294
294
295
295
/// SwiftlyUI extension for `UIButton.Configuration`.
296
296
@discardableResult
297
- func subtitleTextAttributesTransformer( _ transformer: UIConfigurationTextAttributesTransformer ) -> Self {
297
+ func subtitleTextAttributesTransformer( _ transformer: UIConfigurationTextAttributesTransformer ? ) -> Self {
298
298
var newConfig = self
299
299
newConfig. subtitleTextAttributesTransformer = transformer
300
300
return newConfig
@@ -310,12 +310,20 @@ public extension UIButton.Configuration {
310
310
311
311
/// SwiftlyUI extension for `UIButton.Configuration`.
312
312
@discardableResult
313
- func image( _ image: UIImage ) -> Self {
313
+ func image( _ image: UIImage ? ) -> Self {
314
314
var newConfig = self
315
315
newConfig. image = image
316
316
return newConfig
317
317
}
318
318
319
+ /// SwiftlyUI extension for `UIButton.Configuration`.
320
+ @discardableResult
321
+ func imageName( _ imageName: String ) -> Self {
322
+ var newConfig = self
323
+ newConfig. image = UIImage ( named: imageName)
324
+ return newConfig
325
+ }
326
+
319
327
/// SwiftlyUI extension for `UIButton.Configuration`.
320
328
@discardableResult
321
329
func imagePlacement( _ placement: NSDirectionalRectEdge ) -> Self {
@@ -334,15 +342,15 @@ public extension UIButton.Configuration {
334
342
335
343
/// SwiftlyUI extension for `UIButton.Configuration`.
336
344
@discardableResult
337
- func baseForegroundColor( _ color: UIColor ) -> Self {
345
+ func baseForegroundColor( _ color: UIColor ? ) -> Self {
338
346
var newConfig = self
339
347
newConfig. baseForegroundColor = color
340
348
return newConfig
341
349
}
342
350
343
351
/// SwiftlyUI extension for `UIButton.Configuration`.
344
352
@discardableResult
345
- func baseBackgroundColor( _ color: UIColor ) -> Self {
353
+ func baseBackgroundColor( _ color: UIColor ? ) -> Self {
346
354
var newConfig = self
347
355
newConfig. baseBackgroundColor = color
348
356
return newConfig
@@ -390,7 +398,7 @@ public extension UIButton.Configuration {
390
398
391
399
/// SwiftlyUI extension for `UIButton.Configuration`.
392
400
@discardableResult
393
- func activityIndicatorColorTransformer( _ transformer: UIConfigurationColorTransformer ) -> Self {
401
+ func activityIndicatorColorTransformer( _ transformer: UIConfigurationColorTransformer ? ) -> Self {
394
402
var newConfig = self
395
403
newConfig. activityIndicatorColorTransformer = transformer
396
404
return newConfig
@@ -456,15 +464,15 @@ public extension UIButton.Configuration {
456
464
457
465
/// SwiftlyUI extension for `UIButton.Configuration`.
458
466
@discardableResult
459
- func imageColorTransformer( _ transformer: UIConfigurationColorTransformer ) -> Self {
467
+ func imageColorTransformer( _ transformer: UIConfigurationColorTransformer ? ) -> Self {
460
468
var newConfig = self
461
469
newConfig. imageColorTransformer = transformer
462
470
return newConfig
463
471
}
464
472
465
473
/// SwiftlyUI extension for `UIButton.Configuration`.
466
474
@discardableResult
467
- func preferredSymbolConfigurationForImage( _ config: UIImage . SymbolConfiguration ) -> Self {
475
+ func preferredSymbolConfigurationForImage( _ config: UIImage . SymbolConfiguration ? ) -> Self {
468
476
var newConfig = self
469
477
newConfig. preferredSymbolConfigurationForImage = config
470
478
return newConfig
0 commit comments