๊ธ€ ์ž‘์„ฑ์ž: ์ด์ง€์›๐ŸŒฉ๏ธ
private lazy var profileImageView: UIImageView = {
    let imageView = UIImageView()
    imageView.translatesAutoresizingMaskIntoConstraints = false
    imageView.contentMode = .scaleAspectFill
    imageView.layer.cornerRadius = imageView.frame.size.height * 0.5
    return imageView
}()

์ด๋ฏธ์ง€ ๋ทฐ๋ฅผ ์ดˆ๊ธฐํ™”ํ•  ๋•Œ cornerRadius ๊ฐ’์„ imageView.frame.size.height / 2๋ฅผ ํ•˜๋ฉด ์ ์šฉ์ด ์•ˆ๋œ๋‹ค. ์ด๊ฒŒ ์™œ ์•ˆ๋˜๋Š”์ง€ ๋ชฐ๋ผ์„œ ๋‹ค๋ฅธ ์ฝ”๋“œ์—์„œ๋Š” ์ž„์˜๋กœ ์ƒ์ˆ˜๋กœ ์ ์šฉํ–ˆ์—ˆ๋‹ค. ๋‚˜๋Š” ์ด๋ฏธ์ง€ ๋ทฐ์˜ ํฌ๊ธฐ๋ฅผ ์˜คํ†  ๋ ˆ์ด์•„์›ƒ์œผ๋กœ ์ง€์ •ํ•ด์ค˜์„œ(leadingAnchor, trailingAnchor) ํ”„๋ ˆ์ž„๊ฐ’์ด ์—†์—ˆ๊ณ , ์—†๋Š” ํ”„๋ ˆ์ž„ ๊ฐ’์„ ๊ฐ€์ง€๊ณ  ์ ์šฉํ•˜๋ ค๊ณ  ์•ˆ๋˜๋Š” ๊ฑฐ ์˜€๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ์ฐพ์•„๋ณด๋‹ˆ๊นŒ cornerRadius ๊ฐ’์„ viewWillLayoutSubviews ๋•Œ ์—…๋ฐ์ดํŠธ ํ•˜๋ผ๋Š” ๊ฒƒ์ด์—ˆ๋‹ค. ๋ทฐ์˜ ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ์ด์šฉํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค. ์ด ๋ฐฉ๋ฒ• ๋ง๊ณ ๋„ UIButton์˜ ์„œ๋ธŒํด๋ž˜์Šค๋ฅผ ๋งŒ๋“ค์–ด์„œ ํ•˜๋Š” ๋ฐฉ์‹๋„ ์žˆ๋‹ค. ์ฐธ๊ณ 

์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ–ˆ๋‹ค.

override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()
    tweetFloatingButton.layer.cornerRadius = tweetFloatingButton.frame.size.height / 2
}
๋ฐ˜์‘ํ˜•