์ฐ์ Swift๋ Abstract ํด๋์ค๋ฅผ ๊ณต์์ ์ผ๋ก ์ง์ํ์ง ์์ต๋๋ค.
https://github.com/apple/swift-evolution/blob/main/proposals/0026-abstract-classes-and-methods.md ์ด๊ธฐ์ ์ผ๋ถ๋ฌ POP ์คํ์ผ์ ์ ๋ํ๊ธฐ ์ํด์ ๊ฒฐ๊ตญ ๋ฆฌ์ ํ๋ ๊ธฐ๋ก์ด ์์ต๋๋ค.
GitHub - apple/swift-evolution: This maintains proposals for changes and user-visible enhancements to the Swift Programming Lang
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - GitHub - apple/swift-evolution: This maintains proposals for changes and user-visible enhance...
github.com
ํ์ง๋ง POP๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์์์ด ํ์ํ ๊ฒฝ์ฐ๊ฐ ์๋ฏ์ด, Abstract class๊ฐ ํ์ํ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. (override function์์ fatalError๋ฅผ ๋ด๋ ์ฝ๋๊ฐ ์ข
์ข
์๊ฑฐ๋ ์.)
์์ ๊ฐ์ ๊ฒฝ์ฐ, ๋ค์ ๊ฐ์ ์ฐจ์
์ฑ
(๊ผผ์)์ ์ฌ์ฉํด ์ฐํํ ์ ์์ต๋๋ค.
public typealias AbstractClass = _AbstractClass & AbstractClassRequirements
@available(*, deprecated, message: "์ง์ ์ฌ์ฉํ์ง ๋ง๊ณ , typealias๋ Abstract Class๋ฅผ ์ฌ์ฉํ์ธ์")
open class _AbstractClass { ... }
public protocol AbstractClassRequirements { ... }
์์ ๊ฐ์ ๋ฐฉ์์ ์ฌ์ฉํ๋ฉด ์ ์ด๋ warning์ ํ์ํ๋ฉด์ ์ค์๋ฅผ ๋ฐฉ์งํ๋ฉฐ, Abstract ํด๋์ค์ ๊ฐ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
'iOS ๐ฅ > Swift' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Swift ์๋ฌ ์ฒ๋ฆฌ(Error Handling) (0) | 2021.06.25 |
---|---|
Swift ํด๋์ค ์์๊ณผ ์ด๊ธฐํ (0) | 2021.06.25 |
Codable Protocol์ ์ด์ฉํด์ ๋ณต์กํ JSON Parsing ํ๊ธฐ (0) | 2021.04.15 |
Swift Date์ String ๊ฐ์ ๋ณํ (0) | 2021.04.07 |
Swift Enum๊ณผ Optional (0) | 2021.02.09 |