Code Monkey home page Code Monkey logo

Comments (15)

carlostrianag avatar carlostrianag commented on July 30, 2024 2

Hi @buh, glad to hear you were able to replicate it. I'd like to add: even if your next release isn't happening soon, I would like to have early access to the commit where it is fixed, to see if I can integrate in the project, only if that's possible for you guys.

Thanks in advance for your hard work and help with this!

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024 2

Definitely will try that! I’ll let you know how it goes, and please excuse me for not telling you guys I was using SwiftUI.

Thanks!

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024 1

Hi @b-onc - Deleted DerivedData, cleaned, installed, even tested on a different computer, same issue.

Here you will find an example project with the issue I'm describing, hope you are able to replicate the it using this!

https://drive.google.com/file/d/1zrc0a_JYdyKsTOpVTO4oi_VbO8OPdP2k/view?usp=sharing

IMPORTANT:

Please, do not forget to fill file SceneDelegate.swift line 23 with your API KEY.

from stream-chat-swift.

buh avatar buh commented on July 30, 2024 1

Thanks @carlostrianag for the example project. Now we see the issue and will fix it in the next release.

from stream-chat-swift.

saurabhPV avatar saurabhPV commented on July 30, 2024

Gap is there even when keyboard is not visible.
Screenshot 2020-02-03 at 11 30 41 AM

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

Hello @carlostrianag
Thanks for the issue. Can you post more info about the view hierarchy? A screenshot of view debugger would help. Is your tabbar opaque? Do you directly embed chatviewcontroller or ChannelViewController pushes it?
We've resolved this issue in 1.5.5 as you've mentioned so it's surprising you're seeing this. If it's a regression, we'll make sure to resolve it in 1.5.6

@saurabhPV It's expected, you can customize this via style. See here

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024

Hello @b-onc, thanks for the quick response. Here are the details you requested.

Can you post more info about the view hierarchy?

image

Is your tabbar opaque?

Yes, it is

Do you directly embed chatviewcontroller or ChannelViewController pushes it?

ChannelViewController pushes it.

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

@carlostrianag Thanks for the info. Can you share more about your ChatDetailsViewController? Is the tab bar visible in your ChatDetailsViewController?
If your code is proprietary you can email us on [email protected]

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024

@b-onc - ChatDetailsViewController is a a class that extends from ChatViewController.

I have one more class called ConversationsViewController which is a class that extends from your ChannelsViewController and there I have overridden the createChatViewController with this:

    override func createChatViewController(with channelPresenter: ChannelPresenter, indexPath: IndexPath) -> ChatViewController {
        let chatVC = ChatDetailsViewController()
        chatVC.style = style
        channelPresenter.eventsFilter = channelsPresenter.channelEventsFilter
        chatVC.channelPresenter = channelPresenter
        return chatVC
    }

Is the tab bar visible in your ChatDetailsViewController?

No, tab bar is containing the ChatDetailsViewController through ConversationsViewController however it is not visible when ChatDetailsViewController is presented.

View Hierarchy

_UITabBarController
______ NavigationController
___________ConversationsViewController
_______________ChatDetailsViewController

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

@carlostrianag Thanks! I suspect the issue lies somewhere in how the ChatDetailsViewController UI is setup - in our tests (which uses ChatViewController we can't reproduce this issue. What custom stuff are you doing (regarding UI) inside your ChatDetailsViewController?
And by the way thanks a lot for the informative and to the point comments 👍

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024

@b-onc - you're welcome!

What custom stuff are you doing (regarding UI) inside your ChatDetailsViewController?

This is what I'm doing inside this class.

class ChatDetailsViewController: ChatViewController {
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        navigationController?.setupDefaultNavigationBar()
        navigationController?.navigationBar.prefersLargeTitles = false
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
    }
}

This is the code inside the method setupDefaultNavigationBar()

    func setupDefaultNavigationBar() {
        navigationBar.setBackgroundImage(UIColor.white.image(), for: .default)
        navigationBar.shadowImage = UIColor.white.image()
        navigationBar.isTranslucent = false
        navigationBar.tintColor = .black
        modalPresentationCapturesStatusBarAppearance = true
    }

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

Hello @carlostrianag ,
Trying the exact same configuration you've provided, I'm unable to reproduce the issue: the ComposerView moves correctly. Can you try deleting DerivedData (and related cache) and clean install? It'd be awesome if you can provide a simple example project.

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

Hello @carlostrianag ,
We've investigated the issue, and found a solution: just add .edgesIgnoringSafeArea(.bottom):

struct ContentView: View {
    var body: some View {
        TabView {
            ChatsViewController().tabItem {
                VStack {
                    Image(systemName: "1.circle")
                    Text("Chats")
                }
            }.edgesIgnoringSafeArea(.bottom)
        }
    }
}

Turns out SwiftUI does not pass safe area to child views, it just places them on top of tab bar and this was causing wrong calculations in composer view position calculations. When we add edgesIgnoringSafeAre(.bottom), SwiftUI puts the view all the way to the bottom so safe area is included in the calculations.
You can check how it's calculated in ChatViewController.swift:53 and ChatViewController+Composer.swift:21. It'd be helpful to mention you're using SwiftUI too, since we officially don't support it yet (but it's on our roadmap). Let me know if that works for you.

from stream-chat-swift.

carlostrianag avatar carlostrianag commented on July 30, 2024

Hello @b-onc, it worked for SwiftUI, however I realized I should not be using SwiftUI for that view, so I tried the usual way, using Storyboards. What is weird is that if I try using Storyboards in the sample project I sent, it works perfectly, however if I try Storyboards in the actual project it won't work. Same thing keeps happening. Already cleaned and re-installed.

As this is proprietary code, is there a way we could have sort of a call, to find out what's wrong and determine if it is still a bug?

from stream-chat-swift.

b-onc avatar b-onc commented on July 30, 2024

Hello @carlostrianag ,
You can reach us at [email protected] for further support. You can gather some info and open another issue in this repo, I've closed this since it was related to SwiftUI and was (kinda) resolved.

from stream-chat-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.