Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var textField: UITextField! var pickerView: UIPickerView = UIPickerView() let list = ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] override func viewDidLoad() { super.viewDidLoad() pickerView.delegate = self pickerView.dataSource = self pickerView.showsSelectionIndicator = t
èªåç¨ã®ã¡ã¢ã¨ãã¦ã TextFieldã®inputViewã«UIPickerViewãè¨å®ããã°ã§ããã å®è£ ä¾ èªåã¯UITextFieldã®ã«ã¹ã¿ã ã¯ã©ã¹ã«ãã¦å®è£ ãããããããã¨UIPickerViewã®delegateãéãè¾¼ããããã®ã§ãã£ãããã¦ããæãã minerva1129/PickerTextField import UIKit class PickerTextField: UITextField, UIPickerViewDelegate, UIPickerViewDataSource { var dataList = [String]() /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performa
ããã«ã¡ã¯ã主夫ã²ããã§ãã ä»åã¯Swiftã®UITableViewã«ã¤ãã¦ã ViewControllerã«UITableViewã®ã決ã¾ãUITableViewDelegate, UITableViewDataSourceã追å ããã¨ã Type âViewControllerâ does not conform to protocol âUITableViewDataSourceâ ã¨ãè¨ãããã import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the vi
ãã¤ãã¿ã¼ã®å ¬å¼ã¢ããªã使ã£ããã¨ããã人ã¯ãã¡ãã®èµ·åç»é¢ãè¦ããã¨ãããã¨æãã¾ãããã¤ãã¿ã¼ã¢ã¤ã³ã³ãç¾ãããã®ã¢ã¤ã³ã³ããã®ã¾ã¾æ¡å¤§ãã¦å§ã¾ãã¾ããLaunch Screenãã¢ãã¡ã¼ã·ã§ã³ããã®ã¯æµ·å¤è£½ã®ã¢ããªã«æã ã¿ãããææ³ã§ãã ããã¨åããããªãã¨ãå¼ç¤¾ã®ç¡æã®çµµæ¬ã¢ã㪠PIBO(ãã¼ã)ã§å®è£ ãã¦ã¿ã¾ããã ãã®ããæ¹ã®ãµã³ãã«ãç´¹ä»ãã¾ãã #ããæ¹ ææ³ã¯è³ã£ã¦ç°¡åã§ãã ã»â LaunchScreenãè¨ç½®ãã ã»â¡LaunchScreenã¨åãViewãèµ·åæã«è¡¨ç¤ºãã ã»â¢ãã®Viewãã¢ãã¡ã¼ã·ã§ã³ããã ã®ï¼å·¥ç¨ã§ãããã£ã¦ãããã¨ã¯çµæ§ç°¡åã§ãã ##â LaunchScreenãè¨ç½®ãã æ®éã«LaunchScreenãä½ãã°OKã§ãã ã»LaunchScreen.xibã«Image Viewã追å ãã¦logoç»åãè¨ç½®ãã¾ãã ã»logoã«å¯¾ãAdd
ã¯ããã« ããã«ã¡ã¯ï¼ã¢ãã¤ã«ã¢ããªãµã¼ãã¹é¨ã®å è¤æ½¤ã§ãã ä»åã¯Swift3ã§å¤§ããå¤ãã£ãGCDï¼Grand Central Dispatchï¼ã®APIã«ã¤ãã¦ããã®åºæ¬çãªä½¿ãæ¹ãè¦ã¦ããããã¨æãã¾ãã åºç¤ç¥èã®ãããã GCDã®å ·ä½çãªä½¿ãæ¹ã«å ¥ãåã«åºç¤ç¥èã®ããããããã¦ããã¾ãã åæã¨éåæ ã¾ãã¯åæã¨éåæã«ã¤ãã¦ã§ãã GCDã§ã¯ãã¥ã¼ï¼queueï¼ã¨ãããå¦çã®å ¥ãç©ãã«å¯¾ãã¦å¦çãç»é²ãããã¨ã§ãé©åãªã¹ã¬ããä¸ã§å¦çãè¡ãããã®ã§ããããã¥ã¼ã«ç»é²ããéã«ä»¥ä¸ã®å®è¡æ¹å¼ã®ãããããæå®ãããã¨ãã§ãã¾ãã åæ ãã¥ã¼ã«å¦çãç»é²ããã¹ã¬ãããç»é²ããå¦çãå®äºããã®ããå¾ ã¤ã GCDã®ã¡ã½ããã¯syncã éåæ ãã¥ã¼ã«å¦çãç»é²ããã¹ã¬ãããç»é²ããå¦çãå®äºããã®ããå¾ ããªãã GCDã®ã¡ã½ããã¯asyncã ä¸è¨ã®ããã«ãéãã¯å¦çãå®äºããã®ã
ãµã³ãã«ã³ã¼ã ç»åãããã¸ã§ã¯ãå ã«ç½®ãã¾ããã®ã§ããããåå¾ããã®ã§ããUIImageã使ã£ã¦ç»ååããã¤ã³ã¹ã¿ã³ã¹ãä½æãã¾ãã ãã®å¾UIImageViewã®ãªãã¸ã§ã¯ãã«ç»åãè¨å®ãããã¨ãããï¼æ®µéã§ã®è¨å®ã§ãã storyboardã使ããªãã®ã§ãã¹ã¯ãªã¼ã³ãµã¤ãºã¨ç»åãµã¤ãºãåå¾ããã®æ¯çã§è¡¨ç¤ºæ ã決ãã¦ä¸å¿ä½ç½®ã«è¨å®ããã¾ãã storyboardã§ã¯ãã®ä½æ¥ã¯ããã¾ããããéã«æè¿ç«¯æ«ç¨®é¡ãå¢ããã®ã§ããããã®ãµã¤ãºã§ãä¸å¤®ã«æ¥ããããªå¯¾çãããå¿ è¦ãããã¾ãã ViewController.swift import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() initImageView() } private func
Like everyone else in the Pacific Northwest, we got snowed-in over the weekend. To pass the time, we decided to break out our stash of board games: Carcassonne, Machi Koro, Power Grid, Pandemic; we had plenty of excellent choices available. But cooped up in our home for the afternoon, we decided on a classic: Cluedo. Me, Iâm an avid fan of Cluedo â and yes, thatâs what Iâm going to call it. Becaus
[2018/05/22 追è¨] Swift 4.2ããã¯ãRangeã®åãã©ã¡ã¼ã¿ã¼(Bound)ã«ãã£ã¦Countableãã©ãããåºå¥ã§ããããã«ãªããããCountableç³»ã®Rangeã¯ç¡ããªãã·ã³ãã«ã«ãªãã¾ãã Swift 4.1ã§å°å ¥ãããConditional Conformanceã®ã¤ã³ãã¯ã - Qiita Swift 3ã®Rangeå¨ãã¯ãã£ãããããããã®ã§ãã¾ã¨ãã¦ã¿ã¾ããã Rangeå¨ãã®ãããããã¯ãã®ãããã«èµ·å ãã¦ããã¨æã£ã¦ãã¾ãã Swift 3ã®Rangeã®ä»æ§èªä½å°ãè¤é ç¾ç¶ã®è¨èªå¶ç´ã»åå®å ¨æ§ãªã©è¸ã¾ãã¦å¦¥å½ãªè¤éæ§ã ã¨æã£ã¦ãã¾ãã Swift 2.2ãã大ããå¤æ´ Swift 2.2: Range<T>ã»ClosedInterval<T>ã»OpenInterval<T> Swift 3.0: Range<T>ã»ClosedRange<T>
ãã®ã¡ã½ããã使ã£ã¦ãoptions ã®ã¨ããã« .regularExpression ã使ãã°ãsearchString ã§æ£è¦è¡¨ç¾ãå©ç¨ããæååï¼ä¾ãã° "Qi+ta" ã¨ãï¼ã使ãã¾ãã便å©ã ã¨ããããã®ã¡ã½ããã«ã¤ãã¦å ¬å¼ã®è³æããªããä¸çªè¿ãè³æãªãä¸å¿ range(of:options:) 㨠range(of:options:range:)ãããã㯠localizedStandardRange(of:) ã®è³æãªãããã¾ãããã©ããæ»ãå¤ã NSRange ã¨ãªã£ã¦ãã¾ãã ãããå®éãã®ã¡ã½ããæ¸ãã¦ã¿ãã¨åããã¾ãããæ»ãå¤ã¯ Range<String.Index> ã¨ãSwift Foundation ã§å®ç¾©ãããåã¨ãªã£ã¦ããã¾ããString ãå®éæå管çã«ä½¿ã£ã¦ããã¤ã³ããã¯ã¹ãªã®ã§ NSString ã¨ã NSRange ãä»å¨ããæåãæ±ãã©ã¤ãã©ãªã®
potproject.net Advent Calendar 2016 8æ¥ç®ã®è¨äºã§ãã Swift3.0ã§ããæ¬å½Swift2.xæ代ãå¼·ããã¦æ¤ç´¢ã«å ¨ãå¼ã£ããã£ã¦ããªãã®ãè¾ãã ããçµæ§åã«ãªã£ã¦ãã¾ãã¾ãããiOS10ãå ¬éãããiPhone7ãçºå£²ããã¾ããã ããããç¸å¤ãããèªåçã«ã¯iOS10ãiPhone7ãèå³ããã¾ããã ã§ããæ®å¿µãªããiOSéçºããã¦ããã¨iOS10ã«ã対å¿ããªãããªããªããªãã å°è¦æ¨¡ãªã¢ããªãä½ã£ã¦ããã®ã§ãswift2.3ããswift3.0ã«æ¸ãç´ããã¨ã«ã ããããswift3.0ã¯ãã2.xã®äºææ§ãããªããæ¨ã¦ã¦ãã¦ãå ¬å¼ã§ã³ã³ãã¼ã¿ãç¨æããããããã«ãã£ã¡ãå¤æ´ããã¦ã¾ãã ã¾ã大ä½ã¯ã³ã³ãã¼ãã§å¯¾å¦ã§ããã®ã§ãããhttpéä¿¡ã®ã³ã¼ãã®é¨åã§ã¨ã©ã¼ãåºã¦ãã¾ããã 調ã¹ãã¨ãã£ã±ãããã¯ãã¾ãèªåå¤æãã§ããªã模æ§ã Swi
iOS8.0ããWKWebViewã追å ãããç¾å¨ããã»ãã¥ã¢ã§å®å®ããWKWebViewã®ä½¿ç¨ãAppleã¯æ¨å¥¨ãã¦ãã¾ããWKWebViewã¯StoryBoardä¸ã§ã¾ã æ±ããªãã®ã§ã³ã¼ããæ¸ãã¦ããå¿ è¦ãããã¾ãã WKNavigationDelegateã¯webViewãæ´»åä¸ã«è²ã ã¨ãããã便å©ãªãããã³ã«ãªã®ã§ä¸åº¦ãªãªã¼ã¹ãã¼ããèªãã§ããã¨ããã§ãããã WebKit | Apple Developer Documentation ä»åã¯webãã¼ã¸ã®titleãç²å¾ããããã«ãã¼ã¸ã®ãã¼ãå¾ã«å¼ã³åºããã func webView(WKWebView, didFinish: WKNavigation!) ã使ç¨ãã¾ãããã¾ãhttpsã¨httpã®ã©ã¡ãã«ã対å¿ããå ´å Info.plist -> App Transport Security Settings -> Allo
iOS8ãããWKWebViewã¨ããWebKitããã¼ã¹ã¨ããWebãã¥ã¼ã使ããã¨ãã§ããããã«ãªãã¾ãããããã§ã¯Swiftã§WKWebViewã¨æ°ãã«å¢ããç£è¦å¯è½(KVO compliant)ãªããããã£ã使ã£ã¦ã¿ã¾ãã WKWebViewã®ç¨æ WKWebViewã¯ç¾æç¹ã§ã¯ã³ã¼ãã使ã£ã¦å®è£ ãã¾ããUIWebViewã¨ã¯ç°ãªãXcodeã®Interface Builderããé ç½®ãããã¨ã¯ä»ã®æã§ãã¾ããã var webView:WKWebView? override func loadView() { self.webView = WKWebView() self.view = self.webView! } override func viewDidLoad() { super.viewDidLoad() let requestURL = NSURL(string: "
å ¥åããå 容ãä¿æããã¨ãããã¨ãããããã ãµã¼ãå´ããã°ã©ã ("http://example.co.jp/test")é©å½ã«å®è£ xamppã§ãHerokuã§ãä½ã§ã <html> <head> <title>Hello WKWebView</title> </head> <body> <h1>Hello WKWebView</h1> <form action="/hello" name="form1" method="POST"> <input type="text" name="name"> <input type="password" name="password" size="30" maxlength="30"> <input type="submit"> </form> </body> </html> iOSããã°ã©ã ä¸è¨ç»é¢ã¸ã¢ã¯ã»ã¹ããããã«WKWebViewã§iOS
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}