Skip to content

Commit

Permalink
Merge pull request #234 from sberrevoets/swift-4
Browse files Browse the repository at this point in the history
Update to Swift 4/iOS 11
  • Loading branch information
sberrevoets authored Sep 22, 2017
2 parents 2e52802 + 8f084c5 commit 51d2585
Show file tree
Hide file tree
Showing 26 changed files with 583 additions and 902 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.1
osx_image: xcode9

before_install:
- gem install xcpretty
Expand Down
158 changes: 113 additions & 45 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# CHANGELOG

## 8.0

This release brings Swift 4 and iOS 11 compatibility. It also increases the
deployment target to iOS 9.0.

**What's New:**
- Adds a closure for handling taps in the outer (chrome) area of the alert
- Improves accessibility for alert actions
- `AlertController.add()` has been renamed to `AlertController.addAction()` for
clarity
- The `AlertBehaviors` constants are now lowercased, following Swift 3
conventions.

**Bug Fixes**:
- Fixes an issue that could lead the alert to be shown in an unsupported
orientation

### 7.1.2
**Bug Fixes**:
- Fixes a bug that could incorrectly set cancel button attributes on action
Expand All @@ -19,12 +36,14 @@

**Bug Fixes:**
- The dismissal animation looks like the system one again
- Action sheets without an explicit cancel button won't show the inferred cancel button twice anymore
- Action sheets without an explicit cancel button won't show the inferred cancel
button twice anymore
- Button labels size and truncate as expected now, instead of being cut off

### 7.0.1
**Bug Fixes:**
- Avoids an infinite loop/crash when using an action sheet without explicit cancel buttons
- Avoids an infinite loop/crash when using an action sheet without explicit
cancel buttons

# 7.0
This is a compatibility update for Swift 3.
Expand All @@ -41,13 +60,18 @@ This is a compatibility update for Swift 2.3.

## 5.1
**Bug Fixes:**
- Fixes the inability to override visual style properties in a subclass of `DefaultVisualStyle`. The `VisualStyle` protocol has been removed and the conforming class been renamed to `AlertVisualStyle`. The old class name is still available, but marked as deprecated and will be removed in the future.
- Fixes the inability to override visual style properties in a subclass of
`DefaultVisualStyle`. The `VisualStyle` protocol has been removed and the
conforming class been renamed to `AlertVisualStyle`. The old class name is
still available, but marked as deprecated and will be removed in the future.

**What's New:**
- Makes an `AlertAction`'s `handler` public.

# 5.0
5.0 is a compatibility update so the project builds in Swift 2.2 and doesn't generate warnings. It also changes the Objective-C names of the public enums, which Swift now supports.
5.0 is a compatibility update so the project builds in Swift 2.2 and
doesn't generate warnings. It also changes the Objective-C names of the public
enums, which Swift now supports.

**Bug Fixes:**
- Prioritize `textColorForAction()` over the `tintColor` of an action
Expand All @@ -67,14 +91,23 @@ This is a compatibility update for Swift 2.3.
- Implements alert behaviors such as parallax and "tap outside to dismiss"
- Action highlight colors can be changed with custom visual styles

**Changes:**
This version introduces other changes that are not compatible with previous
versions of `SDCAlertView`.
- The `automaticallyFocusFirstTextField` property is now implemented as an alert behavior
- In Objective-C, the presentation and dismissal methods are now named `presentAnimated:completion:` and `dismissAnimated:completion:` to follow Objective-C nomenclature more closely
- The title and message label fonts are removed from `VisualStyle`. To change the labels' fonts, please use `attributedTitle` and `attributedMessage` with `NSFontAttributeName` instead.
- `setShouldDismissHandler()` and `setVisualStyle()` are now properties named `shouldDismissHandler` and `visualStyle` respectively. Their functionality is unchanged.
- The convenience method `showWithTitle(_:message:actionTitle:customView:)` has been renamed to `alertWithTitle(_:message:actionTitle:customView:)` to provide more consistency with the action sheet's counterpart
**Changes:**
This version introduces other changes that are not compatible with
previous versions of `SDCAlertView`.
- The `automaticallyFocusFirstTextField` property is now implemented as an alert
behavior
- In Objective-C, the presentation and dismissal methods are now named
`presentAnimated:completion:` and `dismissAnimated:completion:` to follow
Objective-C nomenclature more closely
- The title and message label fonts are removed from `VisualStyle`. To change
the labels' fonts, please use `attributedTitle` and `attributedMessage` with
`NSFontAttributeName` instead.
- `setShouldDismissHandler()` and `setVisualStyle()` are now properties named
`shouldDismissHandler` and `visualStyle` respectively. Their functionality is
unchanged.
- The convenience method `showWithTitle(_:message:actionTitle:customView:)` has
been renamed to `alertWithTitle(_:message:actionTitle:customView:)` to provide
more consistency with the action sheet's counterpart

### 3.1.1
**Bug Fixes:**
Expand All @@ -92,9 +125,10 @@ versions of `SDCAlertView`.
**Bug Fixes:**
- Fixes a crash on iOS 8 when adding text fields to the alert

### 3.0.3
### 3.0.3
**Bug Fixes:**
- Resolves an issue that would never use the white status bar color if it was specified
- Resolves an issue that would never use the white status bar color if it was
specified

### 3.0.2
**Bug Fixes:**
Expand Down Expand Up @@ -123,12 +157,14 @@ versions of `SDCAlertView`.
### 2.5.2

**Bug Fixes:**
- Solves an accessibility-related incompatibility between `UIAlertController` and `SDCAlertController` (#105)
- Solves an accessibility-related incompatibility between `UIAlertController`
and `SDCAlertController` (#105)

### 2.5.1

**Bug Fixes:**
- Fixes a bug that would show the wrong cancel button title in a legacy alert in some cases
- Fixes a bug that would show the wrong cancel button title in a legacy alert in
some cases
- Fixes a retain cycle between `SDCAlertController` and `SDCAlertView`

### 2.5
Expand All @@ -153,10 +189,12 @@ versions of `SDCAlertView`.
### 2.4

**Bug Fixes:**
- Fixes an issue that would prevent legacy alerts from calling the `shouldDismissHandler` (#90)
- Fixes an issue that would prevent legacy alerts from calling the
`shouldDismissHandler` (#90)

**What's New:**
- Adds 2 new customizable properties: `titleLabelColor` and `messageLabelColor` (#92)
- Adds 2 new customizable properties: `titleLabelColor` and `messageLabelColor`
(#92)

### 2.3.2

Expand All @@ -168,12 +206,14 @@ versions of `SDCAlertView`.
**Bug Fixes:**
- Fixes crash when using attributed title in legacy alert (#85 & #86)
- Fixes a stack overflow on iPad 2 (#87)
- Fixes an issue that would not reflect the attributed of an attributed string after creating an alert (#88)
- Fixes an issue that would not reflect the attributed of an attributed string
after creating an alert (#88)

### 2.3.0

**What's New:**
- Improved semantics for alert action styles. See the discussion in #81 for more information.
- Improved semantics for alert action styles. See the discussion in #81 for more
information.

**Bug Fixes:**
- Fixes an animation issue in `SDCAlertView` on iOS 7 (#79)
Expand All @@ -182,7 +222,8 @@ versions of `SDCAlertView`.
### 2.2.0

**Bug Fixes:**
- Fixes an incompatibility issue that would not correctly fetch text fields on iOS 7 (#67)
- Fixes an incompatibility issue that would not correctly fetch text fields on
iOS 7 (#67)

### 2.1.1

Expand All @@ -195,16 +236,19 @@ versions of `SDCAlertView`.
- The `usesLegacyAlert` property is now made public

**Bug Fixes:**
- Updates the import in SDCAlertController.h to not depend on any precompiled headers
- Updates the import in SDCAlertController.h to not depend on any precompiled
headers
- Fixes several issues with the legacy alert (#62, #63, #64, #68)
- Improves upon `UIAlertController` so that when an alert button is quickly tapped, it will highlight (`UIAlertController` does not do this)
- Improves upon `UIAlertController` so that when an alert button is quickly
tapped, it will highlight (`UIAlertController` does not do this)
- Fixes Auto Layout warnings for multi-line labels (#60)
- Returns the correct text when accessing `titleLabel.text`

### 2.0.1

**Bug Fixes:**
- Raises an exception when presenting SDCAlertView 1.0 from a `UIAlertView` or `UIActionSheet` (#56)
- Raises an exception when presenting SDCAlertView 1.0 from a `UIAlertView` or
`UIActionSheet` (#56)
- Prevents a crash when creating an alert with a `nil` title or message

## 2.0
Expand All @@ -213,12 +257,14 @@ versions of `SDCAlertView`.
- All new API that matches and extends `UIAlertController`
- Ability to always show buttons horizontally or vertically
- Backwards compatible with `SDCAlertView` (1.0)
- More stylistic elements you can style (alert width, button separators, text fields, etc.)
- More stylistic elements you can style (alert width, button separators, text
fields, etc.)

### 1.4.3

**Bug Fixes:**
- Fixes an issue that would not enforce `contentPadding` on the title and message labels properly (#58)
- Fixes an issue that would not enforce `contentPadding` on the title and
message labels properly (#58)

### 1.4.2

Expand All @@ -232,65 +278,87 @@ versions of `SDCAlertView`.
- Initialization is written a little differently to be more subclass-friendly
- Ready for use in iOS 8

Though the alert can still be used in iOS 8, keep in mind that the actual iOS 8 alert looks slightly different. The plan is to eventually have support for both, but that's currently not the case.
Though the alert can still be used in iOS 8, keep in mind that the actual iOS 8
alert looks slightly different. The plan is to eventually have support for both,
but that's currently not the case.

### 1.4

**What's New:**
- Added the ability to position a two-button alert vertically as opposed to horizontally (#29)
- Added the ability to position a two-button alert vertically as opposed to
horizontally (#29)
- Added `attributedTitle` and `attributedMessage` properties (#30)

**Bug Fixes:**
- Auto-layout doesn't complain anymore when using `[[SDCAlertView alloc] init]`
- Fixes a bug that would not show correct button titles in certain alert configurations (#32)
- Instead of clipping button text, it now reduces the size of text on buttons appropriately (#33)
- Fixes a bug that would not show correct button titles in certain alert
configurations (#32)
- Instead of clipping button text, it now reduces the size of text on buttons
appropriately (#33)

### 1.3

**What's New:**
- The `SDCAlertViewTransitioning` protocol allows users to customize alert transitions and behavior
- The `SDCAlertViewTransitioning` protocol allows users to customize alert
transitions and behavior
- `SDCAlertView` now supports `tintColor` for buttons and `contentView`

**Bug Fixes:**
- Fixes an issue where the status bar style would not be preserved if it was set to `UIStatusBarStyleLightContent` (#26 & #27)
- Fixes an issue where the status bar style would not be preserved if it was set
to `UIStatusBarStyleLightContent` (#26 & #27)
- Fixes a bug that causes the app to lock up due to a race condition (#28)
- Adding subviews to `contentView` won't have any animation-related side effects anymore (see #25)
- Adding subviews to `contentView` won't have any animation-related side effects
anymore (see #25)

### 1.2.1

**Bug Fixes:**
- Resolves an issue that could put an app in a bad state when transitioning to and from multiple alerts in rapid succession.
- Resolves an issue that could put an app in a bad state when transitioning to
and from multiple alerts in rapid succession.

### 1.2

**What's New:**
- New convenience methods for showing alerts more easily
- The `SDCAlertViewWidth` constant is made public (#24)
- The `contentView` does not require vertical constraints anymore, though they can be used to size the `contentView` other than "hug its subviews" (#23)
- The `contentView` does not require vertical constraints anymore, though they
can be used to size the `contentView` other than "hug its subviews" (#23)

**Bug Fixes:**
- Resolves an issue that would show the status bar if it was previously hidden (#21)
- Resolves an issue that would sometimes return the wrong button index when using `addButtonWithTitle:`
- Transitions between alerts flow more logically if you call several show or dismiss methods right after each other (#25)
- The `animated` argument in `dismissWithClickedButtonIndex:animated:` is honored again
- Resolves an issue that would show the status bar if it was previously hidden
(#21)
- Resolves an issue that would sometimes return the wrong button index when
using `addButtonWithTitle:`
- Transitions between alerts flow more logically if you call several show or
dismiss methods right after each other (#25)
- The `animated` argument in `dismissWithClickedButtonIndex:animated:` is
honored again

### 1.1

**What's New:**
- Support for styling an alert. A number of properties have been exposed so that alerts can be easily given a different style. Styling all alerts in an app using `UIAppearance` is also supported.
- Support for styling an alert. A number of properties have been exposed so that
alerts can be easily given a different style. Styling all alerts in an app
using `UIAppearance` is also supported.

**Bug Fixes:**
- The alert's background is no longer using the toolbar hack (#16 & #17)
- Accessing a text field before calling `show` does not cause a crash anymore (#14)
- The color of text on a button color did not match `UIAlertView`'s text color 100%
- A disabled button will have its label's `enabled` property set to `NO`, which is also where it gets its gray color from
- A 1px hairline at the bottom of the right button in a two-button alert was removed
- Accessing a text field before calling `show` does not cause a crash anymore
(#14)
- The color of text on a button color did not match `UIAlertView`'s text color
100%
- A disabled button will have its label's `enabled` property set to `NO`, which
is also where it gets its gray color from
- A 1px hairline at the bottom of the right button in a two-button alert was
removed

## 1.0

This release marks the first official release of SDCAlertView.

SDCAlertView's behavior should now match UIAlertView's. Any behavior that's different from UIAlertView and is not documented as a "won't fix" or known bug is considered a bug that needs to be solved.
SDCAlertView's behavior should now match UIAlertView's. Any behavior that's
different from UIAlertView and is not documented as a "won't fix" or known bug
is considered a bug that needs to be solved.

## 0.9

Expand Down
4 changes: 2 additions & 2 deletions Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
DEVELOPMENT_TEAM = "";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ScottyDoesntCode.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -403,7 +403,7 @@
DEVELOPMENT_TEAM = "";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ScottyDoesntCode.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Loading

0 comments on commit 51d2585

Please sign in to comment.