본문 바로가기
반응형

#모바일 [Mobile]/iOS41

[iOS] UserDefaults How to save user settings using UserDefaults – Swift 5 An interface to the user’s defaults database, where you store key-value pairs persistently across launches of your app. integer (forKey:) bool (forKey:) float (forKey:) double (forKey:) object (forKey:) 📄 UserDefaultes Swift Source Code let defaults = UserDefaults.standard // SAVE defaults.set(25, forKey: "Age") defaults.set(true, forKey: "U.. 2019. 8. 1.
[iOS] UIScrollView 스크롤 시 키보드 내리기 (Dismissing the keyboard in a UIScrollView) 📄 Dismissing the keyboard in a UIScrollView Swift Source Code scrollView.keyboardDismissMode = .interactive OR scrollView.keyboardDismissMode = .onDrag OR scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; OR scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag; 📄 Dismissing the keyboard in a UIScrollView Delegate Swift Source Code func scrollViewWillB.. 2019. 8. 1.
[iOS] NSMutableAttributedString를 통한 UILabel에 Image 삽입하기 (How to insert images into an attributed string with NSTextAttachment) 📄 Swift Source Code import UIKit // MARK: - Extension NSAttributedString Image Protocol extension NSMutableAttributedString { func appendImage(_ image: UIImage) { // MARK: Create our NSTextAttachment. let imageAttchment: NSTextAttchment = NSTextAttchment() imageAttchment.image = image // MARK: Wrap the attachment in its own attributed string so we can append it. let strImage: NSAttributedString .. 2019. 7. 3.
[iOS] GestureRecognizer이 반응하지 않을 경우 (GestureRecognizer not responding to tap) 📄 Swift Source Code [target view].userInteractionEnabled = true 🚀 REFERENCE GestureRecognizer not responding to tap After initialisation of by subclass of UIImageView I have the following line of code: self.userInteractionEnabled = true self.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "han... stackoverflow.com 2019. 7. 3.
반응형