Fix for newer version of iOS

The last fix broke the newer versions of iOS so I've added a fix that should allow both version to function.
This commit is contained in:
Kevin Mullins 2021-07-08 15:23:08 -05:00
parent a0a193b040
commit 9ed6e8c72c
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# SwiftletRadioButtonPicker for Swift and SwiftUI
![](https://img.shields.io/badge/license-MIT-green) ![](https://img.shields.io/badge/maintained%3F-Yes-green) ![](https://img.shields.io/badge/swift-5.4-green) ![](https://img.shields.io/badge/iOS-13.0-red) ![](https://img.shields.io/badge/macOS-10.15-red) ![](https://img.shields.io/badge/tvOS-13.0-red) ![](https://img.shields.io/badge/release-v1.0.2-blue)
![](https://img.shields.io/badge/license-MIT-green) ![](https://img.shields.io/badge/maintained%3F-Yes-green) ![](https://img.shields.io/badge/swift-5.4-green) ![](https://img.shields.io/badge/iOS-13.0-red) ![](https://img.shields.io/badge/macOS-10.15-red) ![](https://img.shields.io/badge/tvOS-13.0-red) ![](https://img.shields.io/badge/release-v1.0.3-blue)
Creates a cross-platform Radio Button Picker that allow the user to select from a small group of options by presenting a list of `SwiftletRadioButton` objects that the user can tap on to select one items from the list.

View File

@ -148,9 +148,15 @@ public struct SwiftletRadioButtonPicker: View {
/// - Returns: The View for the `SwiftletRadioButton`.
private func radioButton(_ button:SwiftletRadioButton) -> some View {
HStack {
#if swift(>=5.5)
Image(systemName: (button.isSelected) ? selectedSymbolName : unselectedSymbolName)
.resizable()
.frame(width: selectorSize, height: selectorSize)
#else
Image(systemName: (button.isSelected) ? selectedSymbolName : unselectedSymbolName)
.resizable()
.frame(width: CGFloat(selectorSize), height: CGFloat(selectorSize))
#endif
Text(button.name)