当前位置:网站首页>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)
边栏推荐
- Adult adult adult
- Integer string int mutual conversion
- 347. Top k high frequency elements
- 写一个简单的nodejs脚本
- 双链笔记·思源笔记综合评测:优点、缺点、评价
- Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
- Itext7 uses iexternalsignature container for signature and signature verification
- ES6 standard
- 2020-11_ Technical experience set
- 【附下载】密码获取工具LaZagne安装及使用
猜你喜欢
T430 toss and install OS majave 10.14
Wechat applet - basic content
Implement verification code verification
Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!
Unicode encoding table download
Cloud Computing future - native Cloud
If you can't learn, you have to learn. Jetpack compose writes an im app (II)
Record your vulnhub breakthrough record
Prompt unread messages and quantity before opening chat group
剑指Offer05. 替换空格
随机推荐
temp
Itext7 uses iexternalsignature container for signature and signature verification
Computer version wechat applet full screen display method, mobile phone horizontal screen method.
Comprehensive evaluation of double chain notes · Siyuan notes: advantages, disadvantages and evaluation
Shutter widget: centerslice attribute
剑指Offer10- I. 斐波那契数列
(construction notes) grasp learning experience
Sqoop1.4.4原生增量导入特性探秘
145. Post order traversal of binary tree
Atomic atomic operation
347. Top k high frequency elements
2020-11_ Technical experience set
在网上炒股开户可以吗?资金安全吗?
Wechat applet development - page Jump transfer parameters
Applet wxss introduction
Public and private account sending prompt information (user microservice -- message microservice)
elastic_ L01_ summary
Solve the problem of VI opening files with ^m at the end
Jsup crawls Baidu Encyclopedia
2020-09_ Shell Programming Notes