시간복잡도 면에서 LinkedList와 차이가 없으며, 배열 구조로 유닛 테스트환경에서 임의의 값을 넣어주기 편하고, 구조가 단순하여 이해해기 좋다는 장점이 있어 채택하게 됨
연산 결과 부동소수점 오류
소수점 연산 시 부동 소수점 오류 때문에 제대로된 연산값이 나오지 않는 경우가 발생함
연산 결과값에 numberFormatter를 사용하여 해결함
func numberFormatter()->String{letnumberFormatter=NumberFormatter()
numberFormatter.numberStyle =.decimal
numberFormatter.maximumFractionDigits =20return numberFormatter.string(for:Double(self))??""}// 9x1.2 연산을 했을 때 10.79999999...가 나오던 오류를 10.8로 고쳐줌
ScrollView 화면 자동으로 하단 이동 구현
스크롤뷰에 스택 추가 할 때마다 스크롤뷰 밑으로 이동 구현
스택뷰를 추가할 때마다 offset값을 이용하여 맨 밑으로 이동하는 로직을 구현하였으나 바닥까지 내려가지 않음
-> offset값을 구하는 순간에 추가된 스택뷰를 포함하여 계산되지 않아 생긴 문제
-> layoutIfNeeded 메서드를 사용하여 뷰 드로잉 사이클을 기다리지 않고 즉시 실행되도록 변경함