Skip to content

Commit e39ce52

Browse files
Merge pull request #50 from SimformSolutionsPvtLtd/bugfix/width_issue_landscape_mode
bugfix/width_issue_landscape_mode: Width issue fixed in landscape mode
2 parents e4df966 + 41c36ad commit e39ce52

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

SSSpinnerButton/Info.plist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
<false/>
2727
<key>UISupportedInterfaceOrientations</key>
2828
<array>
29+
<string>UIInterfaceOrientationLandscapeLeft</string>
30+
<string>UIInterfaceOrientationLandscapeRight</string>
2931
<string>UIInterfaceOrientationPortrait</string>
32+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
3033
</array>
3134
</dict>
3235
</plist>

SSSpinnerButton/SpinnerButton/SSSpinnerButton.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ open class SSSpinnerButton: UIButton {
4949
fileprivate var isAnimating: Bool = false
5050

5151
fileprivate var spinnerType: SpinnerType = Config.spinnerType
52-
53-
fileprivate var storedWidth: CGFloat?
54-
fileprivate var storedHeight: CGFloat?
55-
52+
5653
/// Sets the button corner radius
5754
@IBInspectable var cornerRadius: CGFloat = 0 {
5855
willSet {
@@ -395,9 +392,6 @@ private extension SSSpinnerButton {
395392
storedHighlightedImage = self.image(for: .highlighted)
396393

397394
storedBackgroundColor = self.backgroundColor
398-
storedWidth = frame.width
399-
storedHeight = frame.height
400-
401395
self.setImage(nil, for: .normal)
402396
self.setImage(nil, for: .disabled)
403397
self.setImage(nil, for: .selected)
@@ -509,8 +503,6 @@ private extension SSSpinnerButton {
509503
self.isUserInteractionEnabled = true
510504

511505
let animation = CABasicAnimation(keyPath: "bounds.size.width")
512-
animation.fromValue = storedHeight
513-
animation.toValue = storedWidth
514506
animation.duration = self.animationDuration
515507
animation.fillMode = CAMediaTimingFillMode.forwards
516508
animation.isRemovedOnCompletion = false

0 commit comments

Comments
 (0)