iOS(83)
-
imageView나 button의 터치영역 넓히기
https://stackoverflow.com/questions/31056703/how-can-i-increase-the-tap-area-for-uibutton How can I increase the Tap Area for UIButton? I use UIButton with auto layout. When images are small the tap area is also small. I could imagine several approaches to fix this: increase the image size, i.e., place a transparent area around the stackoverflow.com https://stackoverflow.com/questions/11875161/h..
2022.02.23 -
tabbarcontroller에서 segue연결 해제 후, 다시 segue연결을 하려고 할때 주의할점(feat. tabbar 추가)
just 참고) NSRangeException index 4 beyond bounds [0 .. 3] - Stack ...~~~~ 4번째 탭과 뷰컨의 연결을 끊어준뒤 빌드했을때 이런 에러가 났었다. 본론 Main스토리보드에서 4번째 tab과 어떤VC와 연결된 segue를 delete로 날려버리고, 앗 실수, 다시 연결할뤠,,,, 했더니 (연결은 잘 됐음) 4번째 탭에서 원래 보여지던 화면이 아닌 다른 화면이 보여짐(5번째 탭에 있던 화면이 4번째 탭화면을 탭했을때 보여짐) 엥. 알고보니 탭바뷰컨트롤러를 다른 뷰컨에 segue로 연결할때 순차적으로 연결이 되는데 이런식으로 연결되었던 특정 segue의 연결을 해지하게 되면,(예를들어 4번째탭의 segue연결을 해지하게되면) 5개였던 탭바가 4개로 바뀌게 되..
2022.02.23 -
UITapGestureRecognizer랑 addtarget이 뭔차이지..(내일..다시..확인..)
요놈봐라..생긴거보니까 addtarget과 비슷한 역할을 하는것 같긴한데.. 왜왜 .. 왜때문에 UITapGestureRecognizer를 쓰나요? addtarget만 줄곧 써왔던 1인 참고) 변수이름이 addBtn이긴 하지만 UIButton이 아니고 uiImageView입니다. let tabGestureAdd = UITapGestureRecognizer(target: self, action: #selector(addContent)) addBtn.addGestureRecognizer(tabGestureAdd) addBtn.isUserInteractionEnabled = true 큰차이점 uiView를 터치했을때 이벤트를 주고 싶다 -> addGestureRecognizer uiButton을 터치했을때 이..
2022.02.23 -
NSUserTrackingUsageDescription error(The app's Info.plist must contain~)
아이폰 11버전 이하에서 아래와 같은 오류 문구를 뱉으며 앱이 크래시가 났음. The app's Info.plist must contain an NSUserTrackingUsageDescription key with a string value explaining to the user how the app uses this data. 앱이 14버전 이상이고, splashVC에서 ATTrackingManager.requestTrackingAuthorization 설정을 해줬었는데(available iOS14로), 안됐던게 의아했음. (코드로 설정해줬으면 info.plist에서 설정 안해줘도 되는거아닌가.. 라고 생각했었는데) info.plist에 키값을 Privacy - Tracking Usage Descr..
2022.02.22 -
iOS) stackView의 frame.width가 0.0으로 나올때 (feat. layoutIfNeeded())
https://stackoverflow.com/questions/62121352/why-view-frame-width-returns-zero Why view.frame.width returns zero? I created stackView and added three labels to it. Also I put these constraints let nameLabel = UILabel() //set .text, .mode and other for nameLabel let ellipsisLabel = UILabel() //set .text, .mode... stackoverflow.com 개발자 사는거 다 똑같..! 왜 내 width가 zero를 리턴하나요..! stackView안에 uiImage가 set..
2022.02.15 -
iOS) 특정 iPhone, iPad에서 tableView cell안에 있는 버튼이 클릭이 안될때..(feat. addtarget, lazy var, dellocation)
https://stackoverflow.com/questions/28894765/uibutton-action-in-table-view-cell UIButton action in table view cell I am trying to run an action for a button being pressed within a table view cell. The following code is in my table view controller class. The button has been described as "yes" in an outlet in my stackoverflow.com 테이블뷰 내부에 있는 테이블뷰 셀에, vertical stackView를 넣고 vertical stackView 내부에 l..
2022.02.14