-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ocean] Step3: MVC 간에 Square 정보 공유 방식 변경(객체 직접 전달 -> id 전달) #125
Open
OceanShape
wants to merge
14
commits into
codesquad-members-2022:Ocean
Choose a base branch
from
OceanShape:Ocean
base: Ocean
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rectangle: Square의 사각형 정보만을 담는 구조체(Plane과 ViewController 간에 Square 직접 전달을 막기 위함)
Rectangle을 사용할 때, 원본 Square의 값을 변경하는 실수를 막기 위함
- Model(Plane) - 사각형 정보가 담긴 배열을, id-Square로 매칭된 해시맵으로 변경 - 클릭한 점을 기준으로 사각형을 찾는 subscript도 해시맵을 역순으로 탐색하여, 해당 Square의 id만을 출력하도록 수정 - NotificationCenter에서 Square 대신 id와 Rectangle이 전달하도록 변경 - setSquareColor()/setSquareAlpha() 추가 - Controller(ViewController) - squareDidDraw()에서 직접 사각형에 해당하는 UIView를 생성하여 DrawingSection(View)에 전달하도록 수정 - planeViews와 selectedSquare를 DrawingSection으로 이동 - selectedSquare 이동은 이후 개선에 따라 다시 ViewController로 돌아올 수 있음 - View(DrawingSection) - addSquare() 수정 - setSquareBorder() - 선택된 사각형이 있을 때, 테두리를 그려줌 - setSquareColor()/setSquareAlpha() 추가 - 선택된 사각형이 존재할 때, 색상/투명도를 설정해 줌
- StatusSection.alphaStatus를 UIStepper에서 UISlider로 바꾸었다. - 부드러운 투명도 변화를 위해, Model의 alpha값도 float로 바꿀 예정 - ViewController에서 View와 Model에 투명도 정보를 전달할 때, Float로 변환하여 전달하도록 함수의 매개변수를 수정
- StatusSection 변경 사항 - backgroundColorStatus의 delegate를 StatusSection.delegate로 설정하는 코드(didSet) 추가 - setUserInteractionEnabled()/setColor(UIColor) 추가 - 사각형의 색상을 입력/출력하는 도중에 발생하는 케이스에 따른 델리게이트 함수 구현 - touchesBegan()/textFieldDidBeginEditing()/textFieldDidEndEditing()/textFieldShouldReturn()/textField()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.