분류 전체보기 (161) 썸네일형 리스트형 swift] Photos 프레임워크 www.boostcourse.org/mo326/lecture/16867 iOS 앱 프로그래밍 부스트코스 무료 강의 www.boostcourse.org Photos 프레임워크는 iOS 및 macOS에서 사진 애플리케이션, 사진 확장 기능을 지원하는 클래스를 제공합니다 이 프레임워크를 사용하여 화면에 표시 및 재생할 에셋을 검색하고 이미지 또는 비디오를 편집하거나 앨범, 특별한 순간 및 iCloud 공유 앨범과 같은 에셋을 사용하여 작업할 수 있습니다. var fetchResult: PHFetchResult! Photos 프레임워크 모델 클래스 (PHAsset, PHAssetCollection, PHCollectionList)의 인스턴스는 사진 애플리케이션에서 에셋(이미지, 비디오, 라이브 포토), 에셋 컬.. swift ] 다음 화면으로 데이터 전달하기 override func prepare(for segue: UIStoryboardSegue, sender: Any?) { guard let nextViewController: WeatherViewController = segue.destination as? WeatherViewController else { return } guard let cell: UITableViewCell = sender as? UITableViewCell else { return } nextViewController.country = cell.textLabel?.text } developer.apple.com/documentation/uikit/uiviewcontroller/1621490-prepare Apple Develope.. swift 네비게이션바 배경색상 제목색상 변경 navigationController self.navigationController?.navigationBar.barTintColor = .systemBlue // 배경색상 self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] // 타이틀 색상 테이블 뷰 셀 엑세서리 추가하기 let cell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: self.cellIdentifier, for: indexPath) cell.accessoryType = .disclosureIndicator // ">" swift] UITextFieldDelegate with Swift stackoverflow.com/questions/24171857/implementing-uitextfielddelegate-with-swift Implementing UITextFieldDelegate with Swift I have my ViewController class which implements UITextFieldDelegate. I have no auto complete for the funcs such as textFieldShouldBeginEditing. Is this a bug in XCode 6? Here's my class implemen... stackoverflow.com UITextFieldDelegate .. func textFieldDidBeginEditing(_tex.. swift] 싱글톤패턴 적용하는법 해보기 import Foundation class UserInformation { static let sharedData: UserInformation = UserInformation() var phoneNumber: String? //전화번호 var dateValue: String? //달력 값 var userId: String? // ID 값 } UserInformation.swift - > 싱글톤 @IBAction func touchBeforeButton(_ sender: Any) { UserInformation.sharedData.dateValue = self.dateLabel.text UserInformation.sharedData.phoneNumber = self.phoneNumber.text } U.. swift] button 비활성화 하는 법 UIButton @IBOutlet var nextButton: UIButton! nextButton.isEnabled = false //비활성화 nextButton.isEnabled = true // 활성화 swift] 텍스트필드, 이미지뷰, 레이블 값 채워져있는지 확인하기 isEmpty if contentTextFiield.text?.isEmpty ?? true || idTextField.text?.isEmpty ?? true || passWord.text?.isEmpty ?? true || checkPassWord.text?.isEmpty ?? true || self.imageView.image == nil || passWord.text! != checkPassWord.text! { nextButton.isEnabled = false } else{ nextButton.isEnabled = true } UILabel - > dateLabel.text! == "" UITextField -> if phoneNumber.text?.isEmpty ?? true ||.... UIImageView.. swift] 키보드 내리는 방법- UITapGestureRecognizer Target-Action 디자인 패턴 UITapGestureRecognizer와 Target-Action을 활용한다. @IBAction func tapView (_ sender: UITapGestureRecognizer){ //키보드 내리기 self.view.endEditing(true) } override func viewDidLoad() { super.viewDidLoad() //키보드 내리기 let tapGesture: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapView(_:))) self.view.addGestureRecognizer(tapGesture) } 이전 1 ··· 15 16 17 18 19 20 21 다음