Sinter

Results 12 comments of Sinter

et dic 打错了,应该是let dic

```swift for i in 1...3{ print(i) } // output: // 1 // 2 // 3 // 使用terminator使循环打印更整洁 for i in 1...3 { print("\(i) ", terminator: "") } // output: //...

很多人用ss代理吧,简单一点的话就是用**Proxifier**软件,把ss代理转成全局代理 ss代理很多时候只有浏览器走,其他软件并不走。如Spotify。 如果挂的是VPN的话应该是没这个问题

```swift let a3 = a1 + a2 // ["one", "two", "three", "three", "four"] ```

```swift // 元组比较 // 会先比较第一个数,第一个无法比较才会比较第二个数 // 字符串比较和字母大小还有长度有关。先比较字母大小,在比较长度 ("apple", 1) < ("apple", 2) // true ("applf", 1) < ("apple", 2) // false ("appl", 2) < ("apple", 1) // true ("appm", 2)...

```swift let p0 = (0, 1) // _ 用来匹配所有可能的值 switch p0 { case (0, _): print("p0在Y轴上") default: break } // 临时赋值 switch p0 { case (let x, 0): print("the x...

```swift s1.contains(2) // true ```

```swift // _ 使函数调用时不显示参数标签 func f4(_ p: String) {} f4("p") // inout修改参数值 func swap(a: inout Int, b: inout Int) { let tmp = a a = b b = tmp...

上面的语法 print(2.5e4) // 2.5x10^2 这里的^2好像打错了字了,应该是^4 建议添加p语法 ```swift print(0xAp2) // 10*2^2 ```

```swift // 检测API可用性 if #available(iOS 10, *) {} if #available(macOS 10.12, *) {} if #available(iOS 10, macOS 10.12, *) {} ```