-
Book Overview & Buying
-
Table Of Contents
Swift Cookbook
By :
Usually, Apple tries to make the developer's life easier by improving Xcode and creating tools, but there is an exception when we talk about certificates. If you want to test your app on a physical device (iPhone, iPad, or iPod), you need a certificate. If you would like to upload it onto the App Store, you also need this certificate.
The idea of a certificate is to protect your code from malicious code or from being modified after being signed, but this idea has a price. To get a certificate, you will need to be enrolled on the Apple Developer Program.
I will assume that if you continue with this recipe, you are already enrolled on this program. Let's recycle the previous project; open it, and let's start.
Follow these steps to add an Apple developer account:


Your device should appear on the dialog, Xcode could take a while to read the device's symbols. In case of having this device attached for the first time, you will see that you will have to ask to change the status of this device to developer mode.
If the device is enabled, but not listed by Xcode, it could mean that you have to decrease the iOS Deployment Target, which can be found on the project setting, under the Info tab.

Lowering the iOS Deployment Target to the minimum value is an idea very common among programmers to cover the maximum sort of devices. Doing this will prevent your development from using new features. Check out the features that you need first, and then change your iOS Deployment Target.
Signing a code is something done for security; the main restriction is that you must be up to date with the Apple Developer Program. Apple allows having up to 100 devices per account.
Sometimes, the certificate gives us some headache; take care if it asks you to revoke your certificate; you may have to create a new one on the Apple Developer Center, and if you are working on a team, you may have to wait for the administrator's approval.
There are a few times that you need to change the code signing option on the build settings; it happens mainly when you get code from another organization ID.
Testing your code on a device is something that is very useful; it's where you can test the real user experience. Whenever you have some low-level code, such as assembly code or something written in C language that uses type sizes or byte orders, it's good to test your project on a device. Remember that Apple's devices have CPUs based on ARM and ARM64, which are different to the Intel CPU that is used on Mac computers.
Change the font size
Change margin width
Change background colour