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

Update project for Swift 5 and Xcode 11 #91

Merged
merged 2 commits into from Sep 25, 2019

Conversation

benasher44
Copy link
Contributor

@benasher44 benasher44 commented Sep 25, 2019

  • Moved SWIFT_VERSION from target level to project level and bumped it to 5.0
  • Updated podspec to support Swift 5
  • Updated travis to build with Xcode 11
  • Fixed a Swift 5 deprecation warning about String.Index.encodedOffset

@@ -8,5 +8,9 @@ Pod::Spec.new do |spec|
spec.source = { :git => 'https://github.com/GitHawkApp/MessageViewController.git', :tag => spec.version.to_s }
spec.source_files = 'MessageViewController/*.swift'
spec.platform = :ios, '9.0'
spec.swift_version = '4.2'
if spec.respond_to?(:swift_versions) then
spec.swift_versions = ['4.2', '5.0']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered putting 5.1 here, but this is supposed to match possible values for SWIFT_VERSION, and Xcode 11 doesn't show 5.1 as a possible value 🤷‍♂

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird! Do you have any theories on why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best guess: it's not a major upgrade that would trigger Xcode to initiate migrations of any kind.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned about supporting multiple Swift versions for one pod, neat!

@benasher44
Copy link
Contributor Author

benasher44 commented Sep 25, 2019

Here's a copy of the fixed deprecation:

extension String.Index {

    /// The offset into a string's code units for this index.
    @available(swift, deprecated: 4.2, message: "encodedOffset has been deprecated as most common usage is incorrect. Use utf16Offset(in:) to achieve the same behavior.")
    @inlinable public var encodedOffset: Int { get }

@benasher44 benasher44 changed the title Update project for Swift 5 Update project for Swift 5 and Xcode 11 Sep 25, 2019
Copy link

@ronaldsmartin ronaldsmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -8,5 +8,9 @@ Pod::Spec.new do |spec|
spec.source = { :git => 'https://github.com/GitHawkApp/MessageViewController.git', :tag => spec.version.to_s }
spec.source_files = 'MessageViewController/*.swift'
spec.platform = :ios, '9.0'
spec.swift_version = '4.2'
if spec.respond_to?(:swift_versions) then
spec.swift_versions = ['4.2', '5.0']

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird! Do you have any theories on why?

Copy link
Collaborator

@BasThomas BasThomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -8,5 +8,9 @@ Pod::Spec.new do |spec|
spec.source = { :git => 'https://github.com/GitHawkApp/MessageViewController.git', :tag => spec.version.to_s }
spec.source_files = 'MessageViewController/*.swift'
spec.platform = :ios, '9.0'
spec.swift_version = '4.2'
if spec.respond_to?(:swift_versions) then
spec.swift_versions = ['4.2', '5.0']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned about supporting multiple Swift versions for one pod, neat!

Copy link
Collaborator

@BasThomas BasThomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, could you add a line to the changelog? 🙏

@benasher44
Copy link
Contributor Author

No problem! I've updated the changelog to include the 0.2.0 release as well. 0.2.1 seemed mostly release/version related, so I omitted it. I'm happy to update it for 0.2.1 as well, if you think that's needed.

@BasThomas
Copy link
Collaborator

All good :)

@BasThomas BasThomas merged commit 3916d73 into GitHawkApp:master Sep 25, 2019
@benasher44 benasher44 deleted the basher/xcode11 branch September 26, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants