Title: Theory / Important / CS / Programming / Objective-C / Library / UIKit / Data protection
Tags: type

Question: The four level of data protection
Answer: No protection.Complete until first user authentication.
Page: https://developer.apple.com/documentation/uikit/about_app_development_with_uikit?language=objc
Answer2: Complete until first user authentication.
Answer3: Complete unless open.
Answer4: Complete
Name: UIKit framework

Name: No protection
Definition: The file is always accessible.
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Context: File protection UIKit

Name: Complete until first user authentication.
Definition: The file is inaccessible until the first time the user unlocks the device. After the first unlocking of the device, the file remains accessible until the device shuts down or reboots.
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Context: File protection UIKit

Name: Complete unless open
Definition: You can open existing files only when the device is unlocked. If you have a file already open, you may continue to access that file even after the user locks the device. You can also create new files and access them while the device is locked or unlocked.
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Context: File protection UIKit

Name: Complete
Definition: The file is accessible only when the device is unlocked.
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Context: File protection UIKit

Question: What is the default file protection level
Answer: Complete until first user authentication
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Context: File protection UIKit
Name: Complete

Instruction: [data
  writeTo:url
  options:level
]
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Effect: Write data to url and give protection level
Language: Objective-C
Variables: Data data
Name: Complete

Instruction: [url
  setResourceValue:value
  forKey: key
]
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/encrypting_your_app_s_files?language=objc
Effect: change resource associated to key to value
Language: Objective-C
Variables: NSUrl url
Name: Complete

Name: Purpose string
Definition: A string explaining why a permission is requested to the user
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources?language=objc
Name2: Usage destination

Question: What to do when doing an action that require special permission
Answer: Check if you have permission just before doing it. It may have been removed
Page: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources?language=objc
Answer2: Always accept failure gracefuly