@@ -276,9 +276,9 @@ open class CDAlertView: UIView {
276276 public func show( _ completion: ( ( CDAlertView ) -> Void ) ? = nil ) {
277277
278278 UIApplication . shared. keyWindow? . addSubview ( self )
279- alignToParent ( with: 0 )
279+ cd_alignToParent ( with: 0 )
280280 addSubview ( backgroundView)
281- backgroundView. alignToParent ( with: 0 )
281+ backgroundView. cd_alignToParent ( with: 0 )
282282 if !isActionButtonsVertical && actions. count > 3 {
283283 debugPrint ( " CDAlertView: You can't use more than 3 actions in horizontal mode. If you need more than 3 buttons, consider using vertical alignment for buttons. Setting vertical alignments for buttons is available via isActionButtonsVertical property of AlertView " )
284284 actions. removeSubrange ( 3 ..< actions. count)
@@ -453,10 +453,10 @@ open class CDAlertView: UIView {
453453 }
454454
455455 popupView. translatesAutoresizingMaskIntoConstraints = false
456- popupView. centerHorizontally ( )
457- popupView. centerVertically ( )
458- popupView. setWidth ( popupWidth)
459- popupView. setMaxHeight ( 430 )
456+ popupView. cd_centerHorizontally ( )
457+ popupView. cd_centerVertically ( )
458+ popupView. cd_setWidth ( popupWidth)
459+ popupView. cd_setMaxHeight ( 430 )
460460 popupView. sizeToFit ( )
461461 popupView. layoutIfNeeded ( )
462462 if actions. count == 0 {
@@ -476,10 +476,10 @@ open class CDAlertView: UIView {
476476 headerView. circleFillColor = circleFillColor
477477 popupView. addSubview ( headerView)
478478 headerView. translatesAutoresizingMaskIntoConstraints = false
479- headerView. alignTopToParent ( with: 0 )
480- headerView. alignLeftToParent ( with: 0 )
481- headerView. alignRightToParent ( with: 0 )
482- headerView. setHeight ( constants. headerHeight)
479+ headerView. cd_alignTopToParent ( with: 0 )
480+ headerView. cd_alignLeftToParent ( with: 0 )
481+ headerView. cd_alignRightToParent ( with: 0 )
482+ headerView. cd_setHeight ( constants. headerHeight)
483483 }
484484
485485 private func createButtonContainer( ) {
@@ -500,57 +500,57 @@ open class CDAlertView: UIView {
500500 buttonView. layer. mask = roundLayer
501501 popupView. addSubview ( buttonView)
502502 buttonView. translatesAutoresizingMaskIntoConstraints = false
503- buttonView. alignBottomToParent ( with: 0 )
504- buttonView. alignLeftToParent ( with: 0 )
505- buttonView. alignRightToParent ( with: 0 )
503+ buttonView. cd_alignBottomToParent ( with: 0 )
504+ buttonView. cd_alignLeftToParent ( with: 0 )
505+ buttonView. cd_alignRightToParent ( with: 0 )
506506 if actions. count == 0 {
507- buttonView. setHeight ( 0 )
507+ buttonView. cd_setHeight ( 0 )
508508 } else {
509509
510510 let backgroundColoredView = UIView ( frame: . zero)
511511 backgroundColoredView. backgroundColor = actionSeparatorColor
512512 buttonView. addSubview ( backgroundColoredView)
513- backgroundColoredView. alignToParent ( with: 0 )
513+ backgroundColoredView. cd_alignToParent ( with: 0 )
514514
515515 buttonContainer. spacing = constants. separatorThickness
516516 if isActionButtonsVertical {
517517 buttonContainer. axis = . vertical
518518 } else {
519519 buttonContainer. axis = . horizontal
520520 }
521- buttonView. setHeight ( height)
521+ buttonView. cd_setHeight ( height)
522522 buttonContainer. translatesAutoresizingMaskIntoConstraints = false
523523 backgroundColoredView. addSubview ( buttonContainer)
524- buttonContainer. alignTopToParent ( with: constants. separatorThickness)
525- buttonContainer. alignBottomToParent ( with: 0 )
526- buttonContainer. alignLeftToParent ( with: 0 )
527- buttonContainer. alignRightToParent ( with: 0 )
524+ buttonContainer. cd_alignTopToParent ( with: constants. separatorThickness)
525+ buttonContainer. cd_alignBottomToParent ( with: 0 )
526+ buttonContainer. cd_alignLeftToParent ( with: 0 )
527+ buttonContainer. cd_alignRightToParent ( with: 0 )
528528 }
529529 }
530530
531531 private func createStackView( ) {
532532 coverView. backgroundColor = alertBackgroundColor
533533 popupView. addSubview ( coverView)
534534 coverView. translatesAutoresizingMaskIntoConstraints = false
535- coverView. alignLeftToParent ( with: 0 )
536- coverView. alignRightToParent ( with: 0 )
537- coverView. place ( below: headerView, margin: 0 )
538- coverView. place ( above: buttonView, margin: 0 )
535+ coverView. cd_alignLeftToParent ( with: 0 )
536+ coverView. cd_alignRightToParent ( with: 0 )
537+ coverView. cd_place ( below: headerView, margin: 0 )
538+ coverView. cd_place ( above: buttonView, margin: 0 )
539539 contentStackView. distribution = . equalSpacing
540540 contentStackView. axis = . vertical
541541 contentStackView. spacing = 8
542542 coverView. addSubview ( contentStackView)
543543 contentStackView. translatesAutoresizingMaskIntoConstraints = false
544- contentStackView. alignTopToParent ( with: 0 )
545- contentStackView. alignBottomToParent ( with: 16 )
546- contentStackView. alignRightToParent ( with: 16 )
547- contentStackView. alignLeftToParent ( with: 16 )
544+ contentStackView. cd_alignTopToParent ( with: 0 )
545+ contentStackView. cd_alignBottomToParent ( with: 16 )
546+ contentStackView. cd_alignRightToParent ( with: 16 )
547+ contentStackView. cd_alignLeftToParent ( with: 16 )
548548 }
549549
550550 private func createTitleLabel( ) {
551551 titleLabel. numberOfLines = 0
552552 titleLabel. textAlignment = . center
553- titleLabel. setMaxHeight ( 100 )
553+ titleLabel. cd_setMaxHeight ( 100 )
554554 titleLabel. textColor = titleTextColor
555555 titleLabel. font = titleFont
556556 contentStackView. addArrangedSubview ( titleLabel)
@@ -560,7 +560,7 @@ open class CDAlertView: UIView {
560560 messageLabel. numberOfLines = 0
561561 messageLabel. textAlignment = . center
562562 messageLabel. textColor = messageTextColor
563- messageLabel. setMaxHeight ( 290 )
563+ messageLabel. cd_setMaxHeight ( 290 )
564564 messageLabel. font = messageFont
565565 contentStackView. addArrangedSubview ( messageLabel)
566566 }
@@ -585,7 +585,7 @@ open class CDAlertView: UIView {
585585 textField. isHidden = isTextFieldHidden
586586 textField. placeholder = textFieldPlaceholderText
587587 textField. autocapitalizationType = textFieldAutocapitalizationType
588- textField. setHeight ( textFieldHeight)
588+ textField. cd_setHeight ( textFieldHeight)
589589 contentStackView. addArrangedSubview ( textField)
590590 }
591591
@@ -614,12 +614,12 @@ open class CDAlertView: UIView {
614614 buttonContainer. addArrangedSubview ( button)
615615 button. translatesAutoresizingMaskIntoConstraints = false
616616 if isActionButtonsVertical {
617- button. setWidth ( buttonContainer. frame. size. width)
617+ button. cd_setWidth ( buttonContainer. frame. size. width)
618618 } else {
619- button. setWidth ( ( buttonContainer. frame. size. width- CGFloat( actions. count- 1 ) * constants. separatorThickness) / CGFloat( actions. count) )
619+ button. cd_setWidth ( ( buttonContainer. frame. size. width- CGFloat( actions. count- 1 ) * constants. separatorThickness) / CGFloat( actions. count) )
620620 }
621621
622- button. setHeight ( CGFloat ( buttonsHeight) )
622+ button. cd_setHeight ( CGFloat ( buttonsHeight) )
623623 }
624624 }
625625}
0 commit comments