분류 전체보기
-
1. UIResponder 추가 // 현재 응답받는 UI를 알아내기 위해 사용 (textfield, textview 등) extension UIResponder { private struct Static { static weak var responder: UIResponder? } static var currentResponder: UIResponder? { Static.responder = nil UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil) return Static.responder } @objc private func _trap() { Static.responder = self } ..
[iOS] 키보드 처리1. UIResponder 추가 // 현재 응답받는 UI를 알아내기 위해 사용 (textfield, textview 등) extension UIResponder { private struct Static { static weak var responder: UIResponder? } static var currentResponder: UIResponder? { Static.responder = nil UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil) return Static.responder } @objc private func _trap() { Static.responder = self } ..
2023.12.30 -
두 개의 Storyboard 생성합니다. SceneDelegate.swift에서 코드 추가 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } var initialViewController = UIViewController() var storyboard = UIStoryboard() if UIDevice.current.userInterfaceIdiom == .pad{ storyboard = UIStoryboard(name..
[iOS] 기종별로(iPhone, iPad) StoryBoard 구분하기두 개의 Storyboard 생성합니다. SceneDelegate.swift에서 코드 추가 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } var initialViewController = UIViewController() var storyboard = UIStoryboard() if UIDevice.current.userInterfaceIdiom == .pad{ storyboard = UIStoryboard(name..
2023.12.30 -
번역기에서 앱을 사용할 때 글자를 읽어주는 기능을 구현하였다. 다행하게도 Swift에서 구현을 할 수 있었다. AVSpeechSynthesizer | Apple Developer Documentation An object that produces synthesized speech from text utterances and enables monitoring or controlling of ongoing speech. developer.apple.com AVSpeechSynthesizer 공식 문서를 참고하면 텍스트를 읽게 하려면 AVSpeechUtterance 인스턴스를 생성하고 speaking(_:) 함수에 전달하면 된다고 되어 있다. 문서와 다른 블로그 포스팅 참고하여 작성한 코드이다. let syn..
TripMate (3) - AVSpeechSynthesizer번역기에서 앱을 사용할 때 글자를 읽어주는 기능을 구현하였다. 다행하게도 Swift에서 구현을 할 수 있었다. AVSpeechSynthesizer | Apple Developer Documentation An object that produces synthesized speech from text utterances and enables monitoring or controlling of ongoing speech. developer.apple.com AVSpeechSynthesizer 공식 문서를 참고하면 텍스트를 읽게 하려면 AVSpeechUtterance 인스턴스를 생성하고 speaking(_:) 함수에 전달하면 된다고 되어 있다. 문서와 다른 블로그 포스팅 참고하여 작성한 코드이다. let syn..
2023.12.10 -
이전 포스팅 TripMate (1) - openweatherAPI와 CLLocationManager 사용하기 새로 시작하는 프로젝트에서 날씨를 가져오는 API를 사용하게 되었다. 예전 패스트캠퍼스 강의에서 날씨 앱을 만들 때 사용했던 openweather API를 사용했다. Сurrent weather and forecast - OpenWeatherMap Access kimkhuna99.tistory.com 이전에 사용하던 GoogleMap API를 사용하려다가 주변 지역을 검색해 주는 PlacesAPI가 더욱 앱의 취지에 맞는 것 같아 바꿨다. 주변 지역 검색 | Places API | Google for Developers 이제 Places API (신규)가 출시되면서 차세대 Places API를 사..
TripMate (2) - 주변 지역 검색 API이전 포스팅 TripMate (1) - openweatherAPI와 CLLocationManager 사용하기 새로 시작하는 프로젝트에서 날씨를 가져오는 API를 사용하게 되었다. 예전 패스트캠퍼스 강의에서 날씨 앱을 만들 때 사용했던 openweather API를 사용했다. Сurrent weather and forecast - OpenWeatherMap Access kimkhuna99.tistory.com 이전에 사용하던 GoogleMap API를 사용하려다가 주변 지역을 검색해 주는 PlacesAPI가 더욱 앱의 취지에 맞는 것 같아 바꿨다. 주변 지역 검색 | Places API | Google for Developers 이제 Places API (신규)가 출시되면서 차세대 Places API를 사..
2023.12.06 -
사내 macOS앱을 개발을 진행할 때 뷰를 제어할 때 NSStoryboardSegue를 사용하는데 종류에 대하여 정리하였다. Show - 목적지 뷰 컨트롤러를 표시하는 데 사용 - 화면이 전환될 때 애니메이션 효과를 제공하며, 일반적으로 스택 뷰 컨트롤러에서 사용 Modal - 목적지 뷰 컨트롤러를 모달로 표시하는 데 사용 - Modal로 표시되는 뷰 컨트롤러는 현재 뷰 컨트롤러 위에 나타나며, 사용자는 모달이 닫힐 때까지 이전 화면에 접근할 수 없음 Sheet - 목적지 뷰 컨트롤러를 시트로 표시하는 데 사용 - 모달과 유사하지만, 시트는 부모 창에 연결된 형태로 나타남 Popover - 목적지 뷰 컨트롤러를 팝오버로 표시하는 데 사용 - 주로 iPad에서 사용되며, 특정 컨트롤 또는 뷰에서 작은 팝업..
[macOS] NSStoryBoardSegue사내 macOS앱을 개발을 진행할 때 뷰를 제어할 때 NSStoryboardSegue를 사용하는데 종류에 대하여 정리하였다. Show - 목적지 뷰 컨트롤러를 표시하는 데 사용 - 화면이 전환될 때 애니메이션 효과를 제공하며, 일반적으로 스택 뷰 컨트롤러에서 사용 Modal - 목적지 뷰 컨트롤러를 모달로 표시하는 데 사용 - Modal로 표시되는 뷰 컨트롤러는 현재 뷰 컨트롤러 위에 나타나며, 사용자는 모달이 닫힐 때까지 이전 화면에 접근할 수 없음 Sheet - 목적지 뷰 컨트롤러를 시트로 표시하는 데 사용 - 모달과 유사하지만, 시트는 부모 창에 연결된 형태로 나타남 Popover - 목적지 뷰 컨트롤러를 팝오버로 표시하는 데 사용 - 주로 iPad에서 사용되며, 특정 컨트롤 또는 뷰에서 작은 팝업..
2023.12.04 -
func solution(_ num:Int, _ total:Int) -> [Int] { var answer = [Int]() var mid = total/num var n = num/2 if num%2 == 0{ answer = Array(mid-n+1...mid+n) } else{ answer = Array(mid-n...mid+n) } return answer } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 참고 [프로그래머스 LV.0] 연속된 수의 합 프로그래머스 LV.0 모음 연속된 수의 합 문제 설명 연속된 세 개의 정수를 더해 12가 되는 경..
[Programmers] 연속된 수의 합func solution(_ num:Int, _ total:Int) -> [Int] { var answer = [Int]() var mid = total/num var n = num/2 if num%2 == 0{ answer = Array(mid-n+1...mid+n) } else{ answer = Array(mid-n...mid+n) } return answer } 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 참고 [프로그래머스 LV.0] 연속된 수의 합 프로그래머스 LV.0 모음 연속된 수의 합 문제 설명 연속된 세 개의 정수를 더해 12가 되는 경..
2023.11.30