내가 처음으로 뒤로가기를 만들때 스토리보드에서 했던 방식이다 끔-찍.... 저렇게 세그로 연결하면 계속 메모리에 새로운 view controller들이 쌓이는 정말 최악의 문제가 발생한다. 메모리가 새는거다... 그럼 무조건 코드로 뒤로가기를 만들어야되나?? dismiss함수 쓰는거 말고 방법이 없나?? 고민했었는데 스토리보드에서도 뒤로가기 세그를 만드는 방법을 찾게 되었다! 1처럼 함수를 선언해주고 , 2처럼 버튼을 exit으로 드래그해서 만들면 된다.
update를 하자
https://stackoverflow.com/questions/38300702/swift-error-whose-view-is-not-in-the-window-hierarchy-performseguewithide Swift Error: "...whose view is not in the window hierarchy." performseguewithidentifier I want the app to move to the end screen once the last index of the array is reached. This is what I have for the code where "endWorkout" is the modal segue identifier: if (index < workouts2...
이것때문에 여러번 고생했는데, button에 무언가를 set 할때는 set함수를 써줘야 한다. 할당하는것 만으로는 되지 않는다. seeAgainButton.setImage(UIImage(named: "icon_check_active"), for: .normal) 이런식으로!!! .imageView?.image = UIImage ~ 이런식으로 적용하면 안되더라ㅠㅠ 마찬가지로 title 적용할 때도 setTitle로 해야한다.
'origin' view.frame.origin.x 까먹지말쟈
오늘은 QR코드 캡쳐 하는 화면에서, UIBezierPath: vector-based path를 만들 때 쓰는 것. 얘를 이용하면 custom path를 만들 수 있다!! 그냥 바로 만들 수 있는건 아니고, Core Graphics 위에 렌더링이 되기 때문에, 먼저 core graphics부터 만들어 줘야 한다. 순서는 이렇게 된다. 1. CGContext 를 쓴다 2. UIView에 있는 draw(_:) 함수를 쓴다. 그럼 context가 자동으로 제공되게 된다! 3. CAShapeLayer 오브젝트라는 특별한 레이어를 만들어 준다. 예제는 다음과 같다. func createRectangle() { // Initialize the path. path = UIBezierPath() // Specify t..