250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- javascript
- jQuery
- 비전공자
- iPhone
- php
- keyframes
- button
- 애니메이션
- 자바스크립트
- hover
- front-end
- xcode
- 풀스택
- Animation
- image
- 프론트엔드
- react
- 비전공 개발자
- effect
- ipad
- HTML
- IOS
- MAC
- CSS
- 개발자
- css3
- iOS 개발자
- html5
- SWIFT
- 백엔드
Archives
- Today
- Total
비전공자 개발일기
My First iOS Application + useful shortcut keys in Xcode 본문
728x90
SMALL
// Apple이 만든 Framework를 사용하겠다는 의미
import UIKit
class ViewController: UIViewController {
// IB: Interface Builder
// 연결된 것을 끊을 때 코드만 삭제하면 에러 발생
// 1. viewController 내 해당 요소 우클릭 후 연결된 것 삭제
// 2. 어시스턴트 가장 왼쪽(삼각자 오른쪽)에서 연결된 것 중에서 필요없는 것 삭제
// 변수 생성
@IBOutlet weak var mainLabel: UILabel!
@IBOutlet weak var mainBtn: UIButton!
// 앱 화면에 들어오면 처음 실행되는 함수
override func viewDidLoad() {
super.viewDidLoad()
mainLabel.text = "Can u hear me???"
mainLabel.backgroundColor = #colorLiteral(red: 0.5568627715, green: 0.3529411852, blue: 0.9686274529, alpha: 1)
mainLabel.textColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
}
@IBAction func btnPressed(_ sender: UIButton) {
// 색상 변경 -> #colorLiteral()
// 이미지 선택 -> #iamgeLiteral()
mainLabel.backgroundColor = #colorLiteral(red: 0.2392156869, green: 0.6745098233, blue: 0.9686274529, alpha: 1)
mainLabel.textColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
mainLabel.text = "Who R U????"
mainBtn.backgroundColor = #colorLiteral(red: 0.9098039269, green: 0.4784313738, blue: 0.6431372762, alpha: 1)
}
}
iOS 어플 제작 과정에서 유용한 Xcode 단축키
- Cmd + Shift + Y: 디버깅 창 On / Off
- Cmd + Shift + L: 라이브러리창 On / Off
- Ctrl + Option + Cmd + Ender: 어시스턴트창 On / Off
- Cmd + R: 빌드
- Ctrl + 특정 요소 -> 코드로 드래그
- Option + 요소 드래그 -> 복사
- Option + Cmd + E -> 파일 내 동일한 단어 다중 선택
- Ctrl + i -> 코드 정렬
- Cmd + Shift + O: 검색 및 해당 파일로 이동
728x90
LIST
'SWIFT' 카테고리의 다른 글
UP and DOWN Number Game (0) | 2022.11.05 |
---|---|
Rock Scissors Paper (0) | 2022.11.04 |
Dice Game + breakpoint Error (0) | 2022.11.04 |
Swift Basic - function, Optional type... (0) | 2022.11.01 |
Swift Basic - variable, operator, loop, scope, ... (0) | 2022.10.31 |