본문 바로가기

메뉴47

[iOS Dev Tip] Status bar color whenever you have dark background, you need to set the status bar color as white. In order to make this happen, you can use following function in your vc. override var preferredStatusBarStyle: UIStatusBarStyle{ return .lightContent } However if your view controller is rooted by navigation controller, this method does not work. Instead you can use this settings. navigationController?.navigationBa.. 2021. 9. 3.
Graph & Tree 그래프 정의 - 그래프는 어느 노드와 어느 노드를 연결하는 간선이 있는 자료구조. 그래프 실생활 예 - 지도, 내비게이션, 지하철 지도 그래프 종류는 간선의 방향, 싸이클 유무에 따라서 나뉠수 있다. 간선 방향에 따른 그래프 종류: 무방향 그래프, 방향 그래프, 양방향 그래프 (사실상 무방향 그래프 = 양방향 그래프) 싸이클 유무에 따른 그래프 종류: 순환 그래프, 비순환 그래프 방향과 싸이클이 합해지면 다음과 같은 그래프가 나올수 있다. 방향성 비순환 그래프(DAG, Directed Acyclic Graph) DAG의 실생활 예 - VCS(Version Control System), Cryptocurrency ----------------------------------------------------.. 2021. 8. 20.
[Readable Coding Practice] How to make swiping view controller with swiping menu tab bar You can make swiping views with swiping menu bar by using collectionviews. This is the viewcontroller that app starts with. import UIKit class BaseViewController: UICollectionViewController { let menuBar: MenuBar = { let menuBar = MenuBar() //menuBar.vc = self menuBar.translatesAutoresizingMaskIntoConstraints = false return menuBar }() let backgroundColor: [UIColor] = [.brown, .blue, .darkGray, .. 2021. 8. 1.
[Readable Coding Practice] eliminate empty UItableView cells extension UITableView { func removeExcessCells() { tableFooterView = UIView(frame: .zero) } } By applying this code, you can make your tableview look like following pictures. 2021. 6. 28.
[Readable Code Practice] tableView Cell slide and delete func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { guard editingStyle == .delete else {return} datas.remove(at: indexPath.row) tableView.deleteRows(at: [indexPath], with: .left) } 2021. 6. 28.
Portfolio GitHub User Dictionary 프로젝트 리포지터리 사용한 기술 Swift 5, Xcode 12.5 Animation, Combine, MVVM-C, Singleton pattern, CocoaPod, UserDefaults, DiffableDataSource, REST API 수행 역할 MVVM - C 패턴을 적용해서 model, view, viewModel, Coordinator의 역할을 구분해서 구현 Combine을 이용해서 Reactive Programming으로 앱 기능들을 구현 모든 UI와 동작을 Storyboard없이 코드로만 구현 DiffableDataSource를 이용해서 검색할때 CollectionViewCell들이 이동하는 애니메이션 구현 REST Api를 이용해서 GitHu.. 2021. 6. 22.
[Readable Coding Practice] Show and dismiss loading signals fileprivate var containerView: UIView! extension UIViewController { func showLoadingView() { containerView = UIView(frame: view.bounds) view.addSubview(containerView) containerView.backgroundColor = .systemBackground containerView.alpha = 0 UIView.animate(withDuration: 0.25) { containerView.alpha = 0.8 } let activityIndicator = UIActivityIndicatorView(style: .large) containerView.addSubview(acti.. 2021. 6. 19.
[Readable Coding Practice] UIScrollView Pagination When you are working with REST API and and pulling out data from it, you sometimes cannot take all of the data down to your VC. In this case, by using pagination, you can show the data page by page. func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: UnsafeMutablePointer) { let offsetY = scrollView.contentOffset.y let contentHeight = sc.. 2021. 6. 19.
[Readable Coding Practice] Image Caching One of the best ways to reuse image data that you have already downloaded from network is image caching. By applying image caching, you can prevent slow app performance such as lagging. class GFAvatarImageView: UIImageView { static let cache = NSCache() } func downloadImage(from urlString: String) { let cacheKey = NSString(string: urlString) if let image = GFAvatarImageView.cache.object(forKey: .. 2021. 6. 19.