Skip to content

Instantly share code, notes, and snippets.

@acalism
Created March 19, 2018 07:08
Show Gist options
  • Save acalism/1b6fa79d9472900e53a40b8e88ff905e to your computer and use it in GitHub Desktop.
Save acalism/1b6fa79d9472900e53a40b8e88ff905e to your computer and use it in GitHub Desktop.
Basic Statements
// 1. for 循环条件筛选
let urlStrings: [String?] = ["https://baidu.com", nil, "https://im.qq.com"]
for case let urlString? in urlStrings where !urlString.isEmpty {
if let u = URL(string: url) {
print(u)
}
}
// 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment