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 support for Swift 5.0 and keep compatibility to 4.0 #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 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: 4 additions & 0 deletions Pod/Classes/SAConfettiView.swift
Expand Up @@ -50,7 +50,11 @@ public class SAConfettiView: UIView {
emitter = CAEmitterLayer()

emitter.emitterPosition = CGPoint(x: frame.size.width / 2.0, y: 0)
#if swift(>=4.2)
emitter.emitterShape = .line
#else
emitter.emitterShape = kCAEmitterLayerLine
#endif
emitter.emitterSize = CGSize(width: frame.size.width, height: 1)

var cells = [CAEmitterCell]()
Expand Down
20 changes: 11 additions & 9 deletions README.md
Expand Up @@ -14,16 +14,18 @@ It's raining confetti! SAConfettiView is the easiest way to add fun, multi-color

## Installation

SAConfettiView is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```swift
pod "SAConfettiView"
#### CocoaPods
SAConfettiView supports [CocoaPods 1.7.0's new multi-Swift feature](http://blog.cocoapods.org/CocoaPods-1.7.0-beta/) for Swift 4.0, 4.2, and 5.0. Simply specify `supports_swift_versions` in your Podfile.

```ruby
platform :ios, '9.0'
target 'ProjectName' do
use_frameworks!
supports_swift_versions '< 5.0' # configure this for your project
pod 'SAConfettiView', '~> 0.1.9'
end
```

And then run:

`$ pod install`
*(if you run into problems, `pod repo update` and try again)*

#### Manual Installation
To manually install SAConfettiView, simply add `SAConfettiView.swift` to your project.
Expand Down
3 changes: 2 additions & 1 deletion SAConfettiView.podspec
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = "SAConfettiView"
s.version = "0.1.8"
s.version = "0.1.9"
s.summary = "Confetti! Who doesn't like confetti?'"

# This description is used to generate tags and improve search results.
Expand Down Expand Up @@ -38,4 +38,5 @@ Pod::Spec.new do |s|
# s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'UIKit', 'QuartzCore'
# s.dependency 'AFNetworking', '~> 2.3'
s.swift_versions = ['4.0', '4.2', '5.0']
end