일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- afterdelay
- simulator
- error
- 포켓볼
- 신도림
- loop
- 샘플
- 페이백
- IOS
- 앱스토어
- 포켓몬 GO
- Check
- 보라카이
- UIView
- 신도림 테크노마트
- 스마트폰
- 해몽
- 공략
- 아이폰7
- setting
- GCD
- LG유플러스
- push
- 얻는법
- Xcode
- Bitcode
- swift
- UITableView
- swift3
- Example
- Today
- Total
목록swift (28)
도래울
extension UIViewController { func showToast(message : String) { let toastLabel = UILabel(frame: CGRect(x: self.view.frame.size.width/2 - 75, y: self.view.frame.size.height-100, width: 150, height: 35)) toastLabel.backgroundColor = UIColor.black.withAlphaComponent(0.6) toastLabel.textColor = UIColor.white toastLabel.textAlignment = .center; toastLabel.font = UIFont(name: "Montserrat-Light", size:..
let imageCache = NSCache() extension UIImageView { func loadImageUsingCache(withUrl urlString : String) { let url = URL(string: urlString) self.image = nil // check cached image if let cachedImage = imageCache.object(forKey: urlString as NSString) as? UIImage { self.image = cachedImage return } // if not, download image from url URLSession.shared.dataTask(with: url!, completionHandler: { (data, ..
// CGRectMake has been deprecated - and should be let, not var let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 21)) // you will probably want to set the font (remember to use Dynamic Type!) label.font = UIFont.preferredFont(forTextStyle: .footnote) // and set the text color too - remember good contrast label.textColor = .black // may not be necessary (e.g., if the width & heigh..
Swift 3let dispatchTime = DispatchTime.now() + .seconds(0.1) DispatchQueue.main.asyncAfter(deadline: dispatchTime) { // your function here }Swift 2let dispatchTime: dispatch_time_t = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC))) dispatch_after(dispatchTime, dispatch_get_main_queue(), { // your function here })
let range : Range? = urlStr.rangeOfString("itunes.apple.com") if range != nil { }
var fullName: String = "First Last" let fullNameArr = fullName.componentsSeparatedByString(" ") var firstName: String = fullNameArr[0] var lastName: String = fullNameArr[1]
import CryptoSwift let encryptKey = "ket" let iv = "iv" let ret = try! "password".aesEncrypt(encryptKey, iv: iv)print("암호화 결과 : \(ret)")let decrypt = try! ret.aesDecrypt(encryptKey, iv: iv) print("복호화 결과 : \(decrypt)") extension String { func aesEncrypt(key: String, iv: String) throws -> String{ let data = self.dataUsingEncoding(NSUTF8StringEncoding) let enc = try AES(key: key, iv: iv, blockMode..
Send(Post) Notification NSNotificationCenter.defaultCenter().postNotificationName("NotificationIdentifier", object: nil)Receive(Get) Notification NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(YourClassName.methodOfReceivedNotification(_:)), name:"NotificationIdentifier", object: nil)Method handler for received Notificationfunc methodOfReceivedNotification(notificatio..
extension NSMutableAttributedString { static public func multicolorTextAttribute(fullText : String, colorText : String, fontColor : UIColor, label : UILabel) -> NSMutableAttributedString { var mutableString = NSMutableAttributedString() let range = fullText.rangeOfString(colorText) let index: Int = fullText.startIndex.distanceTo(range!.startIndex) mutableString = NSMutableAttributedString(string..
func webView(webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: () -> Void) { let alertController = UIAlertController(title: message, message: nil, preferredStyle: UIAlertControllerStyle.Alert); alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Cancel) { _ in completionHandler()} ); self.pre..