@@ -268,7 +268,7 @@ public extension UIButton.Configuration {
268268
269269 /// SwiftlyUI extension for `UIButton.Configuration`.
270270 @discardableResult
271- func attributedSubTitle( _ title: AttributedString ) -> Self {
271+ func attributedSubTitle( _ title: AttributedString ? ) -> Self {
272272 var newConfig = self
273273 newConfig. attributedSubtitle = title
274274 return newConfig
@@ -294,7 +294,7 @@ public extension UIButton.Configuration {
294294
295295 /// SwiftlyUI extension for `UIButton.Configuration`.
296296 @discardableResult
297- func subtitleTextAttributesTransformer( _ transformer: UIConfigurationTextAttributesTransformer ) -> Self {
297+ func subtitleTextAttributesTransformer( _ transformer: UIConfigurationTextAttributesTransformer ? ) -> Self {
298298 var newConfig = self
299299 newConfig. subtitleTextAttributesTransformer = transformer
300300 return newConfig
@@ -310,12 +310,20 @@ public extension UIButton.Configuration {
310310
311311 /// SwiftlyUI extension for `UIButton.Configuration`.
312312 @discardableResult
313- func image( _ image: UIImage ) -> Self {
313+ func image( _ image: UIImage ? ) -> Self {
314314 var newConfig = self
315315 newConfig. image = image
316316 return newConfig
317317 }
318318
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+
319327 /// SwiftlyUI extension for `UIButton.Configuration`.
320328 @discardableResult
321329 func imagePlacement( _ placement: NSDirectionalRectEdge ) -> Self {
@@ -334,15 +342,15 @@ public extension UIButton.Configuration {
334342
335343 /// SwiftlyUI extension for `UIButton.Configuration`.
336344 @discardableResult
337- func baseForegroundColor( _ color: UIColor ) -> Self {
345+ func baseForegroundColor( _ color: UIColor ? ) -> Self {
338346 var newConfig = self
339347 newConfig. baseForegroundColor = color
340348 return newConfig
341349 }
342350
343351 /// SwiftlyUI extension for `UIButton.Configuration`.
344352 @discardableResult
345- func baseBackgroundColor( _ color: UIColor ) -> Self {
353+ func baseBackgroundColor( _ color: UIColor ? ) -> Self {
346354 var newConfig = self
347355 newConfig. baseBackgroundColor = color
348356 return newConfig
@@ -390,7 +398,7 @@ public extension UIButton.Configuration {
390398
391399 /// SwiftlyUI extension for `UIButton.Configuration`.
392400 @discardableResult
393- func activityIndicatorColorTransformer( _ transformer: UIConfigurationColorTransformer ) -> Self {
401+ func activityIndicatorColorTransformer( _ transformer: UIConfigurationColorTransformer ? ) -> Self {
394402 var newConfig = self
395403 newConfig. activityIndicatorColorTransformer = transformer
396404 return newConfig
@@ -456,15 +464,15 @@ public extension UIButton.Configuration {
456464
457465 /// SwiftlyUI extension for `UIButton.Configuration`.
458466 @discardableResult
459- func imageColorTransformer( _ transformer: UIConfigurationColorTransformer ) -> Self {
467+ func imageColorTransformer( _ transformer: UIConfigurationColorTransformer ? ) -> Self {
460468 var newConfig = self
461469 newConfig. imageColorTransformer = transformer
462470 return newConfig
463471 }
464472
465473 /// SwiftlyUI extension for `UIButton.Configuration`.
466474 @discardableResult
467- func preferredSymbolConfigurationForImage( _ config: UIImage . SymbolConfiguration ) -> Self {
475+ func preferredSymbolConfigurationForImage( _ config: UIImage . SymbolConfiguration ? ) -> Self {
468476 var newConfig = self
469477 newConfig. preferredSymbolConfigurationForImage = config
470478 return newConfig
0 commit comments