-
Notifications
You must be signed in to change notification settings - Fork 12
* Upgraded to Swift 5 and Xcode 10.2 project settings #6
base: master
Are you sure you want to change the base?
Changes from all commits
fc835c8
4e0897c
454c629
44f1148
d701ce0
d138174
233c2c4
35a8c74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| Pod::Spec.new do |spec| | ||
| spec.name = 'MIAlertController' | ||
| spec.version = '1.3' | ||
| spec.version = '1.4' | ||
| spec.license = { :type => 'MIT', :file => 'LICENSE' } | ||
| spec.homepage = 'https://github.com/MarioIannotta/MIAlertController' | ||
| spec.homepage = 'https://github.com/Song-Street/MIAlertController' | ||
| spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } | ||
| spec.summary = 'A simple fully customizable alert controller' | ||
| spec.source = { :git => 'https://github.com/MarioIannotta/MIAlertController.git', :tag => spec.version.to_s } | ||
| spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, } | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert this too |
||
| spec.source_files = 'MIAlertController/*' | ||
| spec.ios.deployment_target = '9.0' | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ open class MIAlertController: UIViewController { | |
| public var titleLabelTextAlignment = NSTextAlignment.center | ||
|
|
||
| // Message | ||
| public var messageLabelFont = UIFont.systemFont(ofSize: 16) | ||
| public var messageLabelFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.light) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could be |
||
| public var messageLabelTextColor = UIColor.black | ||
| public var messageLabelTextAlignment = NSTextAlignment.center | ||
| public var messageVerticalSpaceFromTitle: CGFloat = 10 | ||
|
|
@@ -54,7 +54,7 @@ open class MIAlertController: UIViewController { | |
|
|
||
| public var font = UIFont.boldSystemFont(ofSize: 15) | ||
| public var textColor = UIColor.black | ||
| public var textAlignment = UIControlContentHorizontalAlignment.center | ||
| public var textAlignment = UIControl.ContentHorizontalAlignment.center | ||
| public var backgroundColor = UIColor.clear | ||
| public var buttonHeight: CGFloat = 60 | ||
| public var contentEdgeOffset = UIEdgeInsets.zero | ||
|
|
@@ -63,7 +63,7 @@ open class MIAlertController: UIViewController { | |
|
|
||
| } | ||
|
|
||
| public init(font: UIFont, textColor: UIColor, textAlignment: UIControlContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { | ||
| public init(font: UIFont, textColor: UIColor, textAlignment: UIControl.ContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { | ||
|
|
||
| self.font = font | ||
| self.textColor = textColor | ||
|
|
@@ -77,7 +77,7 @@ open class MIAlertController: UIViewController { | |
| } | ||
|
|
||
| public enum `Type` { | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't commit this kind of changes |
||
| case `default` | ||
| case destructive | ||
| case cancel | ||
|
|
@@ -91,7 +91,7 @@ open class MIAlertController: UIViewController { | |
| return Config( | ||
| font: UIFont.systemFont(ofSize: 16), | ||
| textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), | ||
| textAlignment: .center, | ||
| textAlignment: UIControl.ContentHorizontalAlignment.center, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could by just |
||
| backgroundColor: UIColor.clear, | ||
| buttonHeight: 60, | ||
| contentEdgeOffset: UIEdgeInsets.zero | ||
|
|
@@ -102,7 +102,7 @@ open class MIAlertController: UIViewController { | |
| return Config( | ||
| font: UIFont.boldSystemFont(ofSize: 16), | ||
| textColor: UIColor(red: 218/255.0, green: 75/255.0, blue: 56/255.0, alpha: 1), | ||
| textAlignment: .center, | ||
| textAlignment: UIControl.ContentHorizontalAlignment.center, | ||
| backgroundColor: UIColor.clear, | ||
| buttonHeight: 60, | ||
| contentEdgeOffset: UIEdgeInsets.zero | ||
|
|
@@ -113,7 +113,7 @@ open class MIAlertController: UIViewController { | |
| return Config( | ||
| font: UIFont.boldSystemFont(ofSize: 16), | ||
| textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), | ||
| textAlignment: .center, | ||
| textAlignment: UIControl.ContentHorizontalAlignment.center, | ||
| backgroundColor: UIColor.clear, | ||
| buttonHeight: 60, | ||
| contentEdgeOffset: UIEdgeInsets.zero | ||
|
|
@@ -142,10 +142,10 @@ open class MIAlertController: UIViewController { | |
|
|
||
| let button = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: config.buttonHeight)) | ||
|
|
||
| button.setTitle(title, for: UIControlState()) | ||
| button.setTitle(title, for: UIControl.State()) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be just |
||
| button.titleLabel?.adjustsFontSizeToFitWidth = true | ||
| button.titleLabel?.minimumScaleFactor = 0.7 | ||
| button.setTitleColor(config.textColor, for: UIControlState()) | ||
| button.setTitleColor(config.textColor, for: UIControl.State()) | ||
| button.titleLabel?.font = config.font | ||
| button.backgroundColor = config.backgroundColor | ||
| button.contentHorizontalAlignment = config.textAlignment | ||
|
|
@@ -197,7 +197,7 @@ open class MIAlertController: UIViewController { | |
| required public init?(coder aDecoder: NSCoder) { | ||
| fatalError("init(coder:) has not been implemented") | ||
| } | ||
|
|
||
| public init(title: String? = nil, message: String? = nil, buttons: [Button]? = nil, config: Config? = nil) { | ||
|
|
||
| super.init(nibName: "MIAlertController", bundle: Bundle(for: MIAlertController.self)) | ||
|
|
@@ -367,7 +367,7 @@ open class MIAlertController: UIViewController { | |
|
|
||
| // MARK: - Buttons stuff | ||
| fileprivate func createButtons(_ buttons: [Button]?) { | ||
|
|
||
| guard let buttons = buttons else { return } | ||
|
|
||
| buttonsList = [UIButton]() | ||
|
|
@@ -383,7 +383,7 @@ open class MIAlertController: UIViewController { | |
| buttonsList.append(uiButton) | ||
|
|
||
| } | ||
|
|
||
| setupButtonsUI() | ||
|
|
||
| } | ||
|
|
@@ -439,10 +439,10 @@ open class MIAlertController: UIViewController { | |
|
|
||
| @objc fileprivate func buttonTapped(_ button: UIButton) { | ||
|
|
||
| if let buttonIndex = buttonsList.index(where: { $0 == button }) { | ||
| if let buttonIndex = buttonsList.firstIndex(where: { $0 == button }) { | ||
| self.buttonTappedClosures?[buttonIndex]?() | ||
| } | ||
|
|
||
| dismiss(animated: true, completion: nil) | ||
|
|
||
| } | ||
|
|
@@ -457,7 +457,7 @@ open class MIAlertController: UIViewController { | |
| createButtons(alertButtons) | ||
|
|
||
| setupUI() | ||
|
|
||
| } | ||
|
|
||
| // MARK: - IBActions | ||
|
|
@@ -466,7 +466,7 @@ open class MIAlertController: UIViewController { | |
| dismiss(animated: true, completion: nil) | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| // MARK: - CustomTransition stuff | ||
|
|
@@ -509,7 +509,7 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro | |
|
|
||
| let presentedController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) as? MIAlertController, | ||
| let presentedControllerView = transitionContext.view(forKey: UITransitionContextViewKey.to) | ||
|
|
||
| else { return } | ||
|
|
||
| let containerView = transitionContext.containerView | ||
|
|
@@ -538,11 +538,11 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro | |
| presentedController.view.alpha = 1 | ||
| presentedController.alertBackgroundView.alpha = 1 | ||
|
|
||
| }, completion: {(completed: Bool) -> Void in | ||
| transitionContext.completeTransition(completed) | ||
| } | ||
| }, completion: {(completed: Bool) -> Void in | ||
|
|
||
| transitionContext.completeTransition(completed) | ||
|
|
||
| } | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As written before, please don't commit insubstantial changes |
||
|
|
||
| ) | ||
|
|
||
|
|
@@ -554,7 +554,7 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro | |
| let presentedControllerView = transitionContext.view(forKey: UITransitionContextViewKey.from) | ||
|
|
||
| else { return } | ||
|
|
||
| UIView.animate( | ||
|
|
||
| withDuration: transitionDuration(using: transitionContext), | ||
|
|
@@ -567,11 +567,11 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro | |
| presentedController.alertBackgroundView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) | ||
| presentedControllerView.alpha = 0 | ||
|
|
||
| }, completion: {(completed: Bool) -> Void in | ||
| transitionContext.completeTransition(completed) | ||
| } | ||
| }, completion: {(completed: Bool) -> Void in | ||
|
|
||
| transitionContext.completeTransition(completed) | ||
|
|
||
| } | ||
|
|
||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>IDEDidComputeMac32BitWarning</key> | ||
| <true/> | ||
| </dict> | ||
| </plist> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this, let's point to the master repository