uikit

UIDocumentInteractionController does not open other app in iOS 11

。_饼干妹妹 提交于 2021-02-07 19:08:18
问题 My apps ability to share a PDF to another third party app has broken in iOS 11. It shows the share sheet but when I choose to open it in a different (third-party) app, it simply dismisses the share sheet and does nothing. Things I've confirmed: The delegate methods for willBeginSending and didEndSending are both called Opening first party apps like Mail or Notes works fine The document picker is still in memory Presenting a preview works fine but then the share button from inside the preview

How do you programmatically change the alpha of a UIVisualEffectView in a NavigationBar?

孤街浪徒 提交于 2021-02-07 08:27:00
问题 I have a scroll view that I'm using to control the alpha of other elements depending on how far down the view the user scrolls. First, I set up the blur view. Alpha here doesn't seem to take, firstly var effect: UIBlurEffectStyle = .light if #available(iOS 10.0, *) { effect = .prominent } let blurView = UIVisualEffectView(effect: UIBlurEffect(style: effect)) blurView.alpha = 0 if let navigationBar = navigationController?.navigationBar { blurView.frame = navigationBar.bounds } self.blurView =

How do you programmatically change the alpha of a UIVisualEffectView in a NavigationBar?

假如想象 提交于 2021-02-07 08:25:08
问题 I have a scroll view that I'm using to control the alpha of other elements depending on how far down the view the user scrolls. First, I set up the blur view. Alpha here doesn't seem to take, firstly var effect: UIBlurEffectStyle = .light if #available(iOS 10.0, *) { effect = .prominent } let blurView = UIVisualEffectView(effect: UIBlurEffect(style: effect)) blurView.alpha = 0 if let navigationBar = navigationController?.navigationBar { blurView.frame = navigationBar.bounds } self.blurView =

snapshotView(afterScreenUpdates: true) returns an empty view

依然范特西╮ 提交于 2021-02-07 07:46:10
问题 I want to implement a custom push-transition for a navigation controller. I first implemented the UINavigationControllerDelegate where I return an Object of UIViewControllerAnimatedTransitioning . In this class, I want to take a snapshot of the destination view in order to animate it. However, for the push-segue, this doesn't work - the snapshot ist empty. [ when I pop back, I set afterScreenUpdates = false and everything works ] guard let fromVC = transitionContext.viewController(forKey:

How to determine height of the toolbar in UINavigationController?

杀马特。学长 韩版系。学妹 提交于 2021-02-07 05:27:25
问题 I have a view with a toolbar presented by a UINavigationController. When I am handling UIKeyboardWillShowNotification, I'm scrolling the entire screen upwards by the height of the keyboard. The thing is when the keyboard is shown, the bottom toolbar is not, so I need to scroll the screen upwards by only (keyboard.height - toolbar.height). But how to get the height of the toolbar? Thanks 回答1: You just should check the toolbar frame. self.navigationController.toolbar.frame.size.height Of course

Is drawing to an MTKView or CAMetalLayer required to take place on the main thread?

笑着哭i 提交于 2021-02-07 04:17:01
问题 It's well known that updating the user interface in AppKit or UIKit is required to take place on the main thread. Does Metal have the same requirement when it comes to presenting a drawable ? In a layer-hosted NSView that I've been playing around with, I've noticed that I can call [CAMetalLayer nextDrawable] from a dispatch_queue that is not the main_queue . I can then update that drawable's texture as usual and present it. This appears to work properly, but I find that rather suspicious.

Is drawing to an MTKView or CAMetalLayer required to take place on the main thread?

ぐ巨炮叔叔 提交于 2021-02-07 04:16:24
问题 It's well known that updating the user interface in AppKit or UIKit is required to take place on the main thread. Does Metal have the same requirement when it comes to presenting a drawable ? In a layer-hosted NSView that I've been playing around with, I've noticed that I can call [CAMetalLayer nextDrawable] from a dispatch_queue that is not the main_queue . I can then update that drawable's texture as usual and present it. This appears to work properly, but I find that rather suspicious.

Add Border to UISegmentedControl

﹥>﹥吖頭↗ 提交于 2021-01-29 13:43:39
问题 how can i set a border with a color to a UISegmentedControl ? I'm getting this by default (incorrect): I was trying this but nothing happens UISegmentedControl.appearance().layer.borderWidth = 1.0 UISegmentedControl.appearance().layer.cornerRadius = 5.0 UISegmentedControl.appearance().layer.borderColor = UIColor.white.cgColor UISegmentedControl.appearance().layer.masksToBounds = true i want to achieve this border (correct): 回答1: I use this function to alter my SegmentedControl: func