Problems with presentviewcontroller in ios13
After updating Xcode 11.0 beta, run code discovery in IOS 13presentViewController
It is different from the previous pop-up style.
This is mainly because we were right beforeUIViewController
One of the attributes ismodalPresentationStyle
(this property is the style that the controller will use in modal view) the required type is not set. In ios13modalPresentationStyle
The default for is changed toUIModalPresentationAutomatic
Before, the default isUIModalPresentationFullScreen
。
/*
Defines the presentation style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter.
If this property has been set to UIModalPresentationAutomatic, reading it will always return a concrete presentation style. By default UIViewController resolves UIModalPresentationAutomatic to UIModalPresentationPageSheet, but other system-provided view controllers may resolve UIModalPresentationAutomatic to other concrete presentation styles.
Defaults to UIModalPresentationAutomatic on iOS starting in iOS 13.0, and UIModalPresentationFullScreen on previous versions. Defaults to UIModalPresentationFullScreen on all other platforms.
*/
@property(nonatomic,assign) UIModalPresentationStyle modalPresentationStyle API_AVAILABLE(ios(3.2));
To change the original modal view style, we just need toUIModalPresentationStyle
Set toUIModalPresentationFullScreen
Just.
ViewController *vc = [[ViewController alloc] init];
vc.title = @"presentVC";
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self.window.rootViewController presentViewController:nav animated:YES completion:nil];
Private KVC
When running a project using IOS 13, the app suddenlycrash
It fell. The problem located is in the settingUITextField
ofPlaceholder
That is, the KVC method is used for the color and font of placeholder text:
[_textField setValue:[UIColor redColor] forKeyPath:@"_placeholderLabel.textColor"];
[_textField setValue:[UIFont systemFontOfSize:14] forKeyPath:@"_placeholderLabel.font"];
You can replace it with
_ Textfield. Attributedplaceholder = [[nsattributedstring alloc] initwithstring: @ "name" attributes: @ {nsfontattributename: [UIFont systemfontofsize: 14], nsforegroundcolorattributename: [uicolor redcolor]}];
And it only needs to be set during initializationattributedPlaceholder
That is, the placeholder text of rich text is still used after re assignmentplaceolder
Set the text content directly, and the style will not change( If you want this effect, you need to initialize the attributedplaceholder (the string is not empty)
Universal link
To configure universal link in Xcode 11:
Open in safari in other apps before ios13Universal Link
(Universal link) the matching domain name of the system is full matching, but the rules have changed since ios13. It is speculated that it is inclusive. For example, before ios13, ifUniversal Link
(Universal link) isw.mydomain.com
Then visit wechat or other appswww.mydomain.com
Then click to open Safari, the corresponding app will not be pulled up, but the corresponding app will be pulled up in ios13.
The link entered in Safari is still the same as before IOS, onlywww.mydomain.com
Will prompt to open the corresponding app.
Modify app name (modify displayName value)
- Default when creating projects in Xcode
project.pbxproj
All inPRODUCT_NAME = "$(TARGET_NAME)"
;。 - Before Xcode 11.0, if you modify
DisplayName
Only modify wheninfo.plist
MediumBundle display name
Value, but changing this value in Xcode 11.0 willproject.pbxproj
One ofPRODUCT_NAME
Change to the modified value, if passed in the project[NSBundle mainBundle] infoDictionary]
takekCFBundleExecutableKey
Will have an impact, andBuild Settings
MediumPackaing
Some of the names in have an impact, and there may be other impacts to be concerned about.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support developpaer.