当前位置:网站首页>Keep learning swift
Keep learning swift
2022-07-03 12:34:00 【iWillook】
//
// main.swift
// Ultimate
//
// Created by Mewlan Musajan on 3/6/21.
//
import Foundation
@propertyWrapper
struct TwelveOrLess {
private var number: Int
init() {
self.number = 0
}
var wrappedValue: Int {
get {
number
}
set {
number = min(newValue, 12)
}
}
}
struct SmallRectangle {
@TwelveOrLess var height: Int
@TwelveOrLess var width: Int
}
var rectangle = SmallRectangle()
print(rectangle.width)
rectangle.height = 10
print(rectangle.height)
rectangle.width = 24
print(rectangle.width)
边栏推荐
- DEJA_ Vu3d - cesium feature set 053 underground mode effect
- Introduction to concurrent programming (I)
- Dart: view the dill compiled code file
- regular expression
- 云计算未来 — 云原生
- Use of atomicinteger
- Alibaba is bigger than sending SMS (user microservice - message microservice)
- JVM内存模型
- Itext7 uses iexternalsignature container for signature and signature verification
- idea将web项目打包成war包并部署到服务器上运行
猜你喜欢
Swagger
What is more elegant for flutter to log out and confirm again?
Public and private account sending prompt information (user microservice -- message microservice)
(construction notes) ADT and OOP
QT OpenGL texture map
Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
With pictures and texts, summarize the basic review of C language in detail, so that all kinds of knowledge points are clear at a glance?
Flutter 退出登录二次确认怎么做才更优雅?
Wechat applet - basic content
T430 toss and install OS majave 10.14
随机推荐
20. Valid brackets
Eureka自我保护
232. Implement queue with stack
Dart: about Libraries
GCN thinking - word2vec directly calculates text classification
剑指Offer09. 用两个栈实现队列
If you can't learn, you have to learn. Jetpack compose writes an im app (I)
Sqoop1.4.4原生增量导入特性探秘
Lambda表达式
Use of atomicinteger
Eureka self protection
(construction notes) learn the specific technology of how to design reusable software entities from three levels: class, API and framework
347. Top k high frequency elements
repo Manifest Format
ImportError: No module named examples. tutorials. mnist
OpenStack节点地址改变
Cloud Computing future - native Cloud
temp
Lambda expression
CNN MNIST handwriting recognition