Skip to content

Commit

Permalink
Merge pull request #4 from canopas/fix-pod-issue
Browse files Browse the repository at this point in the history
Fix pod issue
  • Loading branch information
cp-amisha-i authored Mar 9, 2022
2 parents d558842 + 6c07c8e commit 67c53db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions Sources/UIPilot/UIPilot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ struct PathView: View {
VStack {
NavigationLink(destination: self.state.next, isActive: self.$state.isActive) {
EmptyView()
}.isDetailLink(false)
}
#if os(iOS)
.isDetailLink(false)
#endif
content
}
}
Expand Down Expand Up @@ -118,7 +121,7 @@ class UIPilotViewState<T: Equatable>: ObservableObject {
private let onPop: () -> Void

private var pathViews = [Path<T>: PathView]()

@Published var content: PathView? = nil

init(onPop: @escaping () -> Void) {
Expand All @@ -128,7 +131,7 @@ class UIPilotViewState<T: Equatable>: ObservableObject {
func onPathsChanged(paths: [Path<T>], routeMap: RouteMap<T>) {
content = getView(paths, routeMap)
}

func getView(_ paths: [Path<T>], _ routeMap: RouteMap<T>) -> PathView? {
recycleViews(paths)

Expand All @@ -144,7 +147,7 @@ class UIPilotViewState<T: Equatable>: ObservableObject {
content?.state.next = current
content?.state.onPop = current == nil ? {} : { [weak self] in
if let self = self, !paths.isEmpty,
paths.last != path {
paths.last != path {
self.onPop()
}
}
Expand Down Expand Up @@ -183,7 +186,9 @@ public struct UIPilotHost<T: Equatable>: View {
NavigationView {
state.content
}
#if !os(macOS)
.navigationViewStyle(.stack)
#endif
.environmentObject(pilot)
}
}
10 changes: 5 additions & 5 deletions UIPilot.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Pod::Spec.new do |s|
DESC

s.homepage = "https://github.com/canopas/UIPilot"
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
s.license = { :type => "MIT", :file => "LICENSE.md" }
s.author = { "Jimmy" => "[email protected]" }
s.source = { :git => "https://github.com/canopas/UIPilot", :tag => "#{s.version}" }
s.source_files = "Sources/UIPilot/**/*"
s.source = { :git => "https://github.com/canopas/UIPilot.git", :tag => s.version.to_s }
s.source_files = "Sources/UIPilot/*.swift"
s.social_media_url = 'https://twitter.com/canopassoftware'

s.module_name = 'UIPilot'
s.default_subspec = 'standard'
s.requires_arc = true
s.swift_versions = '5.5'
s.swift_version = '5.5'
s.preserve_paths = 'README.md'

s.ios.deployment_target = '14.0'
s.tvos.deployment_target = '14.0'
Expand Down

0 comments on commit 67c53db

Please sign in to comment.