You are on page 1of 11

Ministry of Education

‫لتعليم‬$ ‫وزارة ا‬
Imam Abdulrahman Bin ‫ة‬$‫ع‬$‫ام‬$‫ج‬ ‫يصل‬$$‫نف‬$$$‫ب‬
‫من‬$‫لرح‬$$‫المام عبدا‬$$‫ا‬
Faisal University
Applied College ‫لكلية‬$$‫ا‬
‫لتطبيقية‬$ ‫ا‬

IOS DEVELOPMENT-1
COMP224

Lab (2)
XCODE FILE TYPES
• This is the project file.
• It includes “all the settings for your project and its targets.
• Each target is a product that Xcode can build from the project.
For now, the targets you'll build will be executable apps.
• Files with this icon contain Swift code.
• Whenever you build your app, Xcode gathers up all included Swift files
and runs them through the Swift compiler, which converts the code into
a format your selected device understands.
• This icon represents a storyboard.
• All storyboard files are unique to Interface Builder.
• They contain information about the design of each scene within your
application, as well as how one screen transitions to another.
• This icon represents an asset catalog.
• This includes your app's icon, images, color definitions, and other forms
of data to be bundled with your app.
• It also allows you to specify variants of your assets based on device
settings and capabilities such as light and dark appearance, accessibility
settings for high and low contrast, and hardware differences from screen
resolutions to memory capacity and graphics chip support.
XCODE FILE TYPES

• This icon represents a file containing a list of


properties and settings for your app.
• Xcode provides a special interface for editing this file
so that you rarely need to interact with it directly.
BUILDING AND RUNNING APP

• When creating the project, make sure the interface option is set to
Storyboard
• After the project is opened, locate the Scheme menu on the Xcode toolbar
and choose the device you want to simulate from the list.
• Click the Run button to begin launching the app in Simulator.
• A device image with white background will appear.
DEBUGGING AN APPLICATION

• Debugging is the process of identifying and removing problems


that may arise in your app.
• There are three types of issues: warnings, compiler errors, and
bugs.
WARNING

• They’re generated whenever your code is built, but they don’t


prevent your program from successfully compiling and running.
Examples:
• Writing code that never gets executed
• Creating a variable that never changes
• Using code that’s out of date (also known as deprecated code)
COMPILER ERRORS

• an error prevents the code from ever being executed.


• Simulator won’t even launch if your code has a compiler error.
Examples:
• invalid code (such as a typo)
• improperly declaring a variable
• improperly calling a function
BUGS

• A bug is an error that occurs while running the program,


resulting in a crash or incorrect output.
• It is the hardest issue to track down.
WHERE TO WRITE YOUR CODE

3 Run code

Put your code


2 here

The output
4 appears here
EXERCISE (1)

• Create a new project with name “lab2”


• Define a constant “year” with value “2022”
• Define a string variable str1 with value “IOS Development!”
• Define a string variable str2 with value “course”
• Find the count of characters of str1.
• Cncatenate str1 with str2 using “+” operation and print the
result.
• Print the first letter of str1.
• Print the last letter of str1.
• Print the letter after the first one in str2.
• Print the latter that is before the last one.
• For str1, Print the letter after the first one by 6 letters.
• Insert “2022” at the end of str2.
• Remove the last letter of str1.
• Compare between str1 and str2, if they are equal print the
message: “Equal” if not print: “Not equal”.

You might also like