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

watchOS support #10

Open
lexrus opened this issue Aug 19, 2015 · 6 comments
Open

watchOS support #10

lexrus opened this issue Aug 19, 2015 · 6 comments

Comments

@lexrus
Copy link

lexrus commented Aug 19, 2015

Hi, this project is great. I'd like to use it in my WATCH App. Do you have any plan to support watchOS?

@tomkowz
Copy link
Owner

tomkowz commented Aug 19, 2015

Hey @lexrus, it should work as is now. Just configure framework with correct NSBundle instance and you should be able to do this. If this not still work for you could you share how files are located in the project and how you're configuring it and getting localized values? If this should work but don't it means that something is broken in Swifternalization. Unfortunately I'll take a look on this probably during the weekend.

@lexrus
Copy link
Author

lexrus commented Aug 20, 2015

Hi @tomkowz
Thank you for the rapid reply.
I tried to import this lib as a framework with CocoaPods. My Podfile:

use_frameworks!
inhibit_all_warnings!

...other targets...

target 'VPNOnWatchKitExtension' do
  platform :watchos
  pod 'Swifternalization',
    :git    => '[email protected]:tomkowz/Swifternalization.git',
    :branch => 'swift2'
  pod 'KeychainAccess',
    :git    => '[email protected]:kishikawakatsumi/KeychainAccess.git',
    :branch => 'swift-2.0'
end

target 'VPNOnWatchKitApp' do
  platform :watchos
  pod 'Swifternalization',
    :git    => '[email protected]:tomkowz/Swifternalization.git',
    :branch => 'swift2'
  pod 'KeychainAccess',
    :git    => '[email protected]:kishikawakatsumi/KeychainAccess.git',
    :branch => 'swift-2.0'
end

But failed while pod install:

[!] The platform of the target `VPNOnWatchKitApp` (watchOS 2.0) is not compatible with `Swifternalization (1.2)`, which does not support `watchos`.
[!] The platform of the target `VPNOnWatchKitExtension` (watchOS 2.0) is not compatible with `Swifternalization (1.2)`, which does not support `watchOS`.

If I comment out Swifternalization, the KeychainAccess can be installed without problems. I don't know what the difference between them.

@tomkowz
Copy link
Owner

tomkowz commented Aug 20, 2015

What is plaform version that you specified in Podfile? I don't see it here.

Here is my configuration that I used for example:

platform :ios, '8.0'
use_frameworks!
pod 'Swifternalization', :git => 'https://github.com/tomkowz/Swifternalization.git', :branch => 'swift2'

I don't think so you need Swifternalization for Apple Watch App target. You need it in extension because the translation files will be used by extension.

@lexrus
Copy link
Author

lexrus commented Aug 20, 2015

The default platform for the whole project was set to iOS 9.

platform :ios, '9.0'

But I did mention above platform :watchos in targets of both WatchKitApp and WatchKitExtension.

@lexrus
Copy link
Author

lexrus commented Aug 20, 2015

https://github.com/lexrus/VPNOn/blob/feature/ios9/Podfile
Here is my podfile which works fine. But failed after import Swifternalization in the 2 watchOS targets.

@tomkowz
Copy link
Owner

tomkowz commented Aug 20, 2015

Ahh, right, I see. I'll fix it in the weekend.

tomkowz added a commit that referenced this issue Aug 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants