• controller 이름 바꾸는 방법은 

안에서 controller 이름을 클릭후 변경가능

  • (간단하게 canvas의 요소를 controller코드상에서 outlet으로 연결하는 방법)

You’re going to make an outlet for this text field on the PlayerDetailsViewController using the Assistant Editor feature of Xcode. While still in the storyboard, open the Assistant Editor with the button from the toolbar (the one at the top right with two intertwining rings). It should automatically open on PlayerDetailsViewController.swift (if it doesn’t, use the jumpbar in the right hand split window to select PlayerDetailsViewController.swift).

Select the new text field and ctrl-drag(오르쪽클릭은 outlet,왼쪽클릭은 action) to the top of PlayersDetailViewController, just below the class definition. When the popup appears, name the new outlet nameTextField, and click Connect. Xcode will add the property to the PlayersDetailViewController class and connect it in the storyboard:


  • static cells: they only work in UITableViewController. Even though Interface Builder will let you add them to a table view inside a regular UIViewController, this won’t work during runtime.

  • (특정 요소를 first responder 로 만드는 방법 )

To avoid this, let a tap anywhere inside the row bring up the keyboard. OpenPlayerDetailsViewController.swift and add the following extension to the end of the file:

// MARK: - UITableViewDelegate
extension PlayerDetailsViewController {

  override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    if indexPath.section == 0 {

If the user taps the first cell, the app should activate the text field. There’s only one cell in the section so you only need to test for the section index. Making the text field the first responder will automatically bring up the keyboard.


  • 예를 들어 segue에 있는 done button을 클릭해서 특정 데이터를 저장하고 modal형태의 창을 닫는 경우 두가지 이벤트를 이용할수 있다. 버튼에 연결되어있는 action과 segue가 닫히기 전에 이벤트를 전달 받는 hook 포인트 prepare 가 있다. 


Comments are closed.

Post Navigation