본문 바로가기 메뉴 바로가기

Peppo

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Peppo

검색하기 폼
  • 분류 전체보기 (221)
    • Story (13)
    • iOS (143)
      • Error (11)
    • 알고리즘 (43)
    • ETC (7)
    • React-Native (0)
    • CS (Computer science) (3)
  • 방명록

mutating (1)
[Swift] mutating

지난시간에 구조체, 클래스를 배웠는데요! 오늘은 구조체 안에 메소드를 변경할 수 있게 해주는 mutating 메소드를 알아볼거에요 ! 구조체 mutating 사전적의미 mutate: 돌연변이가 되다. / 돌연변이를 만들다. 구조체와 열거형 내부의 데이터를 수정할 때는 mutating 키워드를 선언 해주어야 합니다. 값 타입 프로퍼티들은 해당 인스턴스 메소드 내에서 수정할 수 없어요. 이걸 가능하게 해주는게 mutating 입니다!! struct Point { var x = 0.0, y = 0.0 mutating func moveBy(x deltaX: Double, y deltaY: Double) { print("beforeX:",x) // beforeX: 1.0 print("beforeY:",y) //..

iOS 2021. 12. 11. 16:35
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • Peppo's Github
TAG
  • Swift Leetcode
  • Swift 내림차순
  • Swift init
  • CS 네트워크
  • 2023년 회고
  • Swift inout
  • swift (programmers)
  • swift 고차함수
  • Class
  • RIBs tutorial
  • swift programmers
  • Swift Error Handling
  • Swift 프로그래머스
  • Swift joined
  • swift reduce
  • Swift 알고리즘
  • Swift 프로퍼티
  • Swift joined()
  • RTCCameraVideoCapturer
  • swift property
  • 원티드 프리온보딩
  • Swift RIBs
  • Combine: Asynchronous Programming with Swift
  • removeLast()
  • Swift
  • Swift ModernRIBs
  • ios
  • Swift final
  • swift protocol
  • iOS error
more
«   2025/07   »
일 월 화 수 목 금 토
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바