Problem Using '!' will be removed in a future release [duplicate]
This question is an exact duplicate of:
Using '!' here is deprecated and will be removed in a future release - swift 4.2
2 answers
if let encodingName = response?.textEncodingName as CFString! , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
Any ideas for my problem??
ios swift swift4.2
marked as duplicate by Bob Gilmore, Tamás Sengel, Community♦ Nov 26 '18 at 7:58
This question was marked as an exact duplicate of an existing question.
add a comment |
This question is an exact duplicate of:
Using '!' here is deprecated and will be removed in a future release - swift 4.2
2 answers
if let encodingName = response?.textEncodingName as CFString! , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
Any ideas for my problem??
ios swift swift4.2
marked as duplicate by Bob Gilmore, Tamás Sengel, Community♦ Nov 26 '18 at 7:58
This question was marked as an exact duplicate of an existing question.
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42
add a comment |
This question is an exact duplicate of:
Using '!' here is deprecated and will be removed in a future release - swift 4.2
2 answers
if let encodingName = response?.textEncodingName as CFString! , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
Any ideas for my problem??
ios swift swift4.2
This question is an exact duplicate of:
Using '!' here is deprecated and will be removed in a future release - swift 4.2
2 answers
if let encodingName = response?.textEncodingName as CFString! , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName))
)
Any ideas for my problem??
This question is an exact duplicate of:
Using '!' here is deprecated and will be removed in a future release - swift 4.2
2 answers
ios swift swift4.2
ios swift swift4.2
asked Nov 25 '18 at 16:33
JuleesCJuleesC
61
61
marked as duplicate by Bob Gilmore, Tamás Sengel, Community♦ Nov 26 '18 at 7:58
This question was marked as an exact duplicate of an existing question.
marked as duplicate by Bob Gilmore, Tamás Sengel, Community♦ Nov 26 '18 at 7:58
This question was marked as an exact duplicate of an existing question.
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42
add a comment |
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42
add a comment |
1 Answer
1
active
oldest
votes
Just use
if let encodingName = response?.textEncodingName as? CFString , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName)))
}
The issue is caused by casting to CFString!
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just use
if let encodingName = response?.textEncodingName as? CFString , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName)))
}
The issue is caused by casting to CFString!
add a comment |
Just use
if let encodingName = response?.textEncodingName as? CFString , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName)))
}
The issue is caused by casting to CFString!
add a comment |
Just use
if let encodingName = response?.textEncodingName as? CFString , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName)))
}
The issue is caused by casting to CFString!
Just use
if let encodingName = response?.textEncodingName as? CFString , convertedEncoding == nil {
convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(
CFStringConvertIANACharSetNameToEncoding(encodingName)))
}
The issue is caused by casting to CFString!
answered Nov 25 '18 at 16:43
DionizBDionizB
1,0552515
1,0552515
add a comment |
add a comment |
@BobGilmore probably but I cant apply it :/
– JuleesC
Nov 25 '18 at 16:42