Tải bản đầy đủ (.pdf) (4 trang)

CÁC THÀNH PHẦN TRONG ỨNG DỤNG IOS(BÀI2)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (169.42 KB, 4 trang )

CÁC THÀNH PHẦN TRONG ỨNG DỤNG IOS(BÀI2)
Ở bài trước chúng ra đã tìm hiểu cách cài Xcode tool lập trình ios do Apple cung cấp .
Ở bài này chúng ta sẽ tìm hiểu công cụ lập trình Xcode, menu ,các file cơ bản nguyên
lý khởi tạo và chạy ứng dụng!
chúng ta cùng tiếp tục nào :
Các thành phần cơ bản của một app ios :
–file .h gồm :@interface khai báo : biến , fun ,class ,protocol…
–file .m: @implementation: thực thi

1. Tổng quan:
Xem thêm: Địa chỉ học lập trình ios ở đâu tốt nhất
FILE: AppDelegate: Mình đã commen các hàm cơ bản trong Appdelegate nội dung các
hàm ý nghĩa như sau:
1. // bắt đầu chạy khi app gọi
2.
3. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
4. // Override point for customization after application launch.
5. return YES;


6. }// sẽ chạy sau Didview
7.
8. - (void)applicationWillResignActive:(UIApplication *)application {
9. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary

interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the
transition to the background state.
10. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use
this method to pause the game.
11. }
12. // chạy khi app chạy ở chế độ nền


13. - (void)applicationDidEnterBackground:(UIApplication *)application {
14. // Use this method to release shared resources, save user data, invalidate timers, and store enough application state
information to restore your application to its current state in case it is terminated later.
15. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the
user quits.
16. }
17. // chạy khi app sẽ chạy ở chế độ nền
18. - (void)applicationWillEnterForeground:(UIApplication *)application {
19. // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made
on entering the background.
20. }
21. // khi app hoàn thành
22. - (void)applicationDidBecomeActive:(UIApplication *)application {
23. // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was
previously in the background, optionally refresh the user interface.
24. }

-FILE :Main.storyboard
Gồm các viewcontroller các màn hình, các cảnh trong app , nơi thiết kế giao diện


-FILE : Assets.xcassets
– chứa icon của ứng dụng
-FILE :ViewController
Class thực thi code. quản lý các màn hình viewcontroller .
-FILE: LaunchScreen
Màn hình khởi động chạy load
-FILE:Info



thông tin app- cấu hình app
-FILE: Supporting Files
chứa main app
Xem thêm: Địa chỉ học lâp trình android ở đâu
2. Nguyên lý chạy cơ bản :
main khởi tạo chạy ứng dụng-> thông tin cấu hình app cho phép-> khởi tạo màn hình
khởi động-> gọi đến appdelegate khởi tạo hàm bắt đầu chạy trong app-> sau đó chạy
các hàm thực thi viewcontroller



×