300x250 iOS112 지도앱 URL Scheme 카카오맵 : https://apis.map.kakao.com/ios/guide/#urlscheme_open_mapapp 카카오앱에 원하는 주소로 바로 이동하여 실행 시키고 싶다면, '좌표로 이동' 부분의 URL Scheme을 이용하면 된다. kakaomap://look?p=좌표LAT,좌표LNG 카카오네비 : https://developers.kakao.com/docs/latest/ko/kakaonavi/ios 카카오네비는 다른앱과 달리 URL Scheme으로 열리지 않아서 API연결하여 사용해야 한다. -> 참고: https://devtalk.kakao.com/t/ios-kakao-navi-url-scheme/109747/2 네이버지도 : https://guide.ncloud-docs.com/docs/n.. 2022. 10. 5. UICollectionView 페이징 컬렉션뷰를 이용해서 컨텐츠를 보여줄 때 컬렉션뷰를 스크롤 할 때 하나씩(원하는 만큼) 넘어가도록 만들고 싶을 때 , scrollViewWillEndDragging 함수를 이용하여 처리 할 수 있다. @interface ViewController () { NSInteger currentItemIndex; } @end - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { //좌우 목록 콜랙션 뷰일 때만 if (scrollView == self.컬렉션뷰) { UICollectionViewFlowL.. 2022. 9. 30. UIButton 버튼의 테두리 설정 buttonName.layer.borderWidth = 1; buttonName.layer.borderColor = [UIColor colorWithRed:(0/255.0f) green:(176/255.0f) blue:(190/255.0f) alpha:1].CGColor; 버튼 타이틀 정렬 버튼명.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; 버튼 이미지 컬러 버튼의 이미지도 내 맘대로 색상을 지정할 수 있다. 버튼 스타일을 custom으로 지정후 tintColor를 수정해주면 되는데, 만약, 변경이 안된다면 Asset -> 해당 이미지의 attribute inspector -> Render As를 'T.. 2022. 9. 28. String 특정 문자 제거 양끝 문자 제거 중간에 있는 문자는 제거 불가능 var helloStr = "Hello!" var iosStr = "#iOS" var swiftStr = "#Swift!" helloStr.trimmingCharacters(in: ["!"])//Hello iosStr.trimmingCharacters(in: ["#"])//iOS swiftStr.trimmingCharacters(in: ["#","!"])//Swift 중간에 있는 문자 제거 var str = "Hello~!@@@, Swift Zedd" str.components(separatedBy: ["~","!","@",",","Swift"])//error!! var str = "Hello~!@@@, Zedd" str.components.. 2022. 9. 22. 햅틱 & 진동 앱을 사용하다 보면 손으로 느껴지는 진동이 있다. 진동과 햅틱에 차이가 있다면 진동은 세기의 정도를 세세히 설정이 불가하지만, 햅틱을 이용하면 띡! 하는 정도를 다양하게 설정이 가능하다 직접 손으로 느껴보는 게 정확하니 실습! 참고: https://babbab2.tistory.com/36 iOS) 진동 울리기 안녕하세요 소들입니다 :) 오늘은 iOS에서 진동 울리기!!! 뭐 .. 특정 버튼을 누른다거나, Foreground에서 알람이 온 경우 뭐 그런 경우에 사용할 수 있겠져!? 1. AudioToolbox Framework 추가해주기 자 진동을 babbab2.tistory.com 1. 프로젝트 - TARGETS - General - Frameworks, Libraries, and Embed.. 2022. 9. 6. 진법 변환 Radix https://developer.apple.com/documentation/swift/int/init(_:radix:) 문자열이나 기수에서 integer 값을 만들어 준다. 10진수 -> 2진수 let num = 78 print(String(num, radix: 2)) // 1001110 2진수 -> 10진수 let num = "1001110" print(Int(num, radix: 2)!) // 78 nonzeroBitCount https://developer.apple.com/documentation/swift/fixedwidthinteger/nonzerobitcount 이진값에서 1의 개수를 알려준다. let num = 78 print(num.nonzeroBitCount) // 4 2022. 8. 31. Alamofire timeout set(Swift5) 참고: https://alamofire.github.io/Alamofire/Classes/SessionDelegate.html https://moonggi-dev-story.tistory.com/7 Alamofire 라이브러리에 timeout 을 달아보자 iOS 대표 라이브러리라 불리는 Alamofire 에 대해 timeout 셋팅을 하고싶었다.. 테스트 결과 기본적으로 1분정도 timeout이 셋팅 되어 있는거 같다. 현재 ARS 같은경우 1분을 훌쩍넘는 시간동안 인증을 한 moonggi-dev-story.tistory.com sessionManager 기본적으로 제공되는 alamofire의 sessionManager의 속성을 커스텀하고 싶을 때 configuration을 이용한다. 네크워크 통신 중 .. 2022. 8. 25. 화면 캡처 방지 안드로이드는 코드 몇 줄이면 스크린의 캡처를 허용할지 말지를 설정해줄 수 있는 반면, iOS는 캡처 방지 설정을 지원 해주지 않는다. 그래서 캡처 되는 순간 다른 화면으로 대체 하여 캡처 되도록 우회 하는 방식을 사용하거나 솔루션을 구입하여 방지 할 수 있다. (솔루션 사용 시 보통 한대당 100 ~ 300만원 정도 책정하는 듯.. 너무 비싸다...) 참고 사이트 1. https://github.com/joonHyoung/preventScreenCapture GitHub - joonHyoung/preventScreenCapture Contribute to joonHyoung/preventScreenCapture development by creating an account on GitHub. github.. 2022. 8. 19. stored property에 'available' 사용하기 스택오버플로우 발췌 - https://stackoverflow.com/questions/41904724/using-available-with-stored-properties Here is one potential solution (thanks to blog post). The idea is to use a stored property with a type of Any and then create a computed property that will cast the stored property (and instantiate it if necessary). private var _selectionFeedbackGenerator: Any? = nil @available(iOS 10.0, *) filepriva.. 2022. 8. 16. 이전 1 ··· 4 5 6 7 8 9 10 ··· 13 다음 300x250