uikit

Opening popup links in UIWebView, possible?

[亡魂溺海] 提交于 2019-12-28 02:45:08
问题 I have a UIWebView which I'm using as an embedded browser within my app. I've noticed that links in webpages that open new windows are ignored without any call into my code. I've tried breakpointing on - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType and then selecting a link that would open a popup window, and the breakpoint is never hit. Is there anything I can do to intercept that selection of the

UIStackView Hide View Animation

早过忘川 提交于 2019-12-28 02:38:12
问题 In iOS 11 the behaviour of the hide animation within a UIStackView has changed, but I have been unable to find this documented anywhere. iOS 10 iOS 11 The code in both is this: UIView.animate(withDuration: DiscoverHeaderView.animationDuration, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 1, options: [], animations: { clear.isHidden = hideClear useMyLocation.isHidden = hideLocation }, completion: nil) How do I restore the previous behaviour on iOS 11? 回答1: Just had the same

Displaying a stock iOS notification banner when your app is open and in the foreground?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-27 11:04:28
问题 When Apple's official iOS Messages app is open and in the foreground, new messages from other contacts trigger a stock, native iOS notification alert banner. See image below. Is this possible in 3rd party apps on the App Store? Local and/or Push Notifications for your app while your app is open and in the foreground ? When testing my app , notifications are received but no iOS alert UI is shown . But this behavior is seen in Apple's official Messages app: The Local and Remote Notification

Displaying a stock iOS notification banner when your app is open and in the foreground?

旧巷老猫 提交于 2019-12-27 11:01:44
问题 When Apple's official iOS Messages app is open and in the foreground, new messages from other contacts trigger a stock, native iOS notification alert banner. See image below. Is this possible in 3rd party apps on the App Store? Local and/or Push Notifications for your app while your app is open and in the foreground ? When testing my app , notifications are received but no iOS alert UI is shown . But this behavior is seen in Apple's official Messages app: The Local and Remote Notification

Custom Animation for Pushing a UIViewController

和自甴很熟 提交于 2019-12-27 10:29:50
问题 I want to show a custom animation when pushing a view controller: I would like to achieve something like an "expand" animation, that means the new view expands from a given rectangle, lets say [100,100 220,380] during the animation to full screen. Any suggestions where to start, respectively any documents, tutorials, links? :) Alright. I could make the expand animation with the following code: if ([coming.view superview] == nil) [self.view addSubview:coming.view]; coming.view.frame =

How to determine the content size of a UIWebView?

大城市里の小女人 提交于 2019-12-27 09:02:12
问题 I have a UIWebView with different (single page) content. I'd like to find out the CGSize of the content to resize my parent views appropriately. The obvious -sizeThatFits: unfortunately just returns the current frame size of the webView. 回答1: It turned out that my first guess using -sizeThatFits: was not completely wrong. It seems to work, but only if the frame of the webView is set to a minimal size prior to sending -sizeThatFits: . After that we can correct the wrong frame size by the

How to determine the content size of a UIWebView?

妖精的绣舞 提交于 2019-12-27 09:02:07
问题 I have a UIWebView with different (single page) content. I'd like to find out the CGSize of the content to resize my parent views appropriately. The obvious -sizeThatFits: unfortunately just returns the current frame size of the webView. 回答1: It turned out that my first guess using -sizeThatFits: was not completely wrong. It seems to work, but only if the frame of the webView is set to a minimal size prior to sending -sizeThatFits: . After that we can correct the wrong frame size by the

How to add multiple UITextfield in iOS 5?

社会主义新天地 提交于 2019-12-25 19:37:00
问题 How do I create and add multiple UITextField to my controller? I can create one, like this: UITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(5,5,100,25)]; tf.borderStyle = UITextBorderStyleRoundedRect; [tf setReturnKeyType:UIReturnKeyDefault]; [tf setEnablesReturnKeyAutomatically:YES]; [tf setDelegate:self]; [self.view addSubview:tf] But do I need to do that for each UITextField? Whats the best approach to template UI Controls? 回答1: Put it in a loop, offset each text field's Y

Is it possible to customise the section index list in a UITableView (such as font)?

♀尐吖头ヾ 提交于 2019-12-25 19:13:28
问题 UITableView gives you the ability to edit colors of the section index list with properties such as var sectionIndexColor: UIColor? { get set } var sectionIndexBackgroundColor: UIColor? { get set } Is it possible to edit it in other ways? Looking for Swift implementations. 回答1: It is possible to adjust it if you're okay with accessing private properties. I believe this would pass store approval but don't take my word for it. Here are the properties/functions you would be able to access. https:

Is it possible to customise the section index list in a UITableView (such as font)?

僤鯓⒐⒋嵵緔 提交于 2019-12-25 19:12:23
问题 UITableView gives you the ability to edit colors of the section index list with properties such as var sectionIndexColor: UIColor? { get set } var sectionIndexBackgroundColor: UIColor? { get set } Is it possible to edit it in other ways? Looking for Swift implementations. 回答1: It is possible to adjust it if you're okay with accessing private properties. I believe this would pass store approval but don't take my word for it. Here are the properties/functions you would be able to access. https: