본문 바로가기

개발/iOS

[swift] codeschool: lv4. Table Views table view conterller는 table view를 support하는 특별한 뷰임. view contrller -> main view -> (scroll view -> label, image views)table view contrller -> table view -> (table cell, table cell ... )table cell안에 다양한 sub view가 들어갈 수 있음. 우측 아래에서 table view Controller를 찾아 추가하고,항상 그렇듯 is Initial view controller 추가,폴더 우클릭 - 새로운 파일 - 코코터치 - subclass를 UITableViewController로 수정class 이름은 ProcutsTableViewController그리고.. 더보기
[swift] codeschool: lv2. Outlets and Actions, lv3. Scroll Views storyboard outlest new file-cocoa touch class 만든 controller를 main view와 연결하기 위해 아래와 같이한다 Outlets?아웃렛은 스토리보드 객체와 Swift안의 변수의 connection을 생성한다. 아래와 같이 생성하려면 label항목을 우클릭해서 아래로 쭉 끌어준다 생기고 나면 왼쪽에 동그라미 생기는에 연결됐다는 뜻Name에 productNameLabel 넣고 나머지는 그대로 위는 이미지나 라벨이고, 버튼을 연결할 떄는 아래와 같이 한다.위에 Image로 하려면 Image 치고 두번째꺼(Image literal) 더블클릭하면 된다. 3.1 Scroll views 이렇게scorll view에서 작업을 하다가 First Responder 밑으로 보낸다.. 더보기
[swift] codeschool: lv1. Xcode and Storyboards level1. xcode and storyboard xcode create a new Xcode projectsingle view 위 처럼 프로젝트 생성 프로젝트 네이게이터모든 파일이 여기 보임 Main.storyboardUI 레이아웃 해주는 툴scene 끼리 연결 각 scene은 최소 하나의 view를 나타낸다.하나의 main view는 유저가 스크린에서 보게될 모든 것을 포함한다. 1.5 Storyboard and Subviewssingle 어플리케이션으로 만들었으면 MAin.storyboard에서 view controller scene 삭제하고, 왼쪽에서 ViewController.swift도 삭제 후... 추가하려면view를 추가할 떄 main.storyboard 클릭상태에서 오른쪽에서 view .. 더보기