iOS10부터 이미지 푸시를 보낼 수 있다.iOS10에서는 앱 실행 중에도 앱내에서 처리 없이 상단 푸시를 볼 수 있다. (단, RemoteNotification 등록시 UNUserNotificationCenter를 사용하였을 경우) 우선 AppDelegate에서 푸시를 등록 해보자.let center = UNUserNotificationCenter.current()center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in print("granted = \(granted)")}center.delegate = self application.registerForRemoteNotifications() UNUserNot..
UITextFiled나 UITextView에서 입력 글자 제한을 해야되는 경우가 있다. UITextFieldDelegate의 shouldChangeCharactersIn 메서드를 이용해서 아래와 같이 사용하는게 보통의 경우이다.기존 textField의 텍스트와 새로 입력 받은 string을 합쳐서 길이를 제한하는 코드이다. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { guard let text = textField.text as NSString? else {return false} let newString = text.repl..
개발하다 보면 뷰컨트롤러가 아닌 AppDelegate나 NSObject 클래스에서 UIAlertController를 띄우고 싶을때가 종종 있다. UIAlertController를 사용할려면 뷰컨트롤러에서 present를 해야하고 최상위가 아닌 뷰컨트롤러에서 시도할 경우 아래와 같이 계층 에러가 발생한다.(참고: viewDidLoad에서 바로 다른 뷰컨트롤러를 present를 하게 될 경우도 발생한다. 화면이 다 보여지지 않은 상태에서 다른 뷰컨트롤러를 보여준다는게 말이 안되기 때문이다.) Warning: Attempt to present on whose view is not in the window hierarchy! 그래서 아래와 같이 최상위 뷰컨트롤러를 구하는 클래스 함수를 만들어서 사용하고 있다. ..
- Total
- Today
- Yesterday
- ios
- Easy APNs Provider
- UITextFiled
- appDelegate
- mutable-content
- wkwebview
- apns
- UITextFieldTextDidChange
- presentedViewController
- setAlternateIconName
- 인증 키
- 이미지 푸시
- swift3
- UIApplication
- UNUserNotificationCenter
- NotificationCenter
- WebSiteDataStore
- Create a New Key
- UITextFieldDelegate
- iOS Keys
- UNUserNotificationCenterDelegate
- AppIcon
- shouldChangeCharactersIn
- Notification Service Extension
- httpCookieStore
- whose view is not in the window hierarchy
- swift
- 리치 푸시
- iOS10
- 앱 아이콘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |