Coder Social home page Coder Social logo

toyprojects's Introduction

toyprojects's People

Contributors

hogumachu avatar

Watchers

 avatar

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

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2021-08-04 แ„‹แ…ฉแ„’แ…ฎ 11 29 42

Console ์—์„œ ๋ญ๋ผ๋ญ๋ผ ์—๋Ÿฌ๊ฐ€ ๋‚˜์˜ด ...

์ผ๋‹จ ํ™”๋ฉด์€ ์ž˜ ๋‚˜์˜ค์ง€๋งŒ ์ถ”ํ›„ ๋ฌธ์ œ๊ฐ€ ๋  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ํ•ด๊ฒฐํ•ด๋ณด์ž.

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.