当前位置:网站首页>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)
边栏推荐
- 在网上炒股开户可以吗?资金安全吗?
- Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
- Oh my Zsh + TMUX installation
- SLF4J 日志门面
- Sword finger offer10- I. Fibonacci sequence
- Integer int compare size
- Eureka自我保护
- idea将web项目打包成war包并部署到服务器上运行
- What is more elegant for flutter to log out and confirm again?
- Public and private account sending prompt information (user microservice -- message microservice)
猜你喜欢

剑指Offer05. 替换空格

Eureka self protection

Swagger

What is more elegant for flutter to log out and confirm again?

1-2 project technology selection and structure

Implement verification code verification

Record your vulnhub breakthrough record

实现验证码验证

Pki/ca and digital certificate

2.7 overview of livedata knowledge points
随机推荐
Introduction to concurrent programming (II)
How to deploy web pages to Alibaba cloud
Flutter: self study system
The future of cloud computing cloud native
Sword finger offer05 Replace spaces
Public and private account sending prompt information (user microservice -- message microservice)
[ManageEngine] the role of IP address scanning
QT OpenGL texture map
239. Sliding window maximum
手机号码变成空号导致亚马逊账号登陆两步验证失败的恢复网址及方法
LeetCode 0556.下一个更大元素 III - 4步讲完
[combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
Shutter: overview of shutter architecture (excerpt)
Dart: about grpc (I)
Sword finger offer10- I. Fibonacci sequence
剑指Offer04. 二维数组中的查找【中等】
Display time with message interval of more than 1 minute in wechat applet discussion area
Take you to the installation and simple use tutorial of the deveco studio compiler of harmonyos to create and run Hello world?
Oh my Zsh + TMUX installation
2020-10_ Development experience set