@IBAction func didTapShareButton(_ sender: Any) { // todo: UIActivityViewController 이용해서 공유하는 기능 만들기. let text = "내가 공유할 텍스트⭐️" let textToShare = [text] let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil) activityViewController.popoverPresentationController?.sourceView = self.view self.present(activityViewController, animated: true, compl..
링크가 주어질 때, 사진을 받아오는건 꽤 까다로운 일이다. 이때 쓰는 라이브러리가 KingFisher이다!! 한줄로 이미지를 받아오게 하는 자네..최고... cell.storeImageView.kf.setImage(with: url, placeholder: UIImage(named: "imageMap")) 이런식으로 한줄만에 해줄 수 있다고 한다 원래는 이렇게 했었음 ㅠㅠ func getImageFromWeb(_ urlString: String, closure: @escaping (UIImage?) -> ()) { guard let url = URL(string: urlString) else { return closure(nil) } let task = URLSession(configuration: .d..
스토리보드에서 커스텀뷰를 형태 그대로 보고 싶을 때, @IBDesignable, @IBInsepctable 어노테이션을 사용하면 된다!! 1. @IBDesignable @IBDesignable public class MyButton: UIButton { 이런식으로 쓰면 된당 2. @IBInspectable @IBInspectable을 값 앞에 붙이면, storyboard에 출력해서 할당할 수 있게 된다! https://gogorchg.tistory.com/entry/iOS-IBDesignable-IBInspectable-활용
그저 충격... 벌써 1년 다 되게 iOS 공부하는데 아직도 모르는게 너무 많다ㅠㅠ http://minsone.github.io/mac/ios/preview-storyboard-or-xib-in-xcode [Xcode]Storyboard 또는 Xib 미리보기 어제 Adaptive Layout을 보면서 3.5-inch, 4-inch, 4.7-inch, 5.5-inch를 대응하는 부분을 설명해주는데 Xcode에서 각각의 단말마다의 크기에 따른 화면을 preview로 보여주는 것을 보고 이런 것이 있었구나라고 알았습니다. 딱히 현업분들은 놀랄 것은 아니긴 하지만 저에겐 공백기 동안에 못해봤던 것을 이제 해보고 있으니까요. Preview Xcode에서 Storyboard나 Xib 화면에서 각기 다른 화면 크기에..
1. someTextField.resignFirstResponder() resignFirstResponder() is good to use any time you know exactly which text field is the first responder and you want to resign its first responder status. This can be slightly more efficient then the alternative, but if you're doing something such as creating a custom control, this can make plenty of sense. Perhaps you have a text field, and when the "Next..