Skip to content

Commit

Permalink
Merge pull request #13 from steamclock/swift4.2
Browse files Browse the repository at this point in the history
Migrate to Swift 4.2
  • Loading branch information
Jeremy Chiang authored Jan 10, 2019
2 parents 566ba93 + fe8057b commit 20e5d73
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 20 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2019-01-08
### Changed
- Use Swift 4.2

## [1.1.0] - 2018-08-02
### Added
- Added this changelog.

### Changed
- Changed the currently selected endpoint image to be less intrusive.
- Updated sample images.
- Updated sample images.
14 changes: 11 additions & 3 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 Example/Switchcraft.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@
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 @@ -506,7 +506,7 @@
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 Down
2 changes: 1 addition & 1 deletion Example/Switchcraft/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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]? = nil) -> Bool {
return true
}
}
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ To get updates whenever an endpoint is selected, you've got two options:
```
class MyVC: UIViewController {
// ...
override func viewDidLoad() {
super.viewDidLoad()
Switchcraft.delegate = self
}
}
extension MyVC: SwitchcraftDelegate {
func switchcraft(_ switchcraft: Switchcraft, didSelectEndpoint endpoint: Endpoint) {
// Handle your endpoint selection here
Expand All @@ -73,13 +73,13 @@ To get updates whenever an endpoint is selected, you've got two options:

2. `NotificationCenter`

Endpoint selections are also broadcast to the `NotificationCenter`.
Endpoint selections are also broadcast to the `NotificationCenter`.

```
NotificationCenter.default.addObserver(self, selector: #selector(endpointSelected(_:)), name: .SwitchcraftDidSelectEndpoint, object: nil)
...
@objc private func endpointSelected(_ sender: NSNotification) {
guard let endpoint = sender.userInfo?[Notification.Key.Endpoint] as? Endpoint else {
return
Expand Down Expand Up @@ -108,7 +108,7 @@ extension Switchcraft {
```swift
extension MyVC: SwitchcraftDelegate {
...

func switchcraft(_ switchcraft: Switchcraft, didTapAction action: Action)
// Handle custom action selection here
}
Expand Down Expand Up @@ -153,7 +153,7 @@ extension MyVC: SwitchcraftDelegate {
}

```

### Getting Fancy

There are lots of knobs to tweak in your config. See [Config.swift](https://github.com/steamclock/switchcraft/blob/master/Switchcraft/Classes/Config.swift) for a full list.
Expand All @@ -165,8 +165,8 @@ To run the example project, clone the repo, and run `pod install` from the Examp
## Requirements

- iOS 9.3 or above
- Xcode 8.2.1 or above
- Swift 3.2 or above
- Xcode 10 or above
- Swift 4.2 or above

## Installation

Expand Down
4 changes: 2 additions & 2 deletions Switchcraft.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Switchcraft'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'Drop and go endpoint selector written in Swift.'
s.homepage = 'https://github.com/steamclock/Switchcraft'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand All @@ -11,5 +11,5 @@ Pod::Spec.new do |s|
'Switchcraft' => ['Switchcraft/*/Assets.xcassets']
}
s.source_files = 'Switchcraft/Classes/**/*'
s.swift_version = '3.2'
s.swift_version = '4.2'
end

0 comments on commit 20e5d73

Please sign in to comment.