Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
Remove dead code
  • Loading branch information
rlegault3333 committed Jan 18, 2021
1 parent 73f4eae commit 6175c36
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,34 @@ struct AppFileSelectedView: View {
}
```

Pass View to the package on init by adding a closure to the init call. If no closure is provided it will use the iOS Quickview functionality
Pass View to the package on init by adding a closure to the init call.
```swift
FileBrowserSUI(initialPath: initPath) { value in
AppFileSelectedView(url:value)
NavigationView {
FileBrowserSUI(initialPath: initPath) { value in
AppFileSelectedView(url:value)
}
}
```




If you do not supply a view enclosure then you must instantiate the FileBrowserSUI with FileBroswerSUIPreview like so.

Usage Example:
```swift
NavigationView {
FileBrowserSUIPreview(initialPath: initPath,
xInfo0: FileExtraInfo(title: "Offense", get: fileMapInfo.get0, set: fileMapInfo.set0, delete: fileMapInfo.delete),
xInfo1: FileExtraInfo(title: "Defense", get: fileMapInfo.get1, set: fileMapInfo.set1, delete: fileMapInfo.delete))
}
```
### IMPORTANT
You must make sure that FileBrowserSUI* is inside a NavigationView for the NavigationLinks to work.

### FUTURE:
If no closure is provided it will use the iOS Quickview functionality. (Still trying to figure this out.)

## Check mark
For each check mark you must provide a instance of **FileExtraInfo** that you supply
* title: String
Expand All @@ -60,13 +81,6 @@ For each check mark you must provide a instance of **FileExtraInfo** that you su

It is your responsiblity to store the information by its URL as required by your app and supply it via the get() and update it via the set() and delete it from your storage.

Usage Example:
```swift
FileBrowserGeneric(initialPath: initPath,
xInfo0: FileExtraInfo(title: "Offense", get: fileMapInfo.get0, set: fileMapInfo.set0, delete: fileMapInfo.delete),
xInfo1: FileExtraInfo(title: "Defense", get: fileMapInfo.get1, set: fileMapInfo.set1, delete: fileMapInfo.delete))
```

See the xcode project **Example_FileBrowser_SUI** in the FileBrowserSUI package for the full code.


Expand Down
1 change: 0 additions & 1 deletion Sources/FileBrowserSUI/FileLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct FileLinkView<LinkView:View>: View {
self.linkView(filePath)
}
} else {
//PreviewController(url:item.filePath)
self.linkView(item.filePath)
}
}
Expand Down
16 changes: 16 additions & 0 deletions Sources/FileBrowserSUI/View+Print.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// File.swift
//
//
// Created by Richard Legault on 2021-01-17.
//

import Foundation
import SwiftUI

extension View {
func Print(_ vars: Any...) -> some View {
for v in vars { print(v)}
return EmptyView()
}
}

0 comments on commit 6175c36

Please sign in to comment.