Post

Replies

Boosts

Views

Activity

Interactive dismiss of view controller with scroll view
Hi, I'm having a hard time with interactively dismissing (swiping down) a view controller that it not nested in a UINavigationController and that has a ScrollView. Instead of swiping down, the scrollview just scrolls. When I have the view controller nested in a navigation controller, then the system somehow sees that the scroll view is scrolled to the top, and allows the user to pull down the whole view controller. What is the navigation controller doing here, what I need to re-implement in my view controller? Thanks for any hints!
0
0
478
Jul ’23
Embedded Binary Bundle Identifier: (null)
Hi, I'm trying to build a Notification Service Extension. When I run the application, I get the error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier. Embedded Binary Bundle Identifier:(null) Parent App Bundle Identifier: ##.#####.##### I have no idea why the identifier of the embedded bundle could be null. In the General tab of the extension, I have set it so that it has a common prefix with the parent app. In the Info tab, the value for Bundle Identifier is $(PRODUCT_BUNDLE_IDENTIFIER), and I cannot change that to anything else. Whenever I build, it goes back to this. Xcode Version 13.0 Any ideas?
3
1
5.6k
Nov ’21
View extends under NavigationBar when UISearchController is active, although edgesForExtendedLayout = []
In my ViewController, which is shown within a UINavigationController, I need the very old (pre iOS6) behaviour where the view does not extend under the navigation bar. For that, I set edgesForExtendedLayout = [], which works fine so far. I also have a UISearchController set in the navigationItem.The problem occurs in the following situation: The SearchController is active (i.e. text field has the focus), and another view controller is pushed. When I tap "back", the view of my view controller now suddenly extends under the navigation bar.Here is a minimal example:class TestViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let searchViewController = UISearchController(searchResultsController: nil) searchViewController.obscuresBackgroundDuringPresentation = false view.backgroundColor = .red edgesForExtendedLayout = [] navigationItem.searchController = searchViewController definesPresentationContext = true navigationController?.view.backgroundColor = .green navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) navigationController?.navigationBar.shadowImage = UIImage() let button = UIButton(type: .system) button.setTitle("Push", for: .normal) button.frame = .init(x: 10, y: 100, width: 100, height: 40) button.addTarget(self, action: #selector(self.pushViewController), for: .touchUpInside) view.addSubview(button) } @objc func pushViewController() { let nextViewController = UIViewController() navigationController?.pushViewController(nextViewController, animated: true) } } class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { let vc = TestViewController() let nc = UINavigationController(rootViewController: vc) window.rootViewController = nc window.makeKeyAndVisible() return true } }Any ideas?
2
0
2.3k
Oct ’19
scrollEdgeAppearance not applied when largeTitleDisplayMode = .never
Hi,I'm trying to use the new scrollEdgeAppearance in order to have a transparent navigation bar background when the table view is scrolled to the top. However, this seems only to work when I use large titles. Is this intended?navigationItem.title = "Test title" navigationItem.largeTitleDisplayMode = .never // <- This seems to break it let standardAppearance = UINavigationBarAppearance() standardAppearance.configureWithDefaultBackground() navigationItem.standardAppearance = standardAppearance // This appearance is never applied: let scrollEdgeAppearance = UINavigationBarAppearance() scrollEdgeAppearance.configureWithTransparentBackground() navigationItem.scrollEdgeAppearance = scrollEdgeAppearanceThanks!
4
0
2.2k
Aug ’19