toyprojects's Introduction
toyprojects's People
toyprojects's Issues
ChatViewController UI ๋ณ๊ฒฝ
// sendButton
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.setTitleColor(.white, for: .normal)
button.layer.cornerRadius = 10
button.backgroundColor = .smu
// chatTextField
textField.layer.borderColor = UIColor.smu.cgColor
textField.layer.cornerRadius = 10
textField.layer.borderWidth = 1
MainViewController
์ ํต์ผ์ฑ์ ์ฃผ๊ธฐ ์ํดsmu Color
์white Color
๋ง ์ฌ์ฉ.sendButton
๊ณผchatTextField
์mainViewButton
์ color ๋ณ๊ฒฝ.sendButton
๊ณผchatTextField
์ border ๋ฅผ ๊ทธ๋ ค์คฌ์.
- ๋ณ๊ฒฝ๋ UI
Database ๋ณ๊ฒฝ (๋ก์ปฌ -> AWS), ํ ์ด๋ธ ์ ์ฒด ์์
django ์์ ์ฌ์ฉํ๋ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ๋ก์ปฌ๋ก ๋๋ฆฌ๋ค๋ณด๋ ๋ค๋ฅธ ์ฌ๋์ด ์ ์์ด ๋ถ๊ฐ๋ฅํจ
-> django ๋ AWS ๋ก ์ฎ๊ธฐ๋ ๊น์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ ๊ฐ์ด ์ฎ๊ธฐ์
Realm, CoreData ๋๋ Firebase ๋ฅผ ์ฌ์ฉํ๋ ค ํ๋๋ฐ
๋๋ฌด iOS ์๋ง ํ์ ํ๋ ๊ฒ ๊ฐ์์ (๋์ค์ ์น๋ ์ฌ์ฉํ ์ ์์) ์ผ๋ฐ์ ์ธ DB ๋ก ํจ
Model - ChatViewController ์ฐ๊ฒฐ
// ChatViewController
let model = Model()
// ์ค๋ต
@objc func sendMessageAciton(sender: UIButton) {
guard let text = chatTextField.text else {
return
}
model.responseDjango(sendText: text)
ChatViewController
์์ ์ด๋ค ๋ฐฉ์์ผ๋กModel
์ ๋ถ๋ฌ ์ฌ ๊ฒ ์ธ๊ฐ.Dispatch
๋RxSwift
์ฌ์ฉํด๋ณด์.-
ViewController
์์๋ ์ต๋ํ View ๋ง ๊ทธ๋ฆฌ๊ฒ ํ์
Invalid MainViewController Animation
MVVM
- MVVM ์ผ๋ก ๊ฐ์ํ์๋ค.
- ViewModel ์ด๋ Model ์ ์ค์ ํ์.
- Protocol ๋ ์ ์๊ฐํด์ ๋ง๋ค์ด๋ด ์๋ค.
- Rx๋ฅผ ์ด์ฉํด์ ๋ค ํด๊ฒฐํด๋ด ์๋ค.
MainViewController Button UI ๋ณ๊ฒฝ ๋ฐ ์์น ์์ , ์ ์ฒด์ ์ธ UI ์์
startButton
๊ณผinfoButton
์ ์กฐ๊ธ ๋ ๋ฒํผ์ค๋ฝ๊ฒ ๋ง๋ค๊ธฐ- ๊ฐ Button ์ ์์น๋ ์ ๋งคํจ. ์์น ๋ณ๊ฒฝํ๊ธฐ.
- ์ ์ฒด์ ์ธ ๋์์ธ๋ ๋๋ฌด ๋จ์กฐ๋ก์. ์์ 2๊ฐ๋ง ์ฐ์ง๋ง๊ณ ํ๋ ๋ ์ถ๊ฐํด๋ณด์.
InfoViewController ์์ธ ๋ด์ฉ ์ถ๊ฐ
InfoViewController
์ ์์ธ ๋ด์ฉ ์ถ๊ฐํ๊ธฐ.- ์์ธ๋ด์ฉ: SMUChatbot ์ด ์ด๋ป๊ฒ ๋์ํ๋์ง, ์ฌ์ฉ๋ฒ ๋ฑ (๊ธธ๋ผ์ก์ด)
backgroundcolor
๋ ๋ณ๊ฒฝํ๊ธฐ. (UI ์ ๋๋ก ์ค์ ํ์)
MainViewController ์ ์ฝ ๋ณ๊ฒฝ, Button ๋ณ๊ฒฝ
label.font = .boldSystemFont(ofSize: 70)
label
์ ํฌ๊ธฐ๋ฅผ ๊ณ ์ ํ๋ Device ๋ง๋ค ๋ค๋ฅธ ๋๋ ์ฐ์ถ.- ํฌ๊ธฐ๋ฅผ ๋์ ์ผ๋ก ํ ๋นํ์.
- view์ ๋น์จ๋ก ์ ๊ทผํ๋ฉด ๋ ๋ฏ.
startButton
,infoButton
์์น๋ ๋ณ๊ฒฝํ๊ณ ๋์์ธ๋ ๋ณ๊ฒฝํ๊ธฐ (color, highlighted)
Shadow Error
The layer is using dynamic shadows which are expensive to render.
If possible try setting shadowPath
, or pre-rendering the shadow into an image and putting it under the layer.
dynamic shadow ๋ฅผ ์ด์ฉํด์ ๋๋๋ง ํ๋๋ฐ ๋น์ฉ์ด ๋ง์ด ๋ ๋ค๋๋ฐ
imageView.layer.shadowPath = UIBezierPath(roundedRect: imageView.bounds, cornerRadius: 10).cgPath
์ด๊ฑธ ์ถ๊ฐํ๋ฉด ๋๋คํด์ ์ถ๊ฐํด๋ดค์ผ๋
๊ธฐ์กด์ ์๋ shadow๊ฐ ๋ชจ๋ ์ง์์ง
์ฐพ์๋ณด๋ shadow ๋ layout ์ด ๋ชจ๋ ๊ทธ๋ ค์ง ํ ์ฌ์ฉํด์ผ ํ๋คํด์
override func layoutSubviews() {
super.layoutSubviews()
applyShadows()
}
func applyShadows() {
imageView.layer.shadowPath = UIBezierPath(roundedRect: imageView.bounds, cornerRadius: 10).cgPath
imageView.layer.shadowColor = UIColor.black.cgColor
imageView.layer.shadowRadius = 15
imageView.layer.shadowOpacity = 1
imageView.layer.shadowOffset = CGSize(width: 20, height: 0)
}
์ด๋ฐ ์์ผ๋ก ๊ตฌํํ๋๋ฐ
์ฒ์์๋ shadow ๊ฐ ๊ทธ๋ ค์ง์ง ์์๊ณ
์ค๊ฐ๋ถํฐ shadow ๊ฐ ๊ทธ๋ ค์ง๊ณ
๋ค์ ๊ทธ๋ ค์ง์ง ์์ cell ์ ๊ฐ๋ณด๋ cell ์ด ์
๋ฐ์ดํธ ๋์์.
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.