Skip to content

Commit

Permalink
chore: update deprecated swift methods to latest version (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadsalhani authored and kmcgill88 committed Sep 25, 2018
1 parent e95c4ed commit 9351fdb
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

11 changes: 6 additions & 5 deletions .travis.yml
@@ -1,4 +1,4 @@
osx_image: xcode9
osx_image: xcode10
language: swift
# cache: cocoapods
# podfile: Example/Podfile
Expand All @@ -8,10 +8,11 @@ env:
- LC_CTYPE=en_US.UTF-8
- LANG=en_US.UTF-8
matrix:
- DESTINATION="OS=11.0,name=iPhone 8" SDK="iphonesimulator11.0" POD_LINT="YES" SWIFT_LINT="YES"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SDK="iphonesimulator11.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=9.3,name=iPhone 6" SDK="iphonesimulator11.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=8.4,name=iPhone 4S" SDK="iphonesimulator11.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=12.0,name=iPhone XS" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
- DESTINATION="OS=11.4,name=iPhone 8" SDK="iphonesimulator12.0" POD_LINT="YES" SWIFT_LINT="YES"
- DESTINATION="OS=10.3.1,name=iPhone 7 Plus" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
- DESTINATION="OS=9.3,name=iPhone 6" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"
# - DESTINATION="OS=8.4,name=iPhone 5S" SDK="iphonesimulator12.0" POD_LINT="NO" SWIFT_LINT="NO"

before_install:
- brew install swiftlint
Expand Down
3 changes: 2 additions & 1 deletion McPicker.podspec
@@ -1,7 +1,8 @@
Pod::Spec.new do |s|
s.name = 'McPicker'
s.version = '1.0.0'
s.version = '2.0.0'
s.summary = 'McPicker is a customizable, closure driven UIPickerView drop-in solution with animations that is rotation ready.'
s.swift_version = '4.2'

s.description = <<-DESC
McPicker is a UIPickerView drop-in solution with animations that is rotation ready. The more string arrays you pass, the more picker components you'll get. You can set custom label or use the defaults. McPicker can be presented as a Popover on iPhone or iPad using showAsPopover, as an inputView using McTextField or use the default slide up and down style show.
Expand Down
4 changes: 2 additions & 2 deletions McPicker/Classes/McPicker.swift
Expand Up @@ -270,9 +270,9 @@ open class McPicker: UIView {
super.willMove(toWindow: newWindow)

if newWindow != nil {
NotificationCenter.default.addObserver(self, selector: #selector(McPicker.sizeViews), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(McPicker.sizeViews), name: UIDevice.orientationDidChangeNotification, object: nil)
} else {
NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)
NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)
}
}

Expand Down
4 changes: 2 additions & 2 deletions McPicker/Classes/McPickerBarButtonItem.swift
Expand Up @@ -33,7 +33,7 @@ open class McPickerBarButtonItem: UIBarButtonItem {
- returns: McPickerBarButtonItem
*/
public class func done(mcPicker: McPicker, title: String? = nil, barButtonSystemItem: UIBarButtonSystemItem = .done) -> McPickerBarButtonItem {
public class func done(mcPicker: McPicker, title: String? = nil, barButtonSystemItem: UIBarButtonItem.SystemItem = .done) -> McPickerBarButtonItem {

if let buttonTitle = title {
return self.init(title: buttonTitle, style: .plain, target: mcPicker, action: #selector(McPicker.done))
Expand All @@ -51,7 +51,7 @@ open class McPickerBarButtonItem: UIBarButtonItem {
- returns: McPickerBarButtonItem
*/
public class func cancel(mcPicker: McPicker, title: String? = nil, barButtonSystemItem: UIBarButtonSystemItem = .cancel) -> McPickerBarButtonItem {
public class func cancel(mcPicker: McPicker, title: String? = nil, barButtonSystemItem: UIBarButtonItem.SystemItem = .cancel) -> McPickerBarButtonItem {

if let buttonTitle = title {
return self.init(title: buttonTitle, style: .plain, target: mcPicker, action: #selector(McPicker.cancel))
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -135,6 +135,14 @@ it, simply add the following line to your Podfile:
pod "McPicker"
```

### Swift 4.2 Support

For Swift 4.2 support, please use version `2.0.0`.

```ruby
pod 'McPicker', '~> 2.0.0'
```

## Author

Kevin McGill, kevin@mcgilldevtech.com
Expand Down

0 comments on commit 9351fdb

Please sign in to comment.