Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions DBAlertController.podspec

This file was deleted.

8 changes: 4 additions & 4 deletions DBAlertController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -233,7 +233,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand All @@ -257,7 +257,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -276,7 +276,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.dylanbettermann.DBAlertController;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 2.3;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down
16 changes: 16 additions & 0 deletions ONCEAlertController.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Pod::Spec.new do |s|
s.name = "ONCEAlertController"
s.version = "1.0.0"
s.summary = "A UIAlertController subclass that's independent of the view controller it's presented from."
s.homepage = "https://github.com/OnceApp/ONCEAlertController"
s.license = 'MIT'
s.author = { "Guillaume Sempe" => "guillaume@getonce.com" }
s.source = { :git => "https://github.com/OnceApp/ONCEAlertController.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/oncetheapp'

s.platform = :ios, '10.0'
s.swift_version = '4.1'
s.requires_arc = true

s.source_files = 'Source/*.swift'
end
20 changes: 10 additions & 10 deletions Source/DBAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import UIKit

public class DBAlertController: UIAlertController {
open class DBAlertController: UIAlertController {

/// The UIWindow that will be at the top of the window hierarchy. The DBAlertController instance is presented on the rootViewController of this window.
private lazy var alertWindow: UIWindow = {
let window = UIWindow(frame: UIScreen.mainScreen().bounds)
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = DBClearViewController()
window.backgroundColor = UIColor.clearColor()
window.backgroundColor = UIColor.clear
window.windowLevel = UIWindowLevelAlert
return window
}()
Expand All @@ -29,7 +29,7 @@ public class DBAlertController: UIAlertController {
if let rootViewController = alertWindow.rootViewController {
alertWindow.makeKeyAndVisible()

rootViewController.presentViewController(self, animated: flag, completion: completion)
rootViewController.present(self, animated: flag, completion: completion)
}
}

Expand All @@ -38,12 +38,12 @@ public class DBAlertController: UIAlertController {
// In the case of view controller-based status bar style, make sure we use the same style for our view controller
private class DBClearViewController: UIViewController {

private override func preferredStatusBarStyle() -> UIStatusBarStyle {
return UIApplication.sharedApplication().statusBarStyle
override var preferredStatusBarStyle: UIStatusBarStyle {
return UIApplication.shared.statusBarStyle
}
private override func prefersStatusBarHidden() -> Bool {
return UIApplication.sharedApplication().statusBarHidden

override var prefersStatusBarHidden: Bool {
return UIApplication.shared.isStatusBarHidden
}

}