본문 바로가기
728x90

iOS106

isEqual vs. == NSArray, NSDictionary, NSString과 같은 컨테이너 클래스들은 동일성을 비교할 때 조금 다르다. NSString * str1 = @"안녕"; NSString * str2 = @"안녕"; if (str1 == str2) { // retrun YES } if (str1 isEqual:str2) { // retrun YES } 같은 "안녕"을 참조하고 있기 때문에 모두 return YES이다. (== 와 isEqual이 같은 결과를 리턴하는 이유 : https://ggool.tistory.com/72) 그러나 NSString * str1 = @"안녕"; NSString * str2 = [NSString stringWithFormat:@"%@",@"안녕"]; if (str1 == str2).. 2021. 11. 11.
Text 설정 UILabel * noSearchResultLB = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; [noSearchResultLB setText:@"안녕하세요."]; [noSearchResultLB setFont:[UIFont fontWithName:@"NotoSansOriya" size:20]]; [noSearchResultLB setTextColor:[UIColor colorWithRed:(176/255.0f) green:(190/255.0f) blue:(197/255.0f) alpha:1]]; 2021. 11. 5.
UIPickerView - 항목 설정 pickerview 항목 2개 이상 만들기 let a = ["1","2","3","4","5"] let b = ["일","이","삼","사","오"] func numberOfComponents(in pickerView: UIPickerView) -> Int { return 2 // 행 개수 } func pickerView(\_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { // 열 번호에 따른 열 개수 설정 if component \== 0 { return a.count } return b.count } // 각 항목에 표시될 내용 설정 func pickerView(_ pickerView: UIPickerView, t.. 2021. 10. 29.
네트워크 통신 - inof.plist 설정 info.plist에 'App Transport Security Settings' 추가 키벨류로 'Allow Arbitrary Loads' yes 추가 2021. 10. 26.
스토리보드 없이 코드로 뷰 구현하기 1.스토리보드 파일을 삭제 2.SceneDelegate파일에서 scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) 함수에 윈도우 설정을 위한 코드를 작성 // 뷰를 스토리보드 없이 만들 때 준비 // 윈도우를 새롭게 초기화 하는 과정 guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: windowScene) window?.backgroundColor = .systemBackground window?.rootViewControlle.. 2021. 10. 26.
firebase로 APNs - FCM APNs? Apple Push Notification Service 원격 알림 사용 시 반드시 거쳐야 하는 서비스 사용자가 처음 앱을 실행하면 APNs간 통신이 가능한 암호화된 IP연결을 하게되고 이를 통해 알림을 수신하게 된다. 순서 : Provider(server) -> APNs -> Device -> notification 기기에서 APNs에 연결 APNs에서 기기 인증 후 토큰 발급 발급 받은 토큰을 기기에서 서버로 전달 서버에서 APNs에 토큰과 알림 데이터 보냄 토큰 확인 후 기기로 알림 전송 파이어베이스 이용 방법 프로젝트 생성 우측 상단의 '콘솔로 이동' 클릭 '+ 프로젝트 추가' 프로젝트 이름 입력 후 계속 '이 프로젝트에서 Google 애널리틱스 사용.. 2021. 10. 22.
firebase로 애플 로그인 1. firebase 콘솔로 이동하여 사용할 프로젝트를 선택한다. 2. 메뉴 'Authentication' 선택 3. Sign-in method의 새 제공업체 추가 4. 애플 사용 설정 후 저장 5. 프로젝트 signing&capabilites에서 '+capability' 6. sign in with apple 추가 7. team이 애플개발자 프로그램이 가입되어 있는 계정으로 설정 후 provisioning과 certificate 확인 8. 애플 디벨로퍼 사이트 로그인 9. Identifies 추가 10. 애플 로그인 서비스를 이용할거기 때문에 'Services IDs' 선택후 계속 11. Description = 본인이 알아볼 수 있는 설명 ex.프로젝트명+사용하려는 서비스 Identifier = 본인.. 2021. 10. 12.