From dfef8801dc2ec25c2644b8785e08c67ce26d63dd Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 18:06:05 +0600 Subject: [PATCH 1/7] Add dark mode support --- RNAlertController.xcodeproj/project.pbxproj | 4 +- .../xcschemes/RNAlertController.xcscheme | 24 +++++------ .../RNAlertControllerExample.xcscheme | 24 +++++------ .../xcschemes/RNAlertControllerTests.xcscheme | 6 +-- .../Storyboards/Base.lproj/Main.storyboard | 8 ++-- Source/Extensions/UIColor+Extra.swift | 12 +++++- Source/RNAlertController.swift | 40 ++++++++++++------- Source/Views/AlertActionButton.swift | 38 +++++++++++++++++- Source/Views/AlertContainerView.swift | 8 +++- Source/Views/AlertLabel.swift | 7 +++- 10 files changed, 111 insertions(+), 60 deletions(-) diff --git a/RNAlertController.xcodeproj/project.pbxproj b/RNAlertController.xcodeproj/project.pbxproj index a527ff8..74202d0 100644 --- a/RNAlertController.xcodeproj/project.pbxproj +++ b/RNAlertController.xcodeproj/project.pbxproj @@ -331,7 +331,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1030; - LastUpgradeCheck = 1030; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = "Rayhan Nabi"; TargetAttributes = { E8508674231E5F2100F0D6B3 = { @@ -563,6 +563,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -627,6 +628,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; diff --git a/RNAlertController.xcodeproj/xcshareddata/xcschemes/RNAlertController.xcscheme b/RNAlertController.xcodeproj/xcshareddata/xcschemes/RNAlertController.xcscheme index de3422f..f4c3587 100644 --- a/RNAlertController.xcodeproj/xcshareddata/xcschemes/RNAlertController.xcscheme +++ b/RNAlertController.xcodeproj/xcshareddata/xcschemes/RNAlertController.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - - - - - - - - - + + - + diff --git a/Source/Extensions/UIColor+Extra.swift b/Source/Extensions/UIColor+Extra.swift index a87219c..78cad4b 100644 --- a/Source/Extensions/UIColor+Extra.swift +++ b/Source/Extensions/UIColor+Extra.swift @@ -18,12 +18,20 @@ extension UIColor { return UIColor(red: 255/255, green: 59/255, blue: 48/255, alpha: 1.0) } - static var defaultBackground: UIColor { + static var defaultLightBackground: UIColor { return UIColor(white: 1, alpha: 0.75) } - static var highlightedBackground: UIColor { + static var defaultDarkBackground: UIColor { + return UIColor(white: 0, alpha: 0.75) + } + + static var highlightedLightBackground: UIColor { return UIColor(white: 1, alpha: 0.35) } + static var highlightedDarkBackground: UIColor { + return UIColor(white: 0, alpha: 0.35) + } + } diff --git a/Source/RNAlertController.swift b/Source/RNAlertController.swift index acbe8ae..3a7e320 100644 --- a/Source/RNAlertController.swift +++ b/Source/RNAlertController.swift @@ -19,10 +19,11 @@ import UIKit var pickerAction : AlertPickerAction? var selectedPickerRow : Int? var alertURL : AlertURL? - var alertWindow : UIWindow? - var originalWindow : UIWindow? - private var container : UIVisualEffectView! + private var alertWindow : UIWindow? + private var originalWindow : UIWindow? + private var container : UIVisualEffectView! + private var alertBodyBackground : UIView! private override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) @@ -66,6 +67,13 @@ import UIKit alertWindow = nil } + public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + alertBodyBackground.backgroundColor = alertBodyBackground.isDarkInterfaceStyle ? + UIColor.defaultDarkBackground : + UIColor.defaultLightBackground + } + } // MARK: - Presentation methods @@ -196,30 +204,32 @@ private extension RNAlertController { ] ) - let background = UIView(frame: .zero) - background.backgroundColor = .defaultBackground - background.translatesAutoresizingMaskIntoConstraints = false + alertBodyBackground = UIView(frame: .zero) + alertBodyBackground.backgroundColor = alertBodyBackground.isDarkInterfaceStyle ? + UIColor.defaultDarkBackground : + UIColor.defaultLightBackground + alertBodyBackground.translatesAutoresizingMaskIntoConstraints = false let alertStack = createAlertStackView() - background.addSubview(alertStack) + alertBodyBackground.addSubview(alertStack) NSLayoutConstraint.activate([ - alertStack.topAnchor.constraint(equalTo: background.topAnchor, constant: 20), - alertStack.centerXAnchor.constraint(equalTo: background.centerXAnchor), - alertStack.widthAnchor.constraint(equalTo: background.widthAnchor, multiplier: 0.85) + alertStack.topAnchor.constraint(equalTo: alertBodyBackground.topAnchor, constant: 20), + alertStack.centerXAnchor.constraint(equalTo: alertBodyBackground.centerXAnchor), + alertStack.widthAnchor.constraint(equalTo: alertBodyBackground.widthAnchor, multiplier: 0.85) ] ) let extraStack = createExtraStackView() - background.addSubview(extraStack) + alertBodyBackground.addSubview(extraStack) NSLayoutConstraint.activate([ extraStack.topAnchor.constraint(equalTo: alertStack.bottomAnchor, constant: 8), - extraStack.centerXAnchor.constraint(equalTo: background.centerXAnchor), - extraStack.widthAnchor.constraint(equalTo: background.widthAnchor, multiplier: 0.85), - extraStack.bottomAnchor.constraint(equalTo: background.bottomAnchor, constant: -12) + extraStack.centerXAnchor.constraint(equalTo: alertBodyBackground.centerXAnchor), + extraStack.widthAnchor.constraint(equalTo: alertBodyBackground.widthAnchor, multiplier: 0.85), + extraStack.bottomAnchor.constraint(equalTo: alertBodyBackground.bottomAnchor, constant: -12) ] ) - alertBody.addArrangedSubview(background) + alertBody.addArrangedSubview(alertBodyBackground) if let buttons = buttons, buttons.count > 0 { let buttonStack = AlertButtonStackView(alertButtons: buttons) alertBody.addArrangedSubview(buttonStack) diff --git a/Source/Views/AlertActionButton.swift b/Source/Views/AlertActionButton.swift index 9553ec0..64291fd 100644 --- a/Source/Views/AlertActionButton.swift +++ b/Source/Views/AlertActionButton.swift @@ -12,13 +12,13 @@ class AlertActionButton: UIButton { override open var isHighlighted: Bool { didSet { - backgroundColor = isHighlighted ? UIColor.highlightedBackground : UIColor.defaultBackground + setHighlightedColor() } } convenience init() { self.init(type: .custom) - backgroundColor = UIColor.defaultBackground + backgroundColor = UIColor.defaultLightBackground NSLayoutConstraint.activate([ heightAnchor.constraint(equalToConstant: 44) ] @@ -31,6 +31,12 @@ class AlertActionButton: UIButton { setAttributedTitle(attributedTitle, for: .normal) } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + setBackgroundColor() + setHighlightedColor() + } + private func createAttributes(for type: AlertButtonType) -> [NSAttributedString.Key: Any] { var attributes = [NSAttributedString.Key: Any]() switch type { @@ -47,4 +53,32 @@ class AlertActionButton: UIButton { return attributes } + private func setBackgroundColor() { + backgroundColor = isDarkInterfaceStyle ? UIColor.defaultDarkBackground : UIColor.defaultLightBackground + } + + private func setHighlightedColor() { + if isHighlighted { + backgroundColor = isDarkInterfaceStyle ? + UIColor.highlightedDarkBackground : + UIColor.highlightedLightBackground + } else { + backgroundColor = isDarkInterfaceStyle ? + UIColor.defaultDarkBackground : + UIColor.defaultLightBackground + } + } + +} + +extension UIView { + + var isDarkInterfaceStyle: Bool { + if #available(iOS 12.0, *) { + return traitCollection.userInterfaceStyle == .dark + } else { + return false + } + } + } diff --git a/Source/Views/AlertContainerView.swift b/Source/Views/AlertContainerView.swift index 81ac01a..75133c8 100644 --- a/Source/Views/AlertContainerView.swift +++ b/Source/Views/AlertContainerView.swift @@ -23,7 +23,13 @@ class AlertContainerView: UIVisualEffectView { } convenience init() { - self.init(effect: UIBlurEffect(style: .light)) + self.init(effect: nil) + effect = UIBlurEffect(style: isDarkInterfaceStyle ? .dark : .light) + } + + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + effect = UIBlurEffect(style: isDarkInterfaceStyle ? .dark : .light) } } diff --git a/Source/Views/AlertLabel.swift b/Source/Views/AlertLabel.swift index 8825cd0..720ca60 100644 --- a/Source/Views/AlertLabel.swift +++ b/Source/Views/AlertLabel.swift @@ -18,7 +18,7 @@ class AlertLabel: UILabel { override init(frame: CGRect) { super.init(frame: frame) translatesAutoresizingMaskIntoConstraints = false - textColor = UIColor.black + textColor = isDarkInterfaceStyle ? UIColor.white : UIColor.black textAlignment = .center numberOfLines = 0 } @@ -39,6 +39,11 @@ class AlertLabel: UILabel { setFont(for: type) } + override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { + super.traitCollectionDidChange(previousTraitCollection) + textColor = isDarkInterfaceStyle ? UIColor.white : UIColor.black + } + private func setFont(for type: AlertLabelType) { switch type { case .title: From d94615ee4ee74fe1a272481c2f53072043c2e25b Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 18:07:44 +0600 Subject: [PATCH 2/7] Add UIView extension for dark appearance --- RNAlertController.xcodeproj/project.pbxproj | 4 ++++ Source/Extensions/UIView+Appearance.swift | 21 +++++++++++++++++++++ Source/Views/AlertActionButton.swift | 12 ------------ 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 Source/Extensions/UIView+Appearance.swift diff --git a/RNAlertController.xcodeproj/project.pbxproj b/RNAlertController.xcodeproj/project.pbxproj index 74202d0..8acdb3a 100644 --- a/RNAlertController.xcodeproj/project.pbxproj +++ b/RNAlertController.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ E8ECFAE422772EFC00D4BA3F /* AlertButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8ECFADC22772EFB00D4BA3F /* AlertButton.swift */; }; E8ECFAE622772EFC00D4BA3F /* AlertButtonStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8ECFADE22772EFB00D4BA3F /* AlertButtonStackView.swift */; }; E8ECFAE722772EFC00D4BA3F /* RNAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8ECFADF22772EFB00D4BA3F /* RNAlertController.swift */; }; + E8F6B2E9233E32E0006A03F4 /* UIView+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8F6B2E8233E32E0006A03F4 /* UIView+Appearance.swift */; }; E8FEEE242310409200A155E2 /* AlertActionButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8FEEE232310409200A155E2 /* AlertActionButton.swift */; }; E8FEEE2623104A9F00A155E2 /* UIColor+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8FEEE2523104A9F00A155E2 /* UIColor+Extra.swift */; }; E8FF167F2282B48C00CC8807 /* RNAlertController+API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8FF167E2282B48C00CC8807 /* RNAlertController+API.swift */; }; @@ -104,6 +105,7 @@ E8ECFADC22772EFB00D4BA3F /* AlertButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertButton.swift; sourceTree = ""; }; E8ECFADE22772EFB00D4BA3F /* AlertButtonStackView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlertButtonStackView.swift; sourceTree = ""; }; E8ECFADF22772EFB00D4BA3F /* RNAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RNAlertController.swift; sourceTree = ""; }; + E8F6B2E8233E32E0006A03F4 /* UIView+Appearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Appearance.swift"; sourceTree = ""; }; E8FEEE232310409200A155E2 /* AlertActionButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertActionButton.swift; sourceTree = ""; }; E8FEEE2523104A9F00A155E2 /* UIColor+Extra.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+Extra.swift"; sourceTree = ""; }; E8FF167E2282B48C00CC8807 /* RNAlertController+API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RNAlertController+API.swift"; sourceTree = ""; }; @@ -142,6 +144,7 @@ E8ECFAD922772EFB00D4BA3F /* UIButton+Action.swift */, E8FEEE2523104A9F00A155E2 /* UIColor+Extra.swift */, E8ECFADA22772EFB00D4BA3F /* UIFont+Extra.swift */, + E8F6B2E8233E32E0006A03F4 /* UIView+Appearance.swift */, ); path = Extensions; sourceTree = ""; @@ -433,6 +436,7 @@ E8CE528F227B07D200466CAF /* AlertImageView.swift in Sources */, E8FEEE242310409200A155E2 /* AlertActionButton.swift in Sources */, E8CE5291227B092400466CAF /* AlertStackView.swift in Sources */, + E8F6B2E9233E32E0006A03F4 /* UIView+Appearance.swift in Sources */, E8ECFAE322772EFC00D4BA3F /* AlertLabel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Source/Extensions/UIView+Appearance.swift b/Source/Extensions/UIView+Appearance.swift new file mode 100644 index 0000000..488cde3 --- /dev/null +++ b/Source/Extensions/UIView+Appearance.swift @@ -0,0 +1,21 @@ +// +// UIView+Appearance.swift +// RNAlertController +// +// Created by Rayhan Nabi on 9/27/19. +// Copyright © 2019 Rayhan Nabi. All rights reserved. +// + +import Foundation + +extension UIView { + + var isDarkInterfaceStyle: Bool { + if #available(iOS 12.0, *) { + return traitCollection.userInterfaceStyle == .dark + } else { + return false + } + } + +} diff --git a/Source/Views/AlertActionButton.swift b/Source/Views/AlertActionButton.swift index 64291fd..a1aa378 100644 --- a/Source/Views/AlertActionButton.swift +++ b/Source/Views/AlertActionButton.swift @@ -70,15 +70,3 @@ class AlertActionButton: UIButton { } } - -extension UIView { - - var isDarkInterfaceStyle: Bool { - if #available(iOS 12.0, *) { - return traitCollection.userInterfaceStyle == .dark - } else { - return false - } - } - -} From 02295cd7afd2973fa52c22633268709425f5158c Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 18:38:09 +0600 Subject: [PATCH 3/7] Updated colors, font sizes etc --- Source/Extensions/UIColor+Extra.swift | 4 ++-- Source/Extensions/UIFont+Extra.swift | 2 +- Source/RNAlertController.swift | 5 ++--- Source/Views/AlertContainerView.swift | 1 + Source/Views/AlertStackView.swift | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Extensions/UIColor+Extra.swift b/Source/Extensions/UIColor+Extra.swift index 78cad4b..1d6c1d5 100644 --- a/Source/Extensions/UIColor+Extra.swift +++ b/Source/Extensions/UIColor+Extra.swift @@ -23,7 +23,7 @@ extension UIColor { } static var defaultDarkBackground: UIColor { - return UIColor(white: 0, alpha: 0.75) + return UIColor(white: 0, alpha: 0.40) } static var highlightedLightBackground: UIColor { @@ -31,7 +31,7 @@ extension UIColor { } static var highlightedDarkBackground: UIColor { - return UIColor(white: 0, alpha: 0.35) + return UIColor(white: 0, alpha: 0.0) } } diff --git a/Source/Extensions/UIFont+Extra.swift b/Source/Extensions/UIFont+Extra.swift index 139a5cb..8273d37 100644 --- a/Source/Extensions/UIFont+Extra.swift +++ b/Source/Extensions/UIFont+Extra.swift @@ -11,7 +11,7 @@ import UIKit extension UIFont { class var alertTitleFont: UIFont { - return self.systemFont(ofSize: 18, weight: .semibold) + return self.systemFont(ofSize: 18, weight: .bold) } class var alertMessageFont: UIFont { diff --git a/Source/RNAlertController.swift b/Source/RNAlertController.swift index 3a7e320..4aa94f8 100644 --- a/Source/RNAlertController.swift +++ b/Source/RNAlertController.swift @@ -100,15 +100,14 @@ private extension RNAlertController { func createAlertContainer() { container = AlertContainerView() - container.layer.opacity = 0.0 view.addSubview(container) var containerWidth: CGFloat = 0.0 let screenWidth = UIScreen.main.bounds.width let screenHeight = UIScreen.main.bounds.height if screenWidth < screenHeight { - containerWidth = screenWidth * 0.7 + containerWidth = screenWidth * 0.725 } else { - containerWidth = screenHeight * 0.7 + containerWidth = screenHeight * 0.725 } NSLayoutConstraint.activate([ container.centerXAnchor.constraint(equalTo: view.centerXAnchor), diff --git a/Source/Views/AlertContainerView.swift b/Source/Views/AlertContainerView.swift index 75133c8..7c24b40 100644 --- a/Source/Views/AlertContainerView.swift +++ b/Source/Views/AlertContainerView.swift @@ -14,6 +14,7 @@ class AlertContainerView: UIVisualEffectView { super.init(effect: effect) translatesAutoresizingMaskIntoConstraints = false autoresizingMask = [.flexibleHeight] + layer.opacity = 0.0 layer.cornerRadius = 10 clipsToBounds = true } diff --git a/Source/Views/AlertStackView.swift b/Source/Views/AlertStackView.swift index 94c116b..5a60494 100644 --- a/Source/Views/AlertStackView.swift +++ b/Source/Views/AlertStackView.swift @@ -16,7 +16,7 @@ class AlertStackView: UIStackView { axis = .vertical alignment = .fill distribution = .fill - spacing = 8 + spacing = 12 } required init(coder: NSCoder) { From f395c2ebff0142260279044a9874980007ce4f90 Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 18:44:04 +0600 Subject: [PATCH 4/7] Minor refactoring --- Source/Views/AlertActionButton.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Views/AlertActionButton.swift b/Source/Views/AlertActionButton.swift index a1aa378..68d9819 100644 --- a/Source/Views/AlertActionButton.swift +++ b/Source/Views/AlertActionButton.swift @@ -18,11 +18,8 @@ class AlertActionButton: UIButton { convenience init() { self.init(type: .custom) - backgroundColor = UIColor.defaultLightBackground - NSLayoutConstraint.activate([ - heightAnchor.constraint(equalToConstant: 44) - ] - ) + setBackgroundColor() + setConstraint() } func setTitle(_ title: String, for type: AlertButtonType) { @@ -53,6 +50,13 @@ class AlertActionButton: UIButton { return attributes } + private func setConstraint() { + NSLayoutConstraint.activate([ + heightAnchor.constraint(equalToConstant: 44) + ] + ) + } + private func setBackgroundColor() { backgroundColor = isDarkInterfaceStyle ? UIColor.defaultDarkBackground : UIColor.defaultLightBackground } From e1994567366f47a8e93cc07c1f10aac4e2ae9ccd Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 19:07:55 +0600 Subject: [PATCH 5/7] Minor Refactoring --- Source/RNAlertController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/RNAlertController.swift b/Source/RNAlertController.swift index 4aa94f8..b267abe 100644 --- a/Source/RNAlertController.swift +++ b/Source/RNAlertController.swift @@ -22,7 +22,7 @@ import UIKit private var alertWindow : UIWindow? private var originalWindow : UIWindow? - private var container : UIVisualEffectView! + private var container : AlertContainerView! private var alertBodyBackground : UIView! private override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { From 7bf0d8760d769c53e660bdfdda4167259ec4a907 Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 19:59:05 +0600 Subject: [PATCH 6/7] Version Bump --- RNAlertController.xcodeproj/project.pbxproj | 45 +++++++++++++++++++++ RNAlertControllerExample/Info.plist | 2 +- Source/Info.plist | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/RNAlertController.xcodeproj/project.pbxproj b/RNAlertController.xcodeproj/project.pbxproj index 8acdb3a..635f650 100644 --- a/RNAlertController.xcodeproj/project.pbxproj +++ b/RNAlertController.xcodeproj/project.pbxproj @@ -298,6 +298,7 @@ E8508697231E647600F0D6B3 /* Frameworks */, E8508698231E647600F0D6B3 /* Resources */, E85086C4231E656C00F0D6B3 /* Embed Frameworks */, + E8F6B2EB233E4C8F006A03F4 /* ShellScript */, ); buildRules = ( ); @@ -317,6 +318,7 @@ E8ECFAC722772ED000D4BA3F /* Sources */, E8ECFAC822772ED000D4BA3F /* Frameworks */, E8ECFAC922772ED000D4BA3F /* Resources */, + E8F6B2EA233E4C77006A03F4 /* ShellScript */, ); buildRules = ( ); @@ -398,6 +400,43 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + E8F6B2EA233E4C77006A03F4 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${INFOPLIST_FILE}\"\n"; + }; + E8F6B2EB233E4C8F006A03F4 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "buildNumber=$(/usr/libexec/PlistBuddy -c \"Print CFBundleVersion\" \"${INFOPLIST_FILE}\")\nbuildNumber=$(($buildNumber + 1))\n/usr/libexec/PlistBuddy -c \"Set :CFBundleVersion $buildNumber\" \"${INFOPLIST_FILE}\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ E8508671231E5F2100F0D6B3 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -536,6 +575,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 0.6.6; PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertControllerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -556,6 +596,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 0.6.6; PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertControllerExample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -694,6 +735,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1001; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PCH85ZHVFN; DYLIB_COMPATIBILITY_VERSION = 1; @@ -707,6 +749,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 0.6.6; PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertController; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -724,6 +767,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1001; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = PCH85ZHVFN; DYLIB_COMPATIBILITY_VERSION = 1; @@ -737,6 +781,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); + MARKETING_VERSION = 0.6.6; PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertController; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/RNAlertControllerExample/Info.plist b/RNAlertControllerExample/Info.plist index 2af0b22..45ea4bf 100644 --- a/RNAlertControllerExample/Info.plist +++ b/RNAlertControllerExample/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.6.5 + $(MARKETING_VERSION) CFBundleVersion 675 LSRequiresIPhoneOS diff --git a/Source/Info.plist b/Source/Info.plist index 410e4f2..82790df 100644 --- a/Source/Info.plist +++ b/Source/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.6.5 + $(MARKETING_VERSION) CFBundleVersion $(CURRENT_PROJECT_VERSION) From c5b59ab48c39f230f067c6e0b47c8d98df1cd55f Mon Sep 17 00:00:00 2001 From: Rayhan Nabi Date: Fri, 27 Sep 2019 20:05:08 +0600 Subject: [PATCH 7/7] Podspec version bump, Updated README --- README.md | 5 +++-- RNAlertController.podspec | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 168839c..a0f56dd 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ An easy-to-use alert framework for iOS written purely in Swift. With native look ## Features +* iOS 13 compatible, supports Dark Mode. * Title * Description message * Banner image below the description message @@ -23,8 +24,8 @@ An easy-to-use alert framework for iOS written purely in Swift. With native look ## Requirements * iOS 9.0+ -* Xcode 10+ -* Swift 5 +* Xcode 11.0+ +* Swift 5.0 * Objective-C 2.0 (ARC required) ## Installation diff --git a/RNAlertController.podspec b/RNAlertController.podspec index 2d7cfe0..4c43cef 100644 --- a/RNAlertController.podspec +++ b/RNAlertController.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = "RNAlertController" - spec.version = "0.6.5" + spec.version = "0.6.6.beta.1" spec.summary = "Custom Alert Framework for iOS" spec.description = <<-DESC