일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- appstore
- geofencing
- SwiftUI
- github
- view
- Swift
- iOS16
- darkmode
- Realm
- Archive
- 개발자
- FLUTTER
- UIButton
- mac
- 한글
- Firebase
- error
- Session
- MacOS
- IOS
- Notification
- window
- JPA
- 웹뷰
- Xcode
- Code
- Apple
- rxswift
- Git
- 이미지
- Today
- Total
목록IOS (176)
EEYatHo 앱 깎는 이야기
scrollViewDidEndScrollingAnimation: 프로그래밍 방식으로 생성 된 스크롤이 완료되면 호출됩니다. scrollViewDidEndDecelerating: 사용자 스와이프 스크롤이 완료되면 호출됩니다. 정답 : scrollViewDidEndDecelerating 얘를 썼어야 했다..!
정규식과 NSRegularExpression.matches 를 이용하면 된다. 한글, 영어, 숫자, 밑줄만 허용하는 정규식 : "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9_]$" 입력받은 문자열이 정규식에 만족하지는 체크하는 함수 알맞은 문자열 : return true 부적합한 문자열 : return false private func nameValidation(text: String) -> Bool { // String -> Array let arr = Array(text) // 정규식 pattern. 한글, 영어, 숫자, 밑줄(_)만 있어야함 let pattern = "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9_]$" if let regex = try? NSRegularExpression(pattern: patt..
일일히 버튼 만들고 선택 상태에서 UI 바꾸고.. 그러다가 UISwitch 란걸 알게되었다. 넘무 좋아 누르면 알아서 상태바뀌고, 상태 저장도 해주고, 애니메이션까지?! 세상에 네상에 UISwitch 선언 private lazy var pushSwitch: UISwitch = { let mySwitch = UISwitch() mySwitch.onTintColor = Resource.Color.bgYellow02 mySwitch.thumbTintColor = Resource.Color.orange06 mySwitch.addTarget(self, action: #selector(onClickSwitch(sender:)), for: .valueChanged) return mySwitch }() + 스위치 선택..
UISearchBar 선언부 lazy var searchBar: UISearchBar = { let searchbar = UISearchBar() let placeholderText = "검색어를 입력해 주세요." searchbar.placeholder = placeholderText if let textField = searchbar.value(forKey: "searchField") as? UITextField { textField.backgroundColor = .white if let font = UIFont(name: Resource.Font.NanumSquareRoundR.rawValue, size: 16) { let placeholderAttributedText = NSAttributedSt..
일반적으로 shadow랑 corner radius를 같이하면 적용이 안되는데, Cell은 비교적 쉽게 구현할 수 있다. Cell 안에서 Layout할 때, func setupLayout() { layer.shadowColor = UIColor.black.cgColor layer.shadowOpacity = 0.5 layer.shadowRadius = 10 contentView.layer.cornerRadius = 10 contentView.layer.masksToBounds = true } 이렇게, Cell 에 shadow를 넣고, Cell의 contentView에 corner radius를 넣으면 된다.
URL, Data, FileManager...... 꽤나 많은 삽질을 했지만 간단했다.. 그냥 xcode프로젝트에 에 xml파일 넣어주고, if let path = Bundle.main.url(forResource: "[XML파일이름(확장자 없이)]", withExtension: "xml") { if let parser = XMLParser(contentsOf: path) { parser.delegate = self parser.parse() } } 이거하면 파싱 시작 됩니다. 그럼 델리게이트에서 ... 태그단위로 쭉쭉 뽑혀나옵니다. 간혈적으로 이상하게 뽑힌다거나 \n을 이상하게 처리한다거나 해서 오류처리 빡심..ㅜ
[ NotificationCenter로 백그라운드 감지 ] if #available(iOS 13.0, *) { NotificationCenter.default.addObserver(self, selector: #selector(taskFunc), name: UIScene.willDeactivateNotification, object: nil) } else { NotificationCenter.default.addObserver(self, selector: #selector(taskFunc), name: UIApplication.willResignActiveNotification, object: nil) } [ NotificationCenter로 포그라운드 감지 ] if #available(iOS 13.0..
카카오, 구글 로그인 iOS 서버 2중 인증에 이어서 애플이다. [ 카카오 로그인 iOS 서버 2중 인증 글 바로가기 ] iOS, Swift, SNS로그인 서버 2중 인증(카카오 로그인 iOS-서버 2중 인증) 열심히 iOS + 서버개발 인턴 하는 중. 시니어 개발자분이 말씀하시길! iOS에서 SNS 로그인으로 토큰을 받고, 서버에 넘겨주면, (토큰의 종류는 SNS마다 다름) 서버는 받은 토큰으로 SNS 서버에 유효성 eeyatho.tistory.com [ 구글 로그인 iOS 서버 2중 인증 글 바로가기 ] 구글 Google 로그인 iOS 서버 2중 인증 카카오 로그인 iOS 서버 2중 인증에 이어서 구글이다. [ 카카오 로그인 iOS 서버 2중 인증 글 바로가기 ] eeyatho.tistory.com/..