IOS10 App's permission to adapt to the Push Notifications font Frame !!!!, Ios10notifications
Add configuration permission
<! -- Album --> <key> NSPhotoLibraryUsageDescription </key> <string> "xx" requires your permission to use your album </string> <! -- Camera --> <key> NSCameraUsageDescription </key> <string> "xx" requires your permission to use your camera </string> <! -- Microphone --> <key> NSMicrophoneUsageDescription </key> <string> "xx" requires your permission to use your microphone </string> <! -- Location --> <key> NSLocationUsageDescription </key> <string> "xx" to access your location, please allow </string> <! -- Calendar --> <key> NSCalendarsUsageDescription </key> <string> "xx" to access your calendar, please allow </string> <! -- Media database --> <key> NSAppleMusicUsageDescription </key> <string> "xx" to access your media database, please allow </string> <! -- Bluetooth --> <key> nsbluw.thperipheralusagedescription </key> <string> "xx" to access your Bluetooth, please allow </string> <! -- Address book --> <key> NSContactsUsageDescription </key> <string> "xx" wants to access your address book, please allow </string> <key> NSLocationWhenInUseUsageDescription </key> <string> click "allow ". If not, you will not be able to use the "nearby" function normally. </String>
Add Push Notifications support
The xxxx. entitlements file is automatically generated when the switch is enabled.
Note the following points:
Whether the generated file is included in Bundle Resources in your package project. If not manually added
We recommend that you do not use Automatically manage signing if the project has multiple targets and multiple certificates are together.
Use the following method
Summary
The first one is for multiple apps. Therefore, you must specify the corresponding certificate when configuring the certificate. The automatic adaptation will be inaccurate, because our multiple projects are divided into multiple targets and many projects are shared.
The second is to include the generated entitlements file in the bundle.
Adaptive font
The best way to adapt to sb text in ios is to manually change the frame.
For a code-only page, you can add some frames according to the ratio when calculating the font size.
+ (CGSize) textFrameWithString :( NSString *) text width :( float) width fontSize :( NSInteger) fontSize {NSDictionary * dict =@{ NSFontAttributeName: [UIFont systemFontOfSize: fontSize]}; // based on the text content of the first parameter, the maximum size of 280 * float is used, and the system 14 character is used to return a real frame size: (280 * xxx )!! CGRect frame = [text boundingRectWithSize: CGSizeMake (width, CGFLOAT_MAX) options: NSStringDrawingUsesLineFragmentOrigin attributes: dict context: nil]; CGSize textSize = frame. size; CGFloat scale = 17.5/17.0; // iOS 10 if ([[UIDevice currentDevice]. systemVersion floatValue]> = 10.0) {textSize. width = textSize. width * scale; textSize. height = textSize. height * scale;} return textSize ;}
IOS10 many pitfalls are coming soon.