热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

DisplayingandEnqueuingEntrydoesnotwork.

DescribethebugIwouldliketodisplayanentry,andenqueueanoth

Describe the bug
I would like to display an entry, and enqueue another one to be displayed after. But when I call the functions consecutively, entry does NOT appear. (The background of the entry is applied, but the entry does not appear)

To Reproduce
Steps to reproduce the behavior:

1
2
3
4
 swift

SwiftEntryKit.display(entry: firstEntry, using: attributes)

attributes.precedence = .enqueue(priority: .normal)

SwiftEntryKit.display(entry: secondEntry, using: attributes)

Expected behavior
First entry is shown, and when it is dismissed, the next one in queue should appear.

iPhone (please complete the following information):
- Device: iPhone 7, iPhone Xs
- iOS Version: iOS 12, iOS 13
- Xcode Version 11.1
- SwiftEntryKit Release # 1.2.0

该提问来源于开源项目:huri000/SwiftEntryKit

I tried to build an example that would fail, and I could not reproduce the error. I looked into the source, and found that when reusing the view (and assigning label text differently), it yielded the same error.
When I recreated the view every time, it worked fine! Thanks for trying to help.



Below is the code that would yield the empty view.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 swift

import UIKit

import SwiftEntryKit



class ViewController: UIViewController {

    private var attributes: EKAttributes = .init()

    private var width: CGFloat? = nil

    private var entryA = EntryA()

     func startDemo(_ sender: UIButton) {

        startDemo()

    }



    override func viewDidLoad() {

        super.viewDidLoad()



        width = view.safeAreaWidth

    }



    private func startDemo() {

        showEntryA()

        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0, execute: {

            self.showEntryBandEnqueueA()

        })

    }



    private func showEntryA() {

        attributes = .bottomFloat

        attributes.screenBackground = .color(color: EKColor.black.with(alpha: 0.7))

        attributes.entryBackground = .color(color: .white)

        attributes.displayDuration = .infinity

        attributes.screenInteraction = .dismiss

        attributes.entryInteraction = .dismiss

        attributes.entranceAnimation = .init(translate: .init(duration: 0.3, delay: 0.2, spring: .init(damping: 0.9, initialVelocity: 0)))

        attributes.exitAnimation = .init(translate: .init(duration: 0.2), fade: .init(from: 1.0, to: 0.0, duration: 0.2))

        attributes.positionConstraints.verticalOffset = 0

        attributes.positionConstraints.size = .init(width: .constant(value: width!), height: .intrinsic)

        attributes.statusBar = .ignored

        attributes.positionConstraints.safeArea = .empty(fillSafeArea: true)



        entryA.titleLabel.text = "FIRST OPEN"

        SwiftEntryKit.display(entry: entryA, using: attributes)

    }



    private func showEntryBandEnqueueA() {

        attributes = .bottomFloat

        attributes.screenBackground = .color(color: EKColor.black.with(alpha: 0.7))

        attributes.entryBackground = .color(color: .white)

        attributes.displayDuration = .infinity

        attributes.screenInteraction = .dismiss

        attributes.entryInteraction = .dismiss

        attributes.entranceAnimation = .init(translate: .init(duration: 0.3, delay: 0.2, spring: .init(damping: 0.9, initialVelocity: 0)))

        attributes.exitAnimation = .init(translate: .init(duration: 0.2), fade: .init(from: 1.0, to: 0.0, duration: 0.2))

        attributes.positionConstraints.verticalOffset = 0

        attributes.positionConstraints.size = .init(width: .constant(value: width!), height: .intrinsic)

        attributes.statusBar = .ignored

        attributes.positionConstraints.safeArea = .empty(fillSafeArea: true)



        entryA.titleLabel.text = "SECOND OPEN" //



   



推荐阅读
  • 本文介绍了机器学习手册中关于日期和时区操作的重要性以及其在实际应用中的作用。文章以一个故事为背景,描述了学童们面对老先生的教导时的反应,以及上官如在这个过程中的表现。同时,文章也提到了顾慎为对上官如的恨意以及他们之间的矛盾源于早年的结局。最后,文章强调了日期和时区操作在机器学习中的重要性,并指出了其在实际应用中的作用和意义。 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
  • Java序列化对象传给PHP的方法及原理解析
    本文介绍了Java序列化对象传给PHP的方法及原理,包括Java对象传递的方式、序列化的方式、PHP中的序列化用法介绍、Java是否能反序列化PHP的数据、Java序列化的原理以及解决Java序列化中的问题。同时还解释了序列化的概念和作用,以及代码执行序列化所需要的权限。最后指出,序列化会将对象实例的所有字段都进行序列化,使得数据能够被表示为实例的序列化数据,但只有能够解释该格式的代码才能够确定数据的内容。 ... [详细]
  • 展开全部下面的代码是创建一个立方体Thisexamplescreatesanddisplaysasimplebox.#Thefirstlineloadstheinit_disp ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • ASP.NET2.0数据教程之十四:使用FormView的模板
    本文介绍了在ASP.NET 2.0中使用FormView控件来实现自定义的显示外观,与GridView和DetailsView不同,FormView使用模板来呈现,可以实现不规则的外观呈现。同时还介绍了TemplateField的用法和FormView与DetailsView的区别。 ... [详细]
  • Go GUIlxn/walk 学习3.菜单栏和工具栏的具体实现
    本文介绍了使用Go语言的GUI库lxn/walk实现菜单栏和工具栏的具体方法,包括消息窗口的产生、文件放置动作响应和提示框的应用。部分代码来自上一篇博客和lxn/walk官方示例。文章提供了学习GUI开发的实际案例和代码示例。 ... [详细]
  • 在Xamarin XAML语言中如何在页面级别构建ControlTemplate控件模板
    本文介绍了在Xamarin XAML语言中如何在页面级别构建ControlTemplate控件模板的方法和步骤,包括将ResourceDictionary添加到页面中以及在ResourceDictionary中实现模板的构建。通过本文的阅读,读者可以了解到在Xamarin XAML语言中构建控件模板的具体操作步骤和语法形式。 ... [详细]
  • 本文详细介绍了如何使用MySQL来显示SQL语句的执行时间,并通过MySQL Query Profiler获取CPU和内存使用量以及系统锁和表锁的时间。同时介绍了效能分析的三种方法:瓶颈分析、工作负载分析和基于比率的分析。 ... [详细]
  • IOS开发之短信发送与拨打电话的方法详解
    本文详细介绍了在IOS开发中实现短信发送和拨打电话的两种方式,一种是使用系统底层发送,虽然无法自定义短信内容和返回原应用,但是简单方便;另一种是使用第三方框架发送,需要导入MessageUI头文件,并遵守MFMessageComposeViewControllerDelegate协议,可以实现自定义短信内容和返回原应用的功能。 ... [详细]
  • 本文介绍了在MFC下利用C++和MFC的特性动态创建窗口的方法,包括继承现有的MFC类并加以改造、插入工具栏和状态栏对象的声明等。同时还提到了窗口销毁的处理方法。本文详细介绍了实现方法并给出了相关注意事项。 ... [详细]
  • JavaScript和HTML之间的交互是经由过程事宜完成的。事宜:文档或浏览器窗口中发作的一些特定的交互霎时。能够运用侦听器(或处置惩罚递次来预订事宜),以便事宜发作时实行相应的 ... [详细]
  • 全面介绍Windows内存管理机制及C++内存分配实例(四):内存映射文件
    本文旨在全面介绍Windows内存管理机制及C++内存分配实例中的内存映射文件。通过对内存映射文件的使用场合和与虚拟内存的区别进行解析,帮助读者更好地理解操作系统的内存管理机制。同时,本文还提供了相关章节的链接,方便读者深入学习Windows内存管理及C++内存分配实例的其他内容。 ... [详细]
  • Android开发实现的计时器功能示例
    本文分享了Android开发实现的计时器功能示例,包括效果图、布局和按钮的使用。通过使用Chronometer控件,可以实现计时器功能。该示例适用于Android平台,供开发者参考。 ... [详细]
author-avatar
小木马
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有