You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tricky point is that R.swift only uses String(fromat: ...) initializer while there are parameters in the given string, so:
If I apply the values like "url" = "http%%3A%%2F%%2Fwww.abc.xyz";, R.swift doesn't see any parameters, so treats it as a normal string, so the output is like "http%%3A%%2F%%2Fwww.abc.xyz"
If I apply the value like "url" = "http%3A%2F%2Fwww.abc.xyz";, R.swift takes strings like %3A as parameters, and asks me to use the method like R.string.urls.url(Double, Double, Double)
One of the workarounds that my friend came out with is to use a dummy parameter like "url" = "http%%3A%%2F%%2Fwww.abc.xyz%@";, so we can use R.string.urls.url("") and the output is just what I wanted. But obviously it's just a workaround.
Is there any better way?
The text was updated successfully, but these errors were encountered:
For example, I need a string like this:
R.string.urls.url()
→"http%3A%2F%2Fwww.abc.xyz"
The tricky point is that R.swift only uses
String(fromat: ...)
initializer while there are parameters in the given string, so:"url" = "http%%3A%%2F%%2Fwww.abc.xyz";
, R.swift doesn't see any parameters, so treats it as a normal string, so the output is like"http%%3A%%2F%%2Fwww.abc.xyz"
"url" = "http%3A%2F%2Fwww.abc.xyz";
, R.swift takes strings like%3A
as parameters, and asks me to use the method likeR.string.urls.url(Double, Double, Double)
One of the workarounds that my friend came out with is to use a dummy parameter like
"url" = "http%%3A%%2F%%2Fwww.abc.xyz%@";
, so we can useR.string.urls.url("")
and the output is just what I wanted. But obviously it's just a workaround.Is there any better way?
The text was updated successfully, but these errors were encountered: