当前位置:网站首页>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边栏推荐
- node,npm以及yarn下载安装
- How to move towards IPv6: IPv6 Transition Technology - Shangwen network quigo
- 释放数据力量的Ceph-尚文网络xUP楠哥
- 简易版 微信小程序开发之页面跳转、数据绑定、获取用户信息、获取用户位置信息
- Pytorch multi card distributed training distributeddataparallel usage
- [DRM] simple analysis of DRM bridge driver call process
- pytorch开源吗?
- Pytoch lightweight visualization tool wandb (local)
- Ffmpeg one / more pictures synthetic video
- C # webrequest post mode, based on "basic auth" password authentication mode, uploads files and submits other data using multipart / form data mode
猜你喜欢

SAP UI5 应用开发教程之一百零五 - SAP UI5 Master-Detail 布局模式的联动效果实现明细介绍

User value is the last word in the competition of mobile phone market

Recursion: depth first search

How does the pytorch project run?

MongoDB简介

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

如何迈向IPv6之IPv6过渡技术-尚文网络奎哥

MongoDB安装 & 部署

Mysql Mac版下载安装教程

MySQL MAC download and installation tutorial
随机推荐
Error c2694 "void logger:: log (nvinfer1:: ilogger:: severity, const char *)": rewrite the restrictive exception specification of virtual functions than base class virtual member functions
Summary of electromagnetic spectrum
Positioning (relative positioning, absolute positioning, fixed positioning, Z-index) 2022-2-11
动态规划:最长回文子串和子序列
机械臂速成小指南(八):运动学建模(标准DH法)
Introduction to mongodb
MongoDB簡介
What is pytorch? Is pytorch a software?
Téléchargement et installation du client Filezilla
Convert binary stream to byte array
Recursive use and multi-dimensional array object to one-dimensional array object
[MySQL] the difference between left join, right join and join
Recursion: one dimensional linked lists and arrays
IPv6 transition technology-6to4 manual tunnel configuration experiment -- Kuige of Shangwen network
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 05 data input and output
900w+ data, from 17s to 300ms, how to operate
Null and undefined
Message queue addition failure
[mathematical logic] propositional logic (propositional and connective review | propositional formula | connective priority | truth table satisfiable contradiction tautology)
MongoDB复制集【主从复制】