wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Sprint 1 cho Fresher iOS

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Hàm nào trong AppDelegate được gọi khi app chạy xong khởi tạo?

a)

sceneWillResignActive

b)

applicationDidFinishLaunching

c)

sceneDidBecomeActive

d)

applicationWillTerminate

2.

Hàm viewDidLoad() của UIViewController được gọi khi nào?

a)

Khi view sắp hiển thị

b)

Khi view đã load xong

c)

Khi view bị ẩn

d)

Khi view controller vừa khởi tạo

3.

Component nào dùng để nhập văn bản từ người dùng?

a)

UILabel

b)

UIButton

c)

UITextField

d)

UISwitch

4.

Thuộc tính nào của UIButton đặt hành động khi nhấn?

a)

addTarget()

b)

setTitle()

c)

setImage()

d)

isEnable

5.

Protocol bắt buộc để hiển thị data trong UITableView?

a)

UITableViewDelegate

b)

UITableViewDataSource

c)

UIScrollViewDelegate

d)

UITableDataSource

6.

Hàm nào trả về số section trong UITableView?

a)

cellForRowAt

b)

numberOfRowsInSection

c)

numberOfSections

d)

didSelectRow

7.

Phần UI nào không có trong UITableView?

a)

Cell

b)

SectionHeader

c)

SectionSpacing

d)

SectionFooter

8.

Lệnh nào để push ViewController lên Navigation Stack?

a)

popViewController()

b)

pushViewController()

c)

present()

d)

show()

9.

Để custom NavigationBar, ta sửa property nào của UIViewController?

a)

navigationItem

b)

navigationBar

c)

toolbar

d)

navigationController

10.

Closure trong Swift là gì?

a)

Một block code có thể gán vào biến

b)

Một protocol

c)

Một class

d)

Một hàm có thể truyền vào biến

11.

Delegate thường được khai báo bằng từ khoá nào?

a)

lazy

b)

unowned

c)

strong

d)

weak

12.

Hiện tượng retain cycle xảy ra khi?

a)

Khi mở quá nhiều ViewController

b)

2 class chứa thuộc tính là kiểu class còn lại

c)

2 object strong reference lẫn nhau

d)

Không dùng weak self cho closure

13.

Khi nào nên dùng unowned thay weak?

a)

Khi không muốn unwrap optional

b)

Object có thể nil

c)

Dùng thoải mái

d)

Object luôn tồn tại lâu hơn closure

14.

Cách đặt cornerRadius cho UIView?

a)

view.radius

b)

view.layer.cornerRadius

c)

view.layer.border

d)

view.border

15.

Để ScrollView cuộn được, cần thiết lập gì?

a)

ContentSize > FrameSize

b)

ContentInset

c)

Cả hai

d)

Không cần thiết lập, kéo vào là chạy

16.

Để register cell cho CollectionView, dùng phương thức nào?

a)

register(_:forCellWithReuseIdentifier:)

b)

dataSource = self

c)

dequeueReusableCell(withIdentifier:)

d)

delegate = self

17.

Khi nào cellForItemAt chắc chắn được gọi?

a)

Khi bắt đầu load TableView hoặc CollectionView

b)

Khi scroll tới cell mới

c)

Khi reloadData()

d)

Khi xoá cell

18.

Khai báo biến Tên kế thừa UILabel thì đặt tên gì đúng Coding Convention?

a)

tenUILabel

b)

nameLabel

c)

labelName

d)

nameLbl

19.

Trong CustomView thuộc tính nào gọi khi view thay đổi kích thước?

a)

init(frame)

b)

draw(_)

c)

layoutSubviews()

d)

setNeedDisplay()

20.

UICollectionViewFlowLayout không có thuộc tính nào?

a)

itemSize

b)

sectionInset

c)

collectionViewFlowLayout

d)

textAlignment