Any notable changes to this project will be documented in this file.
- Embed QuickLayout's source files within SwiftEntryKit
- #324 - iOS 14.2 keyWindow is always EKWindow
- #277 - EKContentView.panGestureRecognized(gr:) crash
Setting key window correctly: See #308 and #309.
- Remove scene from window: #299
- Added size option for EKRatingSymbolsContainerView: #266
- Access the foreground active window using connectedScenes: #257
- Fix CI: #300
Fix #253 - force unwrap for EKMessageContentView
's subtitleContent
when nil
is provided.
Expose EKWindow
publicly as UIWindow
.
Add a warning for misuse of EKAttributes.PopBehavior
.
Adjustment for iOS projects are are using SwiftUI
as their default setup in their plist
.
Fixes: #231 (iPad + iOS13) entries background is not interactable.
Fix SPM
release
Fix: EKTextField
crashes once no tintColor
is provided.
iOS 13 color fix
Fully support dark mode pre iOS 13. New requirments were introduced:
UIColor
was replaced withEKColor
to allow specifying colors for light and dark modes.UIBlurEffect.Style
was replacd withEKAttributes.BackgroundStyle.BlurStyle
to allow specifying visual effects for light and dark modes.EKAttributes
contains a new attribute nameddisplayMode: DisplayMode
.displayMode
has the default value.inferred
, which means that the display mode will be inferred from the user interface style. If the running iOS version is lower than 13, the display mode will be inferred as light mode.- All the presets support the new display mode by allowing to specify
displayMode
for theirEKProperty
The list of EKProperty
constructs that contain displayMode
:
ButtonContent
- button descriptorLabelStyle
- label style descriptorImageContent
- image view descriptorTextFieldContent
- text field descriptorButtonBarContent
- button bar descriptor
The project coding style was revamped to be more friendly and readable.
- #191 - customized components support accessibility.
- #187 - ButtonBarContent` initialized with multiple buttons received as either variadic parameter or array.
Issue #171 - Unable to dismiss a ViewControllerEntry in Xcode 10.2 (work in Xcode 10.1).
Diagnosis:
Only on Xcode 10.2. Probably be a Swift compiler bug.
Reproduced using Release configuration.
The compiler mistreats UserInteraction.isResponsive
thus it always returns false
when used on attributes.screenInteraction
.
Swift 5 / Xcode 10.2 compatible.
Issue #155 - Setting textfield cursor color for EKProperty.TextFieldContent.
TextFieldContent
receives tintColor
from now on.
Issue #160 - Animation with sequence of images
From now on developers are able to sequence-animate and transform-animate every image within the presets using one of the designated public initializers available for EKProperty.ImageContent
.
Issue #109 - StatusBar appareance when moving to another UIViewController. Added another tatus bar type - .ignored
. Using this ignores the status bar when the entry enters/exits the screen.
Issue #143 - Orientation incorrect when set to .portraitUpsideDown on iPhone.
Changed isRotationEnabled
to Rotation
structure.
/** Rotation related position constraints */
public struct Rotation {
/** Attributes of supported interface orientations */
public enum SupportedInterfaceOrientation {
/** Uses standard supported interface orientation (target specification in general settings) */
case standard
/** Supports all orinetations */
case all
}
/** Autorotate the entry along with the device orientation */
public var isEnabled: Bool
/** The screen autorotates with accordance to this option */
public var supportedInterfaceOrientations: SwiftEntryKit.EKAttributes.PositionConstraints.Rotation.SupportedInterfaceOrientation
}
EKProperty.ButtonBarContent
supports an upper horizontal threshold for its button distribution.
EKProperty.ButtonBarContent
has an Int
property named horizontalDistributionThreshold
. It must be positive.
Issue #117 - Round buttons in alert.
Issue #121 - Long title for alert buttons.
Issue #131 - EKAttributes.PositionConstraints
initializer parameter isn't referenced in implementation.
Issue #132 - Background dimmed view is NOT animating.
Issue #119 - Entry tap gesture doesn't cancel touches inside the entry view.
Apply a necessary fix for Xcode 10 and older than 4.2 Swift version compatibility.
Adjustments for Swift 4.2.
Related Issue: Swift 4.2 Support #108
numberOfLines property #111 - Allow multiple lines in image notes.
Related issue: Best way to present keyboard #107.
The window must be a key window, so setting presentInsideKeyWindow
to true
is necessary to achieve that goal. Likewise:
SwiftEntryKit.display(entry: formMessageView, using: attributes, presentInsideKeyWindow: true)
It is recommended to set lifecycleEvents.didAppear
to perform the keyboard showing action. For example:
attributes.lifecycleEvents.didAppear = {
formMessageView.becomeFirstResponder(with: 0)
}
displayPriority
is no longer nested inside EKAttributes
. It has been replaced by another construct called precedence
.
precedence
defines the manner in which a new entry is treated in case there already is another displayed entry.
- See Issue #103 for feature basic requirements.
- Please review the README.md and the API documentation to gain additional information.
Be aware that 0.7.0
breaks previous releases.
In order to adjust previous usage to current behavior, just replace any instance of:
attributes.displayPriority = value
To the following:
attributes.precedence = .override(priority: value, dropEnqueuedEntries: false)
Autorotation flag for entries - pull-request
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
.