objc 문법에서 block 은 비동기처리시 delegate 보다 좀더 간편하게 쓸 수 있는 방식이다. 어차피 찾아보면 이론설명은 널리고 널렸으니 예제만 설명한다. 선언부: typedef void (^ResultCallback)(NSString *result, NSError *error); ... @property (nonatomic, strong) ResultCallback resultCallback; ... - (void) requestFunc:(ResultCallback)completion; 만약 requestFunc 라는 함수내에서 콜백처리를 하지 않는다면 resultCallback 을 예제와 같이 property 로 선언해두고 다른 함수내에서 처리도 가능하다. 구현부: - (void) reque..
터미널 명령어 편집기 열기 $ sudo vi /etc/hosts설정 편집 1 ## 2 # Host Database 3 # 4 # localhost is used to configure the loopback interface 5 # when the system is booting. Do not change this entry. 6 ## 7 127.0.0.1 localhost 8 255.255.255.255 broadcasthost 9 ::1 localhost 10 fe80::1%lo0 localhostDNS cache 갱신 $ dscacheutil -flushcache
Firebase sdk 사용하지 않고 iOS에서 페이스북 로그인 구현하기 튜토리얼: @import FBSDKCoreKit; @import FBSDKLoginKit; - (void)facebookAuth:(UIViewController*)uiview { FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init]; [loginManager logInWithPermissions:@[ @"public_profile", @"email" ] fromViewController:uiview handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { if (error) { NSLog(@"%@", err..
Firebase sdk 사용하지 않고 iOS에서 구글로그인 구현하기 튜토리얼: Google Sign-In for iOS photo url 얻기 obj: if (user.profile.hasImage) { NSURL *url = [user.profile imageURLWithDimension:100]; NSLog(@"url : %@",url); }swift: if user.profile.hasImage { let pic = user.profile.imageURLWithDimension(100) Print(pic) } 출처 https://stackoverflow.com/questions/32871484/ios-google-sign-in-how-can-i-get-user-image-url
NSError 를 사용하여 에러정의하기 NSError *error = [[NSError alloc] initWithDomain:@"com.universal.sdk" code:200 userInfo:@{NSLocalizedDescriptionKey:@"no parameter"}]; NSLog(@"%@",[error localizedDescription]); NSLog(@"%ld",[error code]);output : no parameter output : 200 출처 https://eezytutorials.com/ios/nserror-by-example.php
Cocoapod 으로 소스 비공개(private)용으로 프레임워크 배포 Git repo 만들기 git 주소가 2개가 필요하다. git lib repo (라이브러리 프로젝트) git specs repo (public 에서 사용한 cocoapod repo 역할을 할 git spec파일 저장소) 우선 라이브러리 git repo 가 있다는 전제하에 설명한다. 물론 podspec 파일도 셋팅되어있어야 한다. .podspec 파일을 편집해주고 파일 유효성 검사. 이건 공개용과 동일하다. $ pod spec lint --verbose specfilename.podspec빈 레퍼지토리 https://github.com/james-chun-dev/specs.git 하나를 private 으로 만들었다. 그리고 pod re..
PodSpec 파일 생성 및 편집하기 spec 파일만 따로 만드는 방법이 있다. 사실 이 파일만 있다면 배포가 가능하다. $ pod spec create pod_name.podspec 이 로컬에 생성 될 것이다. Pod::Spec.new do |s| s.name = "git-public-pod-public" s.version = "0.1.5" s.summary = "The SDK for iOS Swift provides a modern way of implementing APIs." s.description = "#{s.version}" } s.source_files = 'SDK1/SDK1/SDK1.h' end더 많은 정보를 원한다면 cocoapods 공식사이트 문서 참고. name: po..
Cocoapod 설치 macOS 에는 Ruby 가 기본 내장되어 있다. 다음 명령어면 설치가 완료된다. $ sudo gem install cocoapodsCocoapod 명령어 pod init 새로운 pod 파일을 생성해준다. $ pod initpod install pod을 프로젝트에 세팅하기 위하여 맨 처음에 사용됩니다. 하지만 Podfile의 pod을 추가, 수정, 삭제할 때에도 사용됩니다. pod install 명령어를 실행하면 새로운 pod을 다운받고 설치합니다. 그리고 각 pod 마다 설치된 버전을 Podfile.lock 에 기록해 놓습니다. Podfile.lock은 설치된 pod들의 버전을 계속 추적하여 기록해놓고 유지시키는 역할을 합니다. pod install 을 실행하면, Podfile.l..
- Total
- Today
- Yesterday
- LanguageCode
- 절대값함수
- ioutil
- tempfile
- Golang
- iTunes Store에 연결할 수 없음
- nsurl to nsstring convert
- countryName
- tempdir
- NSUserDefaults 예제
- permissionCheck
- nsurl 에서 nsstring 변환
- Error Domain=SKErrorDomain Code=0
- convert nsurl to nsstring
- setCancelable vs setCanceledOnTouchOutside
- java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line
- countryCode
- abs
- 퍼미션체크
- Locale.getDefault().getLanguage()
- abs 함수
- dialog
- DeviceModel
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |