Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suport for Xcode 10 #4

Merged
merged 9 commits into from
Sep 19, 2018
Merged
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language: swift
osx_image: xcode9.4
osx_image: xcode10
script:
- xcodebuild clean test -workspace Example/ImageAlertAction.xcworkspace -scheme ImageAlertAction-Example -destination "platform=iOS Simulator,name=iPhone X,OS=11.4" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -quiet
- xcodebuild clean test -workspace Example/ImageAlertAction.xcworkspace -scheme ImageAlertAction-Example -destination "platform=iOS Simulator,name=iPhone X,OS=12.0" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO -quiet
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.0.0

- Updated to Swift 4.2
- Added support for Xcode 10
- Added support for iOS 12

## 1.0.0 | 07-10-2018

- Initial release.
22 changes: 11 additions & 11 deletions Example/ImageAlertAction.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
TestTargetID = 607FACCF1AFB9204008FA782;
};
};
Expand Down Expand Up @@ -427,12 +427,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -480,12 +482,14 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -524,8 +528,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -539,8 +542,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -560,8 +562,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageAlertAction_Example.app/ImageAlertAction_Example";
};
name = Debug;
Expand All @@ -578,8 +579,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageAlertAction_Example.app/ImageAlertAction_Example";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Example/ImageAlertAction/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
Expand Down
8 changes: 4 additions & 4 deletions Example/ImageAlertAction/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14252.5"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -26,15 +26,15 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="txQ-Fl-528">
<rect key="frame" x="0.0" y="0.0" width="375" height="389"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle0"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<state key="normal" title="View Alert"/>
<connections>
<action selector="viewAlert:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="v4E-nh-DL4"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dFK-8F-M5k">
<rect key="frame" x="0.0" y="389" width="375" height="389"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle0"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<state key="normal" title="View Action Sheet"/>
<connections>
<action selector="viewActionSheet:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="26Q-k3-mcY"/>
Expand Down
2 changes: 1 addition & 1 deletion Example/ImageAlertAction/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ViewController: UIViewController {
present(alertController(withStyle: .actionSheet), animated: true)
}

private func alertController(withStyle style: UIAlertControllerStyle) -> UIAlertController {
private func alertController(withStyle style: UIAlertController.Style) -> UIAlertController {
let alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: style)

let settings = UIAlertAction(title: "Settings", image: #imageLiteral(resourceName: "settings"), style: .default)
Expand Down
23 changes: 14 additions & 9 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ImageAlertAction.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ImageAlertAction'
s.version = '1.0.0'
s.version = '2.0.0'
s.summary = 'Image support for UIAlertAction'
s.description = <<-DESC
ImageAlertAction adds image support to UIAlertAction.
Expand All @@ -15,7 +15,7 @@ Use this to visually convey an action's purpose.
s.social_media_url = 'https://twitter.com/basthomas'

s.ios.deployment_target = '8.0'
s.swift_version = '4.1'
s.swift_version = '4.2'

s.source_files = 'ImageAlertAction/Classes/**/*'

Expand Down
16 changes: 12 additions & 4 deletions ImageAlertAction/Classes/UIAlertAction+Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,25 @@ public extension UIAlertAction {
///
/// - parameter title: The text to use for the button title.
/// The value you specify should be localized for the user’s current language.
/// This parameter must not be nil, except in a tvOS app where a nil title may be used with [UIAlertActionStyle.cancel](https://developer.apple.com/documentation/uikit/uialertactionstyle/cancel).
/// This parameter must not be nil, except in a tvOS app where a nil title
/// may be used with [UIAlertAction.Style.cancel](https://developer.apple.com/documentation/uikit/uialertaction/style/cancel).
/// - parameter image: An image to display on the left side of the button.
/// Use this to visually convey the action's purpose.
/// - parameter style: Additional styling information to apply to the button.
/// Use the style information to convey the type of action that is performed by the button.
/// For a list of possible values, see the constants in [UIAlertActionStyle](https://developer.apple.com/documentation/uikit/uialertactionstyle).
/// For a list of possible values, see the constants in
/// [UIAlertAction.Style](https://developer.apple.com/documentation/uikit/uialertaction/style).
/// - parameter handler: A block to execute when the user selects the action.
/// This block has no return value and takes the selected action object as its only parameter.
/// This block has no return value and takes the selected action object as
/// its only parameter.
///
/// - returns: A new alert action object.
public convenience init(title: String? = nil, image: UIImage, style: UIAlertActionStyle, handler: ((UIAlertAction) -> Void)? = nil) {
public convenience init(
title: String? = nil,
image: UIImage,
style: UIAlertAction.Style,
handler: ((UIAlertAction) -> Void)? = nil
) {
self.init(title: title, style: style, handler: handler)
setValue(image, forKey: imageKey)
}
Expand Down