当前位置:网站首页>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)
边栏推荐
- If you can't learn, you have to learn. Jetpack compose writes an im app (II)
- JVM memory model
- Display time with message interval of more than 1 minute in wechat applet discussion area
- Shutter: overview of shutter architecture (excerpt)
- C language improvement article (wchar_t) character type
- Solve the problem of VI opening files with ^m at the end
- Redis
- Sword finger offer09 Implementing queues with two stacks
- ImportError: No module named examples. tutorials. mnist
- 257. All paths of binary tree
猜你喜欢

Wechat applet pages always report errors when sending values to the background. It turned out to be this pit!

Shutter: add gradient stroke to font

Sword finger offer07 Rebuild binary tree

Implement verification code verification

公纵号发送提示信息(用户微服务--消息微服务)

剑指Offer09. 用两个栈实现队列

ES6新特性

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?

If you can't learn, you have to learn. Jetpack compose writes an im app (II)

Sword finger offer06 Print linked list from end to end
随机推荐
Tensorflow binary installation & Failure
Sword finger offer06 Print linked list from end to end
记录自己vulnhub闯关记录
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
Flutter Widget : Flow
(construction notes) grasp learning experience
Airflow installation jump pit
Fluent: Engine Architecture
Comprehensive evaluation of double chain notes · Siyuan notes: advantages, disadvantages and evaluation
Record your vulnhub breakthrough record
Introduction to concurrent programming (I)
TOGAF认证自学宝典V2.0
Sword finger offer09 Implementing queues with two stacks
公纵号发送提示信息(用户微服务--消息微服务)
剑指Offer04. 二维数组中的查找【中等】
Lambda expression
error: expected reference but got (raw string)
elastic_ L01_ summary
JVM内存模型
Sword finger offer03 Repeated numbers in the array [simple]