Skip to content

Commit

Permalink
Merge pull request #101 from rayhannabi/hotfix/version_mismatch
Browse files Browse the repository at this point in the history
Hotfix/version mismatch
  • Loading branch information
rayhannabi committed Jan 17, 2020
2 parents 3a8fa21 + be1f906 commit bd47159
Show file tree
Hide file tree
Showing 15 changed files with 440 additions and 117 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion RNAlertController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Pod::Spec.new do |spec|

spec.name = "RNAlertController"
spec.version = "0.7.1"
spec.version = "0.7.2"
spec.summary = "Customizable Alert Framework for iOS"

spec.description = <<-DESC
Expand Down
20 changes: 10 additions & 10 deletions RNAlertController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,15 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 672;
CURRENT_PROJECT_VERSION = 698;
DEVELOPMENT_TEAM = PCH85ZHVFN;
INFOPLIST_FILE = "$(SRCROOT)/RNAlertControllerExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.0;
MARKETING_VERSION = 0.7.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertControllerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -659,15 +659,15 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 672;
CURRENT_PROJECT_VERSION = 698;
DEVELOPMENT_TEAM = PCH85ZHVFN;
INFOPLIST_FILE = "$(SRCROOT)/RNAlertControllerExample/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 0.7.0;
MARKETING_VERSION = 0.7.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertControllerExample;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -806,21 +806,21 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1022;
CURRENT_PROJECT_VERSION = 1043;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = PCH85ZHVFN;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.7.0;
MARKETING_VERSION = 0.7.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertController;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -839,21 +839,21 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1022;
CURRENT_PROJECT_VERSION = 1043;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = PCH85ZHVFN;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 0.7.0;
MARKETING_VERSION = 0.7.2;
PRODUCT_BUNDLE_IDENTIFIER = com.rayhan.ios.RNAlertController;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OtherViewController: UIViewController {
range: NSRange(text.range(of: "káśmīra")!, in: text))

RNAlertController(title: "Kashmir Valley", message: nil)
.setAttributedTextForMessage(attText)
.setAttributedMessageText(attText)
.setBannerImage(UIImage(named: "crop")!, position: .beforeBody)
.setCheckboxView(title: "Remember my choice", isSelected: true, action: { isSelected in
print(isSelected)
Expand Down
53 changes: 33 additions & 20 deletions Sources/RNAlertController+API.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import UIKit

public extension RNAlertController {

// MARK: - Static Initializer

/// Initializes the alert.
/// - Parameters:
/// - title: Title for the alert.
Expand All @@ -19,21 +21,32 @@ public extension RNAlertController {
return RNAlertController(title: title, message: message)
}

/// Presents the alert on the specified view controller or a window.
// MARK: - Presentation

/// Presents the alert on the specified view controller.
///
/// Use this method to present `RNAlertController` alert on a specific view controller. Passing `nil`
/// for view controller will present the alert on a custom window.
/// Use this method to present `RNAlertController` alert on a specific view controller.
/// - Parameters:
/// - viewController: `UIViewController` where the alert is to be presented.
/// - completion: Block to run after presenting the alert.
func present(on viewController: UIViewController? = nil, completion: (() -> Void)? = nil) {
if let viewController = viewController {
presentOnViewController(viewController, completion: completion)
} else {
presentOnWindow(completion: completion)
}
func present(on viewController: UIViewController, completion: (() -> Void)? = nil) {
presentOnViewController(viewController, completion: completion)
}

/// Presents the alert on its own window.
/// - Parameter completion: Block to run after presenting the alert.
func present(_ completion: (() -> Void)? = nil) {
presentOnWindow(completion: completion)
}

/// Dismisses the alert.
/// - Parameter completion: Block to run after dismissing the alert.
func dismiss(_ completion: (() -> Void)? = nil) {
self.dismiss(animated: true, completion: completion)
}

// MARK: - Alert Components

/// Adds a button to the alert.
///
/// - Parameters:
Expand All @@ -52,16 +65,6 @@ public extension RNAlertController {
return self
}

/// Sets attributed text for the message.
///
/// When set, message text will use attributed text instead of regular text.
/// - Parameter attributedText: Attributed string to set.
@discardableResult
func setAttributedTextForMessage(_ attributedText: NSAttributedString?) -> RNAlertController {
self.attributedMessage = attributedText
return self
}

/// Adds an **OK** button to the alert.
///
/// - Parameter action: Block to run when the button is pressed (i.e. touchUpInside event).
Expand All @@ -80,9 +83,19 @@ public extension RNAlertController {
return addButton(title: "Cancel", type: .cancel, action: action)
}

/// Sets attributed text for the message.
///
/// When set, message text will use attributed text instead of regular text.
/// - Parameter attributedText: Attributed string to set.
@discardableResult
func setAttributedMessageText(_ attributedText: NSAttributedString?) -> RNAlertController {
self.attributedMessage = attributedText
return self
}

/// Sets the banner image for the alert.
///
/// Banner image is displayed under the message body.
/// Banner image is displayed under the message body or at the very top of the body.
/// Consequent calls of this method will result in replacement of previously set image.
/// - Parameters:
/// - image: image to use in the alert.
Expand Down
4 changes: 4 additions & 0 deletions Sources/RNAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import UIKit
private var alertBodyBackground : UIView!
private var container : AlertContainerView!

// MARK: - Initializer

private override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
modalPresentationStyle = .overCurrentContext
Expand All @@ -51,6 +53,8 @@ import UIKit
buttons = []
}

// MARK: - UIViewController Overrides

public override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.clear
Expand Down
Loading

0 comments on commit bd47159

Please sign in to comment.