Closed gosha999 closed 9 years ago
Hi Igor,
First of all thanks for pointing out the compilation errors. XCode ignored that semi-colon, and I let my integration perhaps get a little too close to my test project. Those should be fixed now.
As for why the composer isn't appearing, have you tried adding the following self.edgesForExtendedLayout = UIRectEdgeNone;
to your viewDidLoad
implementation? It would also be helpful to know which device + OS version you're testing this against and whether or not your navigation bar is translucent.
Thanks!
It also might be helpful to try using the "Debug View Hierarchy" option if you're using XCode. It might show where the MessageComposerView has gone if it has been moved offscreen.
Thank you for your prompt response.
I am running in iPhone6 emulator with iOS 8.2. self.edgesForExtendedLayout = UIRectEdgeNone; did not have effect.
I did not use standard navigation bar and toolbar, instead there are some custom controls performing these functions (thats because I am porting an android application to iOS and trying to keep Java and Swift application organised in similar way, including navigation mechanism that manually loads and switches ViewControllers).
Also thank you the "Debug View Hierarchy" tip - I was not aware that it exists, and found it very helpful. It turned out that MessageComposer is located under the bottom of the screen. I attach the screenshot of view hierarchy.
Can I modify my code to set the offset of MessageComposer from screen bottom manually?
self.edgesForExtendedLayout = UIRectEdgeNone;
did nothing likely because of the custom porting you're doing. MessageComposerView depends on standard iOS navigation bar and view layout.
If you're interested in making it work for your custom implementation you'll have to tweak the currentScreenSizeInInterfaceOrientation:
method within the MessageComposerView lib. This function is used to determine the Y position (based on screen height) and width (based on screen width).
Let me know if that helps!
P.S. if it's not too late I would highly advise against this path you're heading down. You'll likely spend more time wrangling with infuriating compatibility issues than you would if you were just to build the application using standard iOS libs instead.
Thank you very much for this explanation. I see that I have some homework to do with the application design in general. I will also try to play with currentScreenSizeInInterfaceOrientation implementation.
Hi, I am trying to integrate MessageComposerView in swift project using swift bridging header.
I had some compilation and some runtime issues.
Compilation: line 163: messageTextViewFrame.size.height = messageTextViewFrame.size.height - _composerBackgroundInsets.top; - _composerBackgroundInsets.bottom; Minus after semicolon makes compiler warning - not sure if semicolon should be removed or the rest of the line should be commented
[NSString isEmpty:textView.text] in couple of places in code generates error: isEmpty is an unknown method. I replaced it meanwhile with [textView.text length] == 0
Runtime: When I get to the ViewController integrated with MessageComposerView I just don't see anything. This is the code in ViewController
class Reply2ViewController: UIViewController, MessageComposerViewDelegate {
}
I instantiate it with the following code:
contentViewControllers[TiktekStateType.REPLY] = Reply2ViewController(nibName: "Reply2ViewController", bundle: nil);
The xib file contains nothing on this stage.
The view controller is displayed in a situation when user wants to reply to a message.
I would be very grateful for any tip on what I possibly did wrong.
Thank you,
Igor Goldberg