Any notable changes to this project will be documented in this file.
Issue #85
Lifecycle event willDisappear
does not get called on swipe and prompt removeal of entry.
How to set the value (not placeholder) to textfield for Forms preset? #79
To support text injection to EKTextField
, some minor changes have been done:
EKTextField
'stext
property has a setter now.TextFieldContent
'soutput
has been changed totextContent
and has a setter now.outputWrapper
- changed tocontentWrapper
.
Dismiss entries using touchesEnded
instead of touchesBegan
.
Deployment target is 9.3, not 9.0 #78
App freezes on iOS 9.3.2 when displaying an entry and there is one shown already #73
Status bar visibility using a view controller based status bar appearance
Entry can have a name. That property can be optionally set.
Also, SwiftEntryKit
is added a new method:
public class func isCurrentlyDisplaying(entryNamed name: String? = default) -> Bool
It can be used to inquire if a certain entry is currently displayed. It might prove helpful to troubleshoot some issues using it, and it also a boilerplate for future developments.
SwiftEntryKit supports applications that defines status bar behaviour that is based on the presented view controller. The related issue.
Setting the entry window is key is not the default behavior anymore. The API
public class func display(entry view: UIView, using attributes: EKAttributes, presentInsideKeyWindow: Bool = default, rollbackWindow: RollbackWindow = default)
public class func display(entry viewController: UIViewController, using attributes: EKAttributes, presentInsideKeyWindow: Bool = default, rollbackWindow: RollbackWindow = default)
Performed only when really needed
- EKNotificationMessage has broken layout #64 - Add margins to
EKNotificationMessage
.
- Animations of alert and EKRatingMessageView.
- Constraints conflict in EKRatingMessageView
Rollback window bug fix
Handled the issue Exclude keyWindow occupancy #56 by adding an additional parameter rollbackWindow
to SwiftEntryKit.display
methods.
The revised interface is as follows:
public class func display(entry view: UIView, using attributes: EKAttributes, rollbackWindow: UIWindow = default)
public class func display(entry viewController: UIViewController, using attributes: EKAttributes, rollbackWindow: UIWindow = default)
After the entry has been dismissed, SwiftEntryKit rolls back to the given window value. By default it is the application key window.
- Shadow won't work with round corners #55
- Small fix related to
EKRatingMessageView
initial presentation.
Feature request: Callback when presented and dismissed #50
- Added a
LifecycleEvents
construct toEKAttributes
. It contains the following optional callbacks: willAppear, didAppear, willDisappear, didDisappear for the currently displayed entry. - Added an optional completion handler for
SwiftEntryKit
'sdismiss
method.
Keep Background Unchanged when 2 Consecutive Entry Screen Backgrounds Match #46
Developers can now use a customized view controller as an entry. A sample has been added to the custom presets section in example project.
EKButtonBarView exposes func expand()
, it
- Alert & Notification Entries are image-less as well. The image parameter is optional, in case it has a
nil
value, the entry is generated without it. - Added
numberOfLines
toEKProperty.LabelStyle
.
EKAttributes.PositionConstraints.SafeArea.isOverriden
to EKAttributes.PositionConstraints.SafeArea.isOverridden
EKAttributes.PositionConstraints.SafeArea.overriden
to EKAttributes.PositionConstraints.SafeArea.overridden
Developers are able to transform an entry to another entry using the same attributes.
let view = UIView()
// Customize
SwiftEntryKit.transform(to: view)
Added a rating popup (See custom presets).
See also: EKRatingMessage
and EKRatingMessageView
EKPopUpMessage
can be image-less by simply setting themeImage
to nil
(or leaving its default value as is).
/** Popup theme image */
public struct ThemeImage {
/** Position of the theme image */
public enum Position {
case topToTop(offset: CGFloat)
case centerToTop(offset: CGFloat)
}
/** The content of the image */
public var image: EKProperty.ImageContent
/** The psotion of the image */
public var position: Position
}
public init(themeImage: ThemeImage? = default, title: EKProperty.LabelContent, description: EKProperty.LabelContent, button: EKProperty.ButtonContent, action: @escaping EKPopUpMessageAction)
EKAttributes.Animation.Translate
is added an anchorPosition: AnchorPosition
property:
That means that an entry can translate from the top and exit from the bottom, and vice versa.
/** Describes the anchor position */
public enum AnchorPosition {
/** Top position - the entry shows from top or exits towards the top */
case top
/** Bottom position - the entry shows from bottom or exits towards the bottom */
case bottom
/** Automatic position - the entry shows and exits according to EKAttributes.Position value. If the position of the entry is top, bottom, the entry's translation anchor is top, bottom - respectively.*/
case automatic
}
anchorPosition
is determined the direction of the translation animation and is .automatic
by default, meaning that the anchor is set automatically according to its position - if the position (EKAttributes.Position
) is .top
/ bottom
, then the entry enters and exit from the top / bottom edge.
- Instead of assigning the
UIStatusBarStyle
, useEKAttributes.StatusBar
to define the status bar. - The benefit is an absolute control over the status bar appearance.
- New statuses:
.hidden
- Hides the status bar.inferred
- Infer the style from the previous style.
Added Carthage Support
The text of the text-fields is accessible after tapping the button using EKFormMessageView
.
Use output
property inside EKProperty.TextFieldContent
.
Keyboard support can be enabled using EKAttributes.PositionConstraints.KeyboardRelation
enum.
// 10pt bottom offset from keyboard and at least 5pts from the screen edge while the keyboard is displayed.
attributes.positionConstraints.keyboardRelation = .bind(offset: .init(bottom: 10, screenEdgeResistance: 5))
Inquire if SwiftEntryKit is currently displaying an entry:
if SwiftEntryKit.isCurrentlyDisplaying {
/* Do Something */
}
EKProperty.LabelStyle
replaced EKProperty.Label
.