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

feat: visionOS support #172

Open
wants to merge 2 commits into
base: main
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/VitaminSwiftUI/Utils/VitaminAsset+SwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension VitaminAsset {
}

public var optionalImage: Image? {
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
let resultImage = Image(paymentMapper[name, default: name], bundle: bundle)
#elseif os(watchOS)
let resultImage = Image(name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public class VitaminSegmentedControl: UISegmentedControl {

self.setTitleTextAttributes(selectedAttributes, for: .selected)
self.setTitleTextAttributes(unselectedAttributes, for: .normal)

#if os(iOS)
self.dropShadow(shadowType: .shadow100)
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import UIKit
import VitaminCore

#if os(iOS)
/// Generic view controller that allows to display different view controllers with a `VitaminSegmentedControl` to choose which controller is displayed
public class VitaminSegmentedControlController: UIViewController {
/// List of viewControllers managed by the VitaminSegmentedControlController
Expand Down Expand Up @@ -182,3 +183,4 @@ public class VitaminSegmentedControlController: UIViewController {
viewController.removeFromParent()
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import UIKit
import VitaminCore

#if os(iOS)
extension UIView {
/// Drops a shadow below this view.
/// - Parameters shadowType : the `VitaminShadow`you wqnt to drop
Expand Down Expand Up @@ -67,3 +67,4 @@ extension CALayer {
}
}
}
#endif
4 changes: 2 additions & 2 deletions Sources/VitaminUIKit/Utils/VitaminAsset+UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension VitaminAsset {
}

public var optionalImage: UIImage? {
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
let resultImage = UIImage(named: paymentMapper[name, default: name], in: bundle, compatibleWith: nil)
#elseif os(watchOS)
let resultImage = UIImage(named: name)
Expand All @@ -25,7 +25,7 @@ extension VitaminAsset {

public extension UIImage {
convenience init?(asset: VitaminAsset) {
#if os(iOS) || os(tvOS)
#if os(iOS) || os(tvOS) || os(visionOS)
self.init(named: asset.name, in: asset.bundle, compatibleWith: nil)
#elseif os(watchOS)
self.init(named: asset.name)
Expand Down
Loading