일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- swift3
- 샘플
- 공략
- 해몽
- afterdelay
- LG유플러스
- loop
- error
- swift
- 아이폰7
- 보라카이
- IOS
- 페이백
- Check
- push
- 신도림
- setting
- UIView
- simulator
- 포켓볼
- Xcode
- 앱스토어
- GCD
- Bitcode
- UITableView
- 얻는법
- Example
- 신도림 테크노마트
- 스마트폰
- 포켓몬 GO
- Today
- Total
목록swift (28)
도래울
1. 배열Swift에서 배열을 정의 하는 방법은 세 가지로 나눌수 있겠군요.?123var implicitArray = ["Eggs", "Milk"]var explicitArray_1: [String] = ["Eggs", "Milk"]var explicitArray_2: Array = ["Eggs", "Milk"]간단한 변수 선언에서 했던 것처럼 형태가 정의되지 않은 변수를 선언한 뒤에 배열 형태의 값을 초기에 할당하여 이 변수가 배열임을 암묵적으로 선언하는 방법이 첫번째네요.두번째는 이 변수가 [String]타입의 변수임을 선언하는 방법이 있네요. 대괄호는 배열임을, 그 안에 배열이 어떠한 타입의 값이 들어가는지를 표시하네요. 낯설지만 어떻게 생각하면 직관적이기도 한 방법이네요. 세번째로는 배열임을 Ar..
자신이 원하는 날짜로 NSDate를 생성하거나, 반대로 NSDate 객체를 자신이 원하는 문자열 포맷으로 가져오는 방법을 알아보겠다.NSDate에 대한 날짜포맷을 담당하는 클래스는 NSDateFormatter라는 클래스이다. 환경은 Swift 2.0에 Xcode 7.1 버전을 사용하였다. 기본적인 클래스의 세팅은 아래와 같이 한다. let format = NSDateFormatter()format.locale = NSLocale(localeIdentifier: "ko_kr")format.timeZone = NSTimeZone(name: "KST")format.dateFormat = "yyyy-MM-dd HH:mm:ss" locale로 한국을 선택하였고, timeZone을 한국시각으로 설정하였다그 후 da..
self.tableView.beginUpdates() self.tableView.deleteRowsAtIndexPaths([indexPath!], withRowAnimation: UITableViewRowAnimation.Right) self.tableView.endUpdates() 함수를 사용하여 증권 시세의 데이터를 삽입 시키는 작업을 하는데 문제가 생겼다. *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1145.66/UITableView.m:8272010-07-17 22:06:13.601 iPadUIBase[21630:207] *** Terminating app du..
Yes. As of Swift 2.0, if you need the index for each element along with its value, you can use the enumerate() method to iterate over the array. It returns a tuple composed of the index and the value for each item in the array. For example:for (index, element) in list.enumerate() { print("Item \(index): \(element)") }Prior to Swift 2.0, enumerate was a global function.for (index, element) in enu..
GSImageViewerControllerDemoExampleTo show normal image viewer controller:let imageInfo = GSImageInfo(image: someImage, imageMode: .AspectFit) let imageViewer = GSImageViewerController(imageInfo: imageInfo) navigationController?.pushViewController(imageViewer, animated: true)To show zoom transition image viewer controller:let imageInfo = GSImageInfo(image: someImage, imageMode: .AspectFill, image..
let logo = UIImage(named: "logo.png") let imageView = UIImageView(image:logo) self.navigationItem.titleView = imageView
Open the Assistant Editor and make sure the ViewController.swift file is visible. Ctrl + drag from the Button to the ViewController class and create the following Action implement the showActionSheet method@IBAction func showActionSheet(sender: AnyObject) { // 1 let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .ActionSheet) // 2 let deleteAction = UIAlertA..
In Swift there are no separate header and implementation files, the whole View Controller class is defined in the ViewController.swift file. Go to this file and right after the class ViewController: UIViewController { line add a constant containing some data for the table rows.let tableData = ["One","Two",Three"]Swift has inferred the constant as an Array of Strings. Next, set the number of rows..