๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ป iOSun
article thumbnail
[iOS] NotificationCenter ๋™์ž‘ ๋ฐฉ์‹๊ณผ ํ™œ์šฉ ๋ฐฉ์•ˆ์— ๋Œ€ํ•ด ์„ค๋ช…ํ•˜์‹œ์˜ค.
iOS 2023. 3. 31. 20:32

NotificationCenter๋ž€? observer(๊ด€์ฐฐ์ž)์—๊ฒŒ ์ •๋ณด๋ฅผ ์ „๋‹ฌํ•ด์ฃผ๋Š” ์•Œ๋ฆผ ๋ฐœ์†ก ๋ฉ”์ปค๋‹ˆ์ฆ˜ ์–ธ์ œ Notification ์„ผํ„ฐ๋ฅผ ์‚ฌ์šฉ? ์•ฑ ๋‚ด์—์„œ ๊ณต์‹์ ์ธ ์—ฐ๊ฒฐ์ด ์—†๋Š” ๋‘ ๊ฐœ ์ด์ƒ์˜ ์ปดํฌ๋„ŒํŠธ๋“ค์ด ์ƒํ˜ธ์ž‘์šฉ์ด ํ•„์š”ํ•  ๋•Œ ์ƒํ˜ธ์ž‘์šฉ์ด ๋ฐ˜๋ณต์ ์œผ๋กœ ๊ทธ๋ฆฌ๊ณ  ์ง€์†์ ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ์•ผ ํ•  ๋•Œ ์ผ๋Œ€๋‹ค ๋˜๋Š” ๋‹ค๋Œ€๋‹ค ํ†ต์‹ ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ 1. Observer(๊ด€์ฐฐ์ž) ๋“ฑ๋ก NotificationCenter.default.addObserver( self, selector: #selector(scrollToBottom), // ์•Œ๋ฆผ์„ ๋ฐ›์„ ๋•Œ ์ˆ˜ํ–‰ํ•  action name: NSNotification.Name("TestNotification"), object: nil ) ์•Œ๋ฆผ์„ ๋ฐ›๊ณ  ์‹ถ์€ ๋ถ€๋ถ„์— observer๋ฅผ ๋“ฑ๋กํ•œ๋‹ค...

article thumbnail
iOS 13 ์ดํ›„ SceneDelegate ๋“ฑ์žฅ
iOS 2023. 3. 14. 21:54

๐Ÿ“Œ iOS 13 ์ด์ „ iOS 13์ด์ „์—๋Š” SceneDelegate๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์•˜๋‹ค..! ๋Œ€์‹  AppDelegate๊ฐ€ ์กด์žฌํ–ˆ๋Š”๋ฐ AppDelegate๋Š” ๋‘๊ฐ€์ง€ ์—ญํ• ์ด ์žˆ์—ˆ๋‹ค. ์‹œ์Šคํ…œ์ด ํ”„๋กœ์„ธ์Šค๊ฐ€ ์‹œ์ž‘๋˜๊ฑฐ๋‚˜ ์ข…๋ฃŒ๋  ๋•Œ appdelegate์—๊ฒŒ ์•Œ๋ฆผ ์•ฑ์— UI ์ƒํƒœ๋ฅผ ์•Œ๋ฆผ (์˜ˆ๋ฅผ ๋“ค์–ด ์•ฑ์ด ํฌ๊ทธ๋ผ์šด๋“œ์— ์žˆ๊ฑฐ๋‚˜ ์ด์ œ active์ƒํƒœ๊ฐ€ ๋ ๊ฑฐ๋‚˜ ๊ฐ™์€ ๊ฑธ ์•Œ๋ ค์คŒ) ์‚ฌ์‹ค ์ด๋Ÿฐ ์—ญํ• ์€ 12๋ฒ„์ „ ์ด์ „์—๋Š” ๊ดœ์ฐฎ์•˜๋‹ค. ์™œ๋ƒ๋ฉด 1๊ฐœ์˜ ์•ฑ์—” 1๊ฐœ์˜ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ์žˆ์—ˆ๊ธฐ๋•Œ๋ฌธ! ๐Ÿ“Œ iOS 13 ์ดํ›„ but 13๋ฒ„์ „ ์ดํ›„๋ถ€ํ„ฐ๋Š” ์œ„์˜ ์‚ฌ์ง„์ฒ˜๋Ÿผ 1๊ฐœ์˜ ์•ฑ์ด ์—ฌ๋Ÿฌ๊ฐœ์˜ ์ฐฝ(scene)์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด์„œ SceneDelegate๊ฐ€ ๋“ฑ์žฅํ•˜๊ฒŒ ๋œ ๊ฒƒ์ด๋‹ค!! ์œ„์— ๋งํ–ˆ๋˜ AppDelegate์˜ 2๋ฒˆ ์—ญํ• ์„ ์”ฌ๋”œ๋ฆฌ๊ฒŸ์ด ๋งก๊ฒŒ ๋œ..

article thumbnail
[iOS] UIButton image ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ •๋ ฌํ•˜๊ธฐ, scale ๋ณ€๊ฒฝํ•˜๊ธฐ
iOS 2023. 1. 12. 00:55

์œ„์™€ ๊ฐ™์€ ํด๋ฆญ UIButton์ด ์žˆ๋‹ค. button image๋ฅผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ด๋™ button.semanticContentAttribute = .forceRightToLeft button image scale ๋ณ€๊ฒฝ button.setPreferredSymbolConfiguration(.init(scale: .large), forImageIn: .normal) ์ „์ฒด ์ฝ”๋“œ (code base) import UIKit class ViewController: UIViewController { private lazy var button: UIButton = { let button = UIButton() button.setTitle("ํด๋ฆญ", for: .normal) button.setTitleColor(.blac..

profile on loading

Loading...