当前位置:网站首页>How to execute a swift for in loop in one step- How can I do a Swift for-in loop with a step?
How to execute a swift for in loop in one step- How can I do a Swift for-in loop with a step?
2022-07-03 03:48:00 【javail】
problem :
With the removal of the traditional C-style for-loop in Swift 3.0 , how can I do the following? Delete Swift 3.0 Chinese traditional C style for After the cycle , How do I do the following ?
for (i = 1; i < max; i+=2) { // Do something}In Python, the for-in control flow statement has an optional step value: stay Python in ,for-in The control flow statement has an optional step value :
for i in range(1, max, 2): # Do somethingBut the Swift range operator appears to have no equivalent: however Swift The range operator seems to have no equivalent :
for i in 1..<max { // Do something}Solution :
Reference resources : https://stackoom.com/en/question/2PBxa边栏推荐
- Is pytorch open source?
- ffmpeg之 一张/多张图片合成视频
- FileZilla client download and installation
- C语言HashTable/HashSet库汇总
- Ffmpeg recording screen and screenshot
- Don't use the new Dede collection without the updated Dede plug-in
- 编译文件时报错:错误: 编码GBK的不可映射字符
- Advanced redis applications [password protection, data persistence, master-slave synchronization, sentinel mode, transactions] [not completed yet (semi-finished products)]
- FileZilla Client下载安装
- Dynamic programming: Longest palindrome substring and subsequence
猜你喜欢

Summary of electromagnetic spectrum

Wechat applet + Alibaba IOT platform + Hezhou air724ug built with server version system analysis

学会pytorch能干什么?
![Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence](/img/60/bae0e8d92a53bcd2b2de3fb22b3b99.jpg)
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence

Positioning (relative positioning, absolute positioning, fixed positioning, Z-index) 2022-2-11

Leetcode: dynamic planning template

MongoDB复制集【主从复制】

SAP ui5 application development tutorial 105 - detailed introduction to the linkage effect implementation of SAP ui5 master detail layout mode

用Three.js做一個簡單的3D場景

简易版 微信小程序开发之页面跳转、数据绑定、获取用户信息、获取用户位置信息
随机推荐
Applet (continuous update)
[mathematical logic] propositional logic (equivalent calculus | idempotent law | exchange law | combination law | distribution law | De Morgan law | absorption rate | zero law | identity | exclusion l
Error in compiled file: error: unmapped character encoding GBK
Compare float with 0
For instruction, uploading pictures and display effect optimization of simple wechat applet development
2022年已过半,得抓紧
小程序获取用户头像和昵称
【DRM】DRM bridge驱动调用流程简单分析
Applet get user avatar and nickname
Mongodb installation & Deployment
js中#号的作用
[learning notes] seckill - seckill project - (11) project summary
在 .NET 6 项目中使用 Startup.cs
redis高级应用【密码防护、数据持久化、主从同步、哨兵模式、事务】【暂未完成(半成品)】
SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence
简易版 微信小程序开发之页面跳转、数据绑定、获取用户信息、获取用户位置信息
Numpy warning visibledeprecationwarning: creating an ndarray from ragged needed sequences
TCP, the heavyweight guest in tcp/ip model -- Kuige of Shangwen network
Ffmpeg download and installation tutorial and introduction