나의 발자취

클래스 본문

앱 개발/iOS

클래스

달모드 2023. 9. 3. 00:39
  • A class is another means of modeling real-life objects programmatically. 클래스는 실제 생활에 적용되는 객체들을 프로그래밍적 관점으로 모델링하는 것을 뜻하기도 한다
  • How to create a class using the class keyword. 
  • Using the init() method allows us to provide an instance with specific values right off-the-bat during the creation of an instance. 클래스의 init() 메서드는 인스턴스를 만들 때 바로 특정 밸류값을 가질 수 있도록 하는 기능이다.
  • A class can inherit another class’s properties and methods. 클래스는 다른 클래스의 속성과 메서드를 상속받을 수 있다.
  • When using inheritance, the subclass can use the override keyword to redeclare a method with the same name. 클래스를 상속받으면, 서브클래스는 override 키워드로 같은 메서드를 오버라이드 할 수 있다.
  • Classes are reference types, any copied class that has its properties altered will affect the original class from which it was copied. 클래스는 참조 타입이라, 복사된 클래스에서 속성값이 변경되면 원래의 오리지널 클래스도 영향을 끼친다.
    https://docs.swift.org/swift-book/documentation/the-swift-programming-language/classesandstructures/#Classes-Are-Reference-Types
728x90
반응형

'앱 개발 > iOS' 카테고리의 다른 글

iOS 앱 생명주기  (0) 2023.10.07
iOS 파일시스템 이해하기  (1) 2023.10.07
접근제어자 PROPERTIES AND ACCESS CONTROL  (0) 2023.07.22
Swift 함수 한번에 정리  (0) 2023.06.30
if-let 구문, 옵셔널 바인딩  (0) 2023.06.28
Comments