thii / FontAwesome.swift

Use FontAwesome in your Swift projects
MIT License
1.57k stars 266 forks source link

Watch OS Support #257

Closed mikemike396 closed 2 years ago

mikemike396 commented 4 years ago

Any idea if this library could support Watch OS?

Getting this error now.

[!] The platform of the target Watch Extension (watchOS 4.0) is not compatible with FontAwesome.swift (1.9.0), which does not support watchOS.

target 'Watch Extension' do
    platform :watchos, '4.0'
    pod 'FontAwesome.swift'
end
MatrixSenpai commented 4 years ago

FontAwesome.swift currently relies on UIKit and so does not support WatchOS. I'm working on separating the core FA library and the UIKit elements into different specs so we don't have this problem.

You can try using the v.2.0.0 branch with FontAwesome.swift/Core spec

mikemike396 commented 4 years ago

Thank you for the reply! I am getting this error

Analyzing dependencies
Pre-downloading: `FontAwesome.swift` from `https://github.com/thii/FontAwesome.swift.git`, branch `v2.0.0`
[!] The platform of the target `Watch Extension` (watchOS 4.0) is not compatible with `FontAwesome.swift/Core (2.0.0-alpha)`, which does not support `watchOS`.
target 'Watch Extension' do
    platform :watchos, '4.0'
    pod 'FontAwesome.swift/Core', :git => 'https://github.com/thii/FontAwesome.swift.git', :branch => 'v2.0.0'
end
MatrixSenpai commented 4 years ago

Thanks for making me aware. I've updated the Podspec to support WatchOS >= 4.0 and tested on a sample project to ensure it works. You should be able to leave everything as-is and install the pod. Let me know if you run into any issues

mikemike396 commented 4 years ago

Awesome! No WatchOS error now on pod install!

Is there a replacement for this in 2.0?

UIImage.fontAwesomeIcon(name: FontAwesome.shoppingCart, style: .solid, textColor: color, size: CGSize(width: size, height: size))

MatrixSenpai commented 4 years ago

It's on the list of things to take care of. Right now, I'm really focusing on updating the core API, and splitting the UIKit stuff into a separate spec so I can add a spec specifically for watchOS and macOS

mikemike396 commented 4 years ago

Understood! Thanks for the update. I'll wait for the other changes. Thanks for the hard work on this library! 🍺

MatrixSenpai commented 2 years ago

Closing since this issue is resolved