목록앱 개발/iOS (96)
나의 발자취

ViewController 파일과 뷰 삭제 후에 Cmd+N -> Cocoa Touch Class 를 누르고 상속받을 SuperClass를 지정하면 Class명이 디폴트로 'ViewController'로 지정된다. 만약 커스텀하고싶으면 앞에 아무렇게 커스텀해서 적으면 된다. 그러면 Assistant를 클릭했을때 아래와 같이 아직 연결이 되지 않았을 것이다. 해당 뷰의 Identity Inspector에서, 방금 만든 Class 코코아터치 파일로 Class 연결을 해준다.

UISegmentedControlUITextFieldUISliderUISwitchUIStepper실습을 했다. Question 1) Change UISlider Value to Int (from Float)UISlider의 기본 자료형은 Float형이다. 따라서 이것 자체를 바꾸는 방법은 여러가지가 있지만 출력때만 정수형으로 나오게 하고싶으면 print문에서의 형변환으로 손쉽게 바꿔줄 수 있다. @IBAction func actSliderValueChange(_ sender: Any) { label3.text = "\(Int(slider.value))" } Question 2) Action을 싣는 위치ViewDidLoad에 Action을 실어도 되고 위에 실어도 되고 상관은..

뷰 컨트롤러 생명주기에 따라, UIViewController를 상속하는 ViewController에 각 객체들을 오버라이딩하여 호출해봄.. 근데 이상하게 왜 viewWillDisappear, viewDidDisappear 는 호출이 되지 않을까?

iOS App View HierarchyStoryboard 기준으로, ViewController에 직접 뷰를 나타내면서 iOS 앱의 View 계층과 각 용어들에 대해 의미를 알아야 할 필요가 있다.상관관계를 잘 이해할 수 있도록 순차적으로 설명을 하겠다. 일단 쉽고 제일 필수적인 'View' 부터! ViewView는 윈도우에 그릴 수 있는, user action에 반응할 수 있는 직사각형 영역을 말한다. 즉, 1) 시각적으로 보여지고 2) 사용자 행동에 반응 3) 반응형 객체 이벤트 핸들링 4) content 출력의 역할을 한다. View는 직/간접적으로 NSView(Mac OSX) 혹은 UIView(iOS)를 상속받는다. AppKit, UIKit 프레임워크는 어플리케이션의 윈도우에 보이는 거의 모든 뷰..
UIColor ColorLiteral UIKit에서, Color. 대신 컬러칩으로 하고싶으면 ColorLiteral을 하면 뜬다. Optional Chaining 1) Force Unwrapping (optional!) 2) Check the nil value if optional != nil { optional! } 3) Optional binding (If-let) if let safeOptional = optional { safeOptional } 4) Nil Coalescing ( Optional ?? DefaultValue) 5) Optional Chaining ( optional?.property / optional?.method() )
그림에서부터 설명이 잘되어있다. https://velog.io/@minji0801/iOS-Application-Life-Cycle-iOS-%EC%95%B1%EC%9D%98-%EC%83%9D%EB%AA%85%EC%A3%BC%EA%B8%B0
아이폰 내에서의 파일시스템이 어떻게 이루어져있는지 정~말 기본적이지만 그동안 솔직히 iOS 공부를 못해서 까먹은 겸 다시 복기하는 차원에서 읽어본 글이다. https://medium.com/@lucideus/understanding-the-ios-file-system-eee3dc87e455
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 pr..