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

Swift 3 Support is missing ? #26

Closed
YHSX88 opened this issue Sep 17, 2016 · 19 comments
Closed

Swift 3 Support is missing ? #26

YHSX88 opened this issue Sep 17, 2016 · 19 comments

Comments

@YHSX88
Copy link

YHSX88 commented Sep 17, 2016

Hi

I love the library but I don't think it has Swift 3 support as Xcode 8 is telling me that I need to do a lot of changes.

for example:
//MARK: - Customizations
@objc private func setShadowAlertView(){
alertView.layer.masksToBounds = false
alertView.layer.shadowOffset = CGMake(0,0) and should be CGSize(width: 0, height: 0)
alertView.layer.shadowRadius = 8
alertView.layer.shadowOpacity = 0.3
}

What I'm missing ?

@pmusolino
Copy link
Owner

pmusolino commented Sep 17, 2016

Hi @YHSX88.
Are you using the correct branch of the library?

The master branch actually support swift 2.3. If you need swift 3.0, you have to use this https://github.com/Codeido/PMAlertController/tree/swift3

You can use it via cocoapods:

pod 'PMAlertController', :git => 'https://github.com/Codeido/PMAlertController', :branch => 'swift3'

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Hi Codeido
I got this message with the pod you gave me ?

[!] Invalid Podfile file: syntax error, unexpected tLABEL
...lertController', :git => https://github.com/Codeido/PMAlertC...
... ^
/Xcode8_projects/PMtest_SW3/Podfile:5: unknown regexp options - gthb
/Xcode8_projects/PMtest_SW3/Podfile:5: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
....com/Codeido/PMAlertController', :branch => 'swift3'
... ^
/Xcode8_projects/PMtest_SW3/Podfile:5: syntax error, unexpected tIDENTIFIER, expecting end-of-input
...Controller', :branch => 'swift3'
... ^.

@pmusolino
Copy link
Owner

Ops, try again now, I modified the string of my previous comment.

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

On empty project when I did pod install with the link provided Xcode 8 is giving me still suggestion to change to Swift 3

screen shot 2016-09-17 at 18 16 33

@pmusolino
Copy link
Owner

Porting to swift 3 is not yet 100% complete.
I'll do an update on the branch in a few minutes. I will alert you here.

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Thank you, and you know sorry for this but in the description is saying Support of Swift 2.3 and 3

Thank you in advance.

@pmusolino
Copy link
Owner

Hi @YHSX88, try now.

Thanks
-Paolo

@pmusolino pmusolino added the bug label Sep 17, 2016
@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Ok Just did it
and I got the message from xcode to convert to swift 3 but then xcode found no changes to make
but after this I still got 64 errors.

screen shot 2016-09-17 at 18 36 31

screen shot 2016-09-17 at 18 36 49

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

And this is the podfile text

platform :ios, '9.0'
use_frameworks!

target 'PM_SW3' do

pod 'PMAlertController', :git => 'https://github.com/Codeido/PMAlertController', :branch => 'swift3'

end

@pmusolino
Copy link
Owner

Oh, i see that your project need an update to the recommended settings. Do it, and retry.

Make sure that in Build Settings there are these two options
schermata 2016-09-17 alle 17 45 39

and

schermata 2016-09-17 alle 17 46 08

@pmusolino
Copy link
Owner

I think that another reason can be the settings of Cocoapods (i tryed now the library on another project and is working).

Try to insert in your podfile this:

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

It is working with the first suggestion however not sure why but I don't have setting exactly as you
do i.e. SWIFT_VERSION I do have this:

screen shot 2016-09-17 at 18 53 34

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Anyway thanks a lot :)

@pmusolino
Copy link
Owner

Excellent 👍
In the first case it was an error inside the library. In the second case was an error of configuration of the project.

Thanks for your contribution @YHSX88 ;)
-Paolo

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Aaah just to ask you, for anybody out there when do you plan to move swift 3 on the master branch ?

@pmusolino
Copy link
Owner

Barring unforeseen circumstances, tomorrow, and i want to integrate this #15 as a new feature.

@YHSX88
Copy link
Author

YHSX88 commented Sep 17, 2016

Great :)

@pmusolino
Copy link
Owner

The new version compatible with Swift 3 is now on master branch and is available on cocoapods.
f73c944

@YHSX88
Copy link
Author

YHSX88 commented Sep 19, 2016

Hi thanks for this !

I just tried to install via podfile -> pod 'PMAlertController'
and it is downloading ver 1.1.0:

screen shot 2016-09-19 at 08 45 46

then I tried to get it from the master and I got it like you said:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'PM_SW3_final' do

pod 'PMAlertController', :git => 'https://github.com/Codeido/PMAlertController', :branch => ‘master’

end

screen shot 2016-09-19 at 08 53 47

Then it gave me many errors like 64 in count, but I just recompiled and it is working JUST FINE now.

This is for anybody out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants