[카테고리:] iOS

iOS

view에 border 추가

# 전체 border view.layer.borderColor = UIColor.red.cgColor view.layer.borderWidth = 1.0   # 특정 부분만 border extension CALayer { func addBorder(_ arr_edge: [UIRectEdge], color: UIColor, width: CGFloat) { for edge in arr_edge { let border = CALayer()Continue reading

iOS

swipe back gesture

# 기본 네비게이션 건트롤을 사용하는 경우 클래스에 UIGestureRecognizerDelegate 추가 viewDidLoad()에 navigationController?.interactivePopGestureRecognizer?.delegate = self 추가 (nil도 됨)   # 기본 네비게이션바를 숨기고 커스텀 네미게이션 컨트롤을 사용하는 경우 클래스에 UIGestureRecognizerDelegate 추가 viewDidLoad()에 navigationController?.interactivePopGestureRecognizer?.delegate = nil 추가

iOS

셀렉트바 타이틀 좌우 이미지 버튼 생성 방법

let button: UIButton = UIButton(type: UIButtonType.custom) button.setImage(UIImage(named: “arrow_right.png”), for: UIControlState.normal) button.addTarget(self, action: #selector(CounselorTabController.OnMenuClicked), for: UIControlEvents.touchUpInside) button.widthAnchor.constraint(equalToConstant: 20.0).isActive = true button.heightAnchor.constraint(equalToConstant: 20.0).isActive = true let barButton = UIBarButtonItem(customView: button)     let homeButton : UIBarButtonItem =Continue reading