Это мой код:Просмотреть
Код: Выделить всё
HStack(alignment: .top, spacing: 0) {
Image(systemName: isAgreeConditionsAndTerms ? "checkmark.square.fill" : "square")
.font(.title2)
.foregroundColor(isAgreeConditionsAndTerms ? .wpink : .gray)
.padding(.trailing, 12)
.padding(.bottom, 12)
Text(getAttriText()).font(.system(size: 17))
}.onTapGesture {
isAgreeConditionsAndTerms.toggle()
}
Код: Выделить всё
private func getAttriText() -> AttributedString {
var attriString = AttributedString("I agree to the terms and conditions for posting a review".i18n)
attriString.foregroundColor = Color(Colors.Text.black)
if let privacyRange = attriString.range(of: "terms and conditions".i18n) {
attriString[privacyRange].link = URL(string: "termanconditions://")
attriString[privacyRange].underlineStyle = .single
attriString[privacyRange].baselineOffset = 10
}
return attriString
}
[img]https://i.sstatic .net/MBPtqcBp.png[/img]
Есть ли у кого-нибудь способ сделать это?
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/792 ... in-swiftui