Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoundCorners after the latest update #59

Closed
Banck opened this issue Jun 24, 2018 · 9 comments
Closed

RoundCorners after the latest update #59

Banck opened this issue Jun 24, 2018 · 9 comments

Comments

@Banck
Copy link

Banck commented Jun 24, 2018

After the latest update my popups appears without roundCorners.

To Reproduce
Steps to reproduce the behavior:
Attribute:

  var attributes: EKAttributes
     attributes = .centerFloat
     attributes.windowLevel = .normal
     attributes.hapticFeedbackType = .success
     attributes.screenInteraction =  canBeClosed ? .dismiss : .absorbTouches
     attributes.entryInteraction = .absorbTouches
     attributes.roundCorners = .all(radius: 20)
     attributes.scroll = .enabled(swipeable: canBeClosed ? true : false, pullbackAnimation: .jolt)
     attributes.screenBackground = .color(color: UIColor(white: 0, alpha: 0.7))
     attributes.entryBackground = .color(color: UIColor(white: 0, alpha: 0.7))
     attributes.entranceAnimation = .init(scale: .init(from: 0.9, to: 1, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 0, to: 1, duration: 0.3))
     attributes.exitAnimation = .init(scale: .init(from: 1, to: 0.9, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 1, to: 0, duration: 0.3))
     attributes.displayDuration = .infinity
     attributes.border = .value(color: .black, width: 0.5)
     attributes.shadow = .active(with: .init(color: .black, opacity: 0.3, radius: 5, offset: .zero))
     attributes.positionConstraints.maxSize = .init(width: .offset(value: CGFloat(40.0.dp)), height: .intrinsic)
     attributes.positionConstraints.keyboardRelation = .bind(offset: .init(bottom: 10, screenEdgeResistance: 10))
     return attributes

  • Device: [all]
  • iOS Version: [9.0, 10.3.1, 11.4]
  • Xcode Version [9.4.1]
  • Dependency Manager Version [CocoaPods 1.5.2]
  • SwiftEntryKit Release # 0.5.0
@huri000
Copy link
Owner

huri000 commented Jun 24, 2018

Hi @Banck,
Can you fill the whole template (iOS version, Xcode, etc...)?
I tried to reproduce without a success.

@huri000
Copy link
Owner

huri000 commented Jun 24, 2018

In any case, please update to 0.5.1. There is a bug in the rollback window logic in 0.5.0.

@Banck
Copy link
Author

Banck commented Jun 24, 2018

The same issue with 0.5.1.
I haven't changed anything. The previous version was 0.4.2

@Banck
Copy link
Author

Banck commented Jun 24, 2018

Here is a xib example
Архив.zip

Call:

let alertView = TwoButtonsAlertView(title: title, subTitle: subTitle, cancelButtonTitle: cancelButtonTitle, okButtonTitle: okButtonTitle)
    alertView.cancelButtonDidTap = {
        SwiftEntryKit.dismiss(with: canceledAction)
    }
    alertView.okButtonDidTap = {
        SwiftEntryKit.dismiss(with: okAction)
    }
    
    SwiftEntryKit.display(entry: alertView, using: placeAlertAttributes(canBeClosed: canBeClosed))

@huri000
Copy link
Owner

huri000 commented Jun 24, 2018

In order to resolve this, you need to set the background-color via attributes.entryBackground.
Clear the view's backgroundColor in your xib and do instead:
attributes.entryBackground = .color(color: .white)
Let me know if that helps.

@huri000 huri000 assigned huri000 and unassigned huri000 Jun 24, 2018
@huri000
Copy link
Owner

huri000 commented Jun 24, 2018

When I really think about it, It was supposed to be like this from the beginning.
Developers shouldn't be able to customize entries halfway - You can stick to the example project presets which haven't changed by version 0.5.x and work just fine. :-)

@Banck
Copy link
Author

Banck commented Jun 25, 2018

@huri000 Hello!
Yes, if I do
attributes.entryBackground = .color(color: .white)

and set clear color of my background view in the xib it works fine! Thanks.

@Banck
Copy link
Author

Banck commented Jun 25, 2018

but it was cool and useful when we could set color of background into the xib, and not in the attribute.

@huri000
Copy link
Owner

huri000 commented Jun 25, 2018

I'm glad it works!

but it was cool and useful when we could set color of background into the xib, and not in the attribute.

In that case, one has to handle the round-corners himself by clipping to bounds and mnipulating the layer and not count on SwiftEntryKit to do so.

I consider it resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants