customcalculator's Introduction
customcalculator's People
customcalculator's Issues
逆ポーランド記法を用いて実装し直す
今後いろいろ対応できそう
()とかね
【コーディング規約】これを意識すること!!!
参考
https://qiita.com/yyokii/items/4c08e0c71fb6e881c47e
フォーマット
- 半角スペース4つ分(Text Editingで設定する)。
命名
- 出来る限り省略された名前を付けない。
- 副作用がない場合は、名詞を使用する。
- 副作用がある場合は、動詞を使用する
依存関係
- 必要最低限のものだけをimportする。(UIKitをインポートする必要がある場合は、Foundationをインポートしない。)
- import文はOS固有のフレームワークと外部フレームワークとの間に空行を1行入れて、アルファベット順に並べる。
宣言の順序
- class、struct、enum、extension、protocolなどの全ての宣言は // MARK: - <宣言の名前>を付ける。
アクセス修飾子
- privateとして宣言することをデフォルトとして、必要なときだけinternalまたはpublicとして外部に公開する。
型
- できる限り常にvarではなくletを使う。
- シンタックスシュガーを使用し短く書く。
- 必要な場合を除いて、変数やプロパティの型は宣言文の左側か右側のいずれか片側から推測できるようにする。
- Forced Unwrappingは避ける
コメント
- コメントは「なぜ?」という問いに答えるものであり、それ以外のことはコード自体が説明すべきである。
Collections / SequenceTypes
- isEmpty, first, lastを使用する(indexを使用しなくても良い場合は使用しない)
- countを使用する箇所はindicesを検討する → Off-by-oneエラーを回避できる
Self
- selfは省略する
- クロージャ内では[weak self]、guard let節を用いて循環参照のケアをする。 また、予期せぬクラッシュをケアする為に[unowned self]は使用しない。
SwiftUIで刷新&iPadでも綺麗になるように!
計算履歴を表示させる
ウィジェット四則演算!!!
電卓としての基本機能を実装する
更新方針
- 一般的な電卓にはないボタンの解説を、画像で行う
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.