Problem that Optional<String>
(aka String?
) is not conform to StringProtocol
(and that makes sense). You should unwrap optional, there is several ways:
if let
/ guard
( if let version = dbData?.version { //compare }
)dbData!.version
, which is highly not recommended, because it can involve crashing an app, if Optional was nil
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.