Giter VIP home page Giter VIP logo

Comments (15)

wtmoose avatar wtmoose commented on May 22, 2024

I don't understand your question. Could you add some details please?

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

I have a UIAlertController and SwiftMessage in ViewController, both are show.
UIAlertController is hidden when the SwiftMessage is automatically hidden.

not only the UIAlertController, more that animation will are hidden.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Depending on how things are configured, the message view may be displayed in its own window (an instance of PassthroughWindow. This is a temporary window that gets removed after the message view is hidden. If the alert view is being presented in that window, then it would get removed as well.

Do you have a sample project reproducing the problem that you can attach here?

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

I tried to used default presentationContext, but SwiftMessage does't show sometimes.

when I multiple switching viewcontroller, SwiftMessage don't work.

import UIKit
import SwiftMessages

class MessageHelper {

    class func showSuccess(title title: String = "Success", body: String, layout: MessageView.Layout = MessageView.Layout.CardView) {
        let view = initView(layout, theme: Theme.Success, title: title, body: body)
        SwiftMessages.show(view: view)
    }

    class func showError(title title: String = "Error", body: String, layout: MessageView.Layout = MessageView.Layout.CardView) {
        let view = initView(layout, theme: Theme.Error, title: title, body: body)
        SwiftMessages.show(view: view)
    }

    class func showWarning(title title: String = "Warning", body: String, layout: MessageView.Layout = MessageView.Layout.CardView) {
        let view = initView(layout, theme: Theme.Warning, title: title, body: body)
        SwiftMessages.show(view: view)
    }

    class func showInfo(title title: String = "Info", body: String, layout: MessageView.Layout = MessageView.Layout.CardView) {
        let view = initView(layout, theme: Theme.Info, title: title, body: body)
        SwiftMessages.show(view: view)
    }

    private class func initView(layout: MessageView.Layout,
                                theme: Theme,
                                title: String,
                                body: String,
                                presentationStyle: SwiftMessages.PresentationStyle = .Bottom,
                                presentationContext: SwiftMessages.PresentationContext = .Window(windowLevel: UIWindowLevelAlert)) -> MessageView {
        SwiftMessages.defaultConfig.presentationContext = presentationContext
        SwiftMessages.defaultConfig.presentationStyle = presentationStyle
        let view = MessageView.viewFromNib(layout: layout)
        view.configureTheme(theme)
        view.configureDropShadow()
        view.button?.hidden = true
        view.configureContent(title: title, body: body)
        return view
    }
}

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

You're using a default window level UIWindowLevelAlert and it sounds like this conflicts with UIAlertController. Can you use UIWindowLevelNormal or UIWindowLevelStatusBar instead?

UIWindowLevelNormal to display the message under alerts. Use UIWindowLevelStatusBar to display the message over alerts (and the status bar). Either of these options should display the message over the main window.

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

thx, I'll try it. give your reply tomorrow.

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

I tried UIWindowLevelNormal and UIWindowLevelStatusBar, but problems persist.

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

I have not been able to reproduce your issue. In my tests, I have no problem displaying UIAlertController at the same time as a message. In order to help you further, I'll need more information. Ideally, supply me with a sample project that demonstrates the problem. I've attached my sample project that works if that helps. Also, I recommend posting this question to StackOverflow (and tagging @timothymoose). You'll get more eyes on the problem.

SwiftMessagesDebug.zip

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

alright, maby it is my problem, because the AlertController is custom by myself.

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

I got new problem made application crash, following log.

Could not instantiate class named UIStackView
(null)
((
    0   CoreFoundation                      0x00000001856ce5b8 <redacted> + 160
    1   libobjc.A.dylib                     0x0000000195e180e4 objc_exception_throw + 60
    2   CoreFoundation                      0x00000001856ce4dc <redacted> + 0
    3   UIKit                               0x000000018a3613cc <redacted> + 380
    4   UIKit                               0x000000018a36151c <redacted> + 716
    5   UIKit                               0x000000018a361238 <redacted> + 344
    6   UIKit                               0x000000018a13db50 <redacted> + 636
    7   UIKit                               0x000000018a36157c <redacted> + 812
    8   UIKit                               0x000000018a36151c <redacted> + 716
    9   UIKit                               0x000000018a361238 <redacted> + 344
    10  UIKit                               0x000000018a13db50 <redacted> + 636
    11  SwiftMessages                       0x0000000101ee559c _TTSf4g_n___TFC13SwiftMessages8BaseViewcfT5coderCSo7NSCoder_GSqS0__ + 180
    12  SwiftMessages                       0x0000000101ee3984 _TFC13SwiftMessages8BaseViewcfT5coderCSo7NSCoder_GSqS0__ + 20
    13  SwiftMessages                       0x0000000101ee7854 _TToFC13SwiftMessages11MessageViewcfT5coderCSo7NSCoder_GSqS0__ + 40
    14  UIKit                               0x000000018a288e98 <redacted> + 236
    15  UIKit                               0x000000018a36157c <redacted> + 812
    16  UIKit                               0x000000018a361238 <redacted> + 344
    17  UIKit                               0x000000018a2889a0 <redacted> + 128
    18  UIKit                               0x000000018a36157c <redacted> + 812
    19  UIKit                               0x000000018a36151c <redacted> + 716
    20  UIKit                               0x000000018a361238 <redacted> + 344
    21  UIKit                               0x000000018a287e28 <redacted> + 1100
    22  UIKit                               0x000000018a289e28 <redacted> + 188
    23  SwiftMessages                       0x0000000101ef5334 _TZFC13SwiftMessages13SwiftMessagesP33_AB28F0CA9BFF0B16E059C4C20EF9AFAA19internalViewFromNibuRxCSo6UIViewrfzT5namedSS6bundleGSqCSo8NSBundle_10filesOwnerPs9AnyObject__x + 416
    24  SwiftMessages                       0x0000000101ee7ca0 _TZFC13SwiftMessages11MessageView11viewFromNibuRxS0_rfT6layoutOS0_6Layout10filesOwnerPs9AnyObject__x + 120
    25  TalkpalLive                         0x10009db68 TalkpalLive + 645992
    26  TalkpalLive                         0x1000f43fc TalkpalLive + 1000444
    27  TalkpalLive                         0x10006d384 TalkpalLive + 447364
    28  TalkpalLive                         0x1000f4288 TalkpalLive + 1000072
    29  RxSwift                             0x00000001019ae998 _TFFE7RxSwiftPS_14ObservableType13subscribeNextFFwx1ET_PS_10Disposable_U_FGOS_5EventQQPS0_1E_T_ + 156
    30  RxSwift                             0x00000001019b5e10 _TFC7RxSwift12ObserverBase2onfGOS_5Eventx_T_ + 456
    31  RxSwift                             0x00000001019b5ed4 _TTWurGC7RxSwift12ObserverBasex_S_12ObserverTypeS_FS1_2onfGOS_5Eventwx1E_T_ + 52
    32  RxSwift                             0x00000001019dafa0 _TFC7RxSwift15SubscribeOnSink2onfGOS_5Eventwx1E_T_ + 232
    33  RxSwift                             0x00000001019db510 _TTWu0_Rx7RxSwift14ObservableType_S_12ObserverTypewx1Ezw_1ErGCS_15SubscribeOnSinkxq__S1_S_FS1_2onfGOS_5EventwxS3__T_ + 52
    34  RxSwift                             0x00000001019e25b8 _TFC7RxSwift13TakeUntilSink16_synchronized_onfGOS_5Eventx_T_ + 296
    35  RxSwift                             0x00000001019e28dc _TTWu1_R0_7RxSwift12ObserverTypexzw0_1ErGCS_13TakeUntilSinkxq_q0__S_18SynchronizedOnTypeS_FS3_16_synchronized_onfGOS_5EventwxS1__T_ + 52
    36  RxSwift                             0x00000001019de484 _TFE7RxSwiftPS_18SynchronizedOnType14synchronizedOnfGOS_5Eventwx1E_T_ + 80
    37  RxSwift                             0x00000001019e2928 _TTWu1_R0_7RxSwift12ObserverTypexzw0_1ErGCS_13TakeUntilSinkxq_q0__S0_S_FS0_2onfGOS_5EventwxS1__T_ + 52
    38  RxSwift                             0x000000010195ff78 _TFC7RxSwift23AnonymousObservableSink2onfGOS_5Eventwx1E_T_ + 636
    39  RxSwift                             0x00000001019600cc _TTWuRx7RxSwift12ObserverTyperGCS_23AnonymousObservableSinkx_S0_S_FS0_2onfGOS_5Eventwx1E_T_ + 52
    40  RxSwift                             0x0000000101960c88 _TPA + 72
    41  RxCocoa                             0x00000001018553ec _TPA__TFFFE7RxCocoaCSo9UIControl15rx_controlEventFVSC15UIControlEventsGVS_12ControlEventT__U_FGV7RxSwift11AnyObserverT__PS3_10Disposable_U_FS0_T_ + 84
    42  RxCocoa                             0x0000000101825e80 _TToFC7RxCocoa13ControlTarget12eventHandlerfGSQCSo9UIControl_T_ + 216
    43  UIKit                               0x0000000189eb1418 <redacted> + 96
    44  UIKit                               0x0000000189e9a52c <redacted> + 612
    45  UIKit                               0x0000000189eb0db4 <redacted> + 592
    46  UIKit                               0x0000000189eb0a40 <redacted> + 700
    47  UIKit                               0x0000000189ea9f94 <redacted> + 684
    48  UIKit                               0x0000000189e7d68c <redacted> + 264
    49  UIKit                               0x000000018a11c60c <redacted> + 14992
    50  UIKit                               0x0000000189e7bbf4 <redacted> + 1616
    51  CoreFoundation                      0x00000001856869ec <redacted> + 24
    52  CoreFoundation                      0x0000000185685c90 <redacted> + 264
    53  CoreFoundation                      0x0000000185683d40 <redacted> + 712
    54  CoreFoundation                      0x00000001855b10a4 CFRunLoopRunSpecific + 396
    55  GraphicsServices                    0x000000018e74b5a4 GSEventRunModal + 168
    56  UIKit                               0x0000000189ee2aa4 UIApplicationMain + 1488
    57  TalkpalLive                         0x100089990 TalkpalLive + 563600
    58  libdyld.dylib                       0x0000000196486a08 <redacted> + 4
)

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Is this iOS 8? The layouts that use stack views aren't compatible with iOS 8. There is one layout provided for iOS 8 called MessageViewIOS8. You can copy the nib it into your project and modify it to suit your design. Or just create your own nib file.

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

ok, thx~

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

StatusLine is also support iOS8.0, right?

from swiftmessages.

wtmoose avatar wtmoose commented on May 22, 2024

Yes, it does.

from swiftmessages.

chakery avatar chakery commented on May 22, 2024

many thanks for your answer and the SwiftMessages.

from swiftmessages.

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.