개발/아이오에스
우선 각 각의 컨트롤러는 import UIKit class SearchController: UIViewController{ override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .yellow } } 이런식으로 백그라운드 색상만 설정은 해놨다. 그리고 UITabBarController을 상속받은 MainTabController에서 templateNavigationController함수를 만들어 각 각의 뷰컨트롤러를 네비게이션컨트롤러로 선언을 해주고 unselectedImage와 selectedImage를 설정을 해줬다. func configureViewControllers(){ view.backgroundColor = .white..
개발/아이오에스
messageTextView.attributedText = attributedText 위 사진처럼 messageTextView에 attributedText을 통해 총 3가지의 폰트를 설정해줬습니다. let attributedText = NSMutableAttributedString(string: tweet.user.name, attributes: [NSAttributedString.Key.font:UIFont.boldSystemFont(ofSize: 16)]) let usernameString = " \(tweet.user.username)\n" attributedText.append(NSAttributedString(string: usernameString, attributes: [NSAttribute..
개발/아이오에스
developer.apple.com/documentation/uikit/uicollectionviewdelegateflowlayout/1617705-collectionview Apple Developer Documentation developer.apple.com func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return 0 } minimumLineSpacingForSectionAt을 사용해서 셀간격을 조절한다. (섹션의 연속적인 행 또는 열 사이의 간격을..
개발/아이오에스
가운데 로고 적용하기 (navigationItem.titleView), 네비게이션바 배경색 설정하기 private func setupRemainingNavItems() { let titleImageView = UIImageView(image: imageLiteral(resourceName: "title_icon")) titleImageView.frame = CGRect(x: 0, y: 0, width: 34, height: 34) titleImageView.contentMode = .scaleAspectFit navigationItem.titleView = titleImageView navigationController?.navigationBar.backgroundColor = .white navigat..
개발/아이오에스
let followButton: UIButton = { let button = UIButton() button.titleLabel?.font = UIFont.boldSystemFont(ofSize: 14) button.setImage(UIImage(systemName: "person.fill.badge.plus"), for: .normal) button.tintColor = twitterBlue button.layer.cornerRadius = 5 button.layer.borderColor = twitterBlue.cgColor button.layer.borderWidth = 1 button.setTitle("Follow", for: .normal) button.setTitleColor(twitterB..
개발
class HomeController: UICollectionViewController,UICollectionViewDelegateFlowLayout{ let cellId = "cellId" let headerId = "headerId" let footerId = "footerId" override func viewDidLoad() { super.viewDidLoad() collectionView.backgroundColor = .white collectionView.register(ContentCell.self, forCellWithReuseIdentifier: cellId) // 내용 collectionView.register(UICollectionViewCell.self, forSupplementa..