Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ struct SegmentedControlExample: View {
}

var borderShape: some Shape {
if #available(iOS 26.0, *) {
return Capsule()
} else {
#if swift(>=6.0)
if #available(iOS 26.0, *) {
return Capsule()
} else {
return RoundedRectangle(cornerRadius: 9)
}
#else
return RoundedRectangle(cornerRadius: 9)
}
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ extension SegmentedControlPickerFioriStyle {
}

var borderShape: some Shape {
if #available(iOS 26.0, *) {
return Capsule()
} else {
#if swift(>=6.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our SDK is using Swift compiler 5.9. (See Package.swift, the first line)
Mobile Start team consumes it as binary framework(not source code)

That means, our binary framework will always return RoundedRectangle(cornerRadius: 9) at line 62. No capsule will be returned at all.
For Mobile Start team, even if they use Swift compiler 6.0, they will not reach the "if" side of the code.

if #available(iOS 26.0, *) {
return Capsule()
} else {
return RoundedRectangle(cornerRadius: 9)
}
#else
return RoundedRectangle(cornerRadius: 9)
}
#endif
}
}

Expand Down
Loading