-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add README documentation for modules #50
Open
mrylmz
wants to merge
1
commit into
develop
Choose a base branch
from
feature/module-documentation
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# BarcodeScanner | ||
|
||
The barcode scanner presents a video capturing preview and scans the content of it for barcodes. | ||
|
||
Example: | ||
```swift | ||
// Instantiation of the barcode scanner view. | ||
let barcodeScannerView = BarcodeScannerView.instantiate() | ||
|
||
// Configuration of the expected barcode types and the callbacks. | ||
barcodeScannerView.model = .init( | ||
barcodeTypes: [.qr], | ||
onScan: { barcodes in | ||
print(barcodes) | ||
}, | ||
onError: { error in | ||
print(error) | ||
} | ||
) | ||
|
||
// Starting the scan process. | ||
scannerView.startScanning() | ||
|
||
// Stopping the scan process. | ||
scannerView.stopScanning() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CarouselView | ||
|
||
The carousel view adds carousel scroll behaviour to an embedded generic `ContentView`. | ||
|
||
Example: | ||
```swift | ||
// The image urls to be presented as content | ||
let imageSourceURLs: [URL] = [<#image sources#>] | ||
|
||
// Instantiate carousel view with `ImageView` as content views | ||
let contentView = CarouselView<ImageView>.instantiate() | ||
|
||
// Configure the model of the carousel view by mapping the images | ||
contentView.model = .init(pages: imageSourceURLs.map { .url($0) }) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# GridView | ||
|
||
The grid view presents a collection of generic `ItemView`s in a grid based layout. | ||
|
||
Example: | ||
|
||
```swift | ||
// The image urls to be presented as content | ||
let imageSourceURLs: [URL] = [<#image sources#>] | ||
|
||
// Instantiation with an image view listening to touch events through the action view | ||
let gridView: GridView<ActionView<ImageView>> = .instantiate() | ||
|
||
// Model configuration | ||
gridView.model = GridViewModel( | ||
insets: .zero, | ||
spacing: .zero, | ||
numberOfColumns: 3, | ||
items: imageSourceURLs.map { imageSourceURL in | ||
return ActionViewModel(content: .url(imageSourceURL)) { [unowned self] in | ||
print("Did tap image view with url: \(imageSourceURL)") | ||
} | ||
} | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Keychain | ||
|
||
The keychain module provides an easy to use API agnostic to the device keychain and the iOS `Security` framework. | ||
|
||
```swift | ||
struct MyDataRepository { | ||
@Secured(key: "<#keychain value identifier#>") | ||
var topSecretSecuredValue: Bool | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# PageView | ||
|
||
The page view adds paged scroll behaviour to an embedded `ContentView`. | ||
|
||
Example: | ||
|
||
```swift | ||
// The image urls to be presented as content | ||
let imageSourceURLs: [URL] = [<#image sources#>] | ||
|
||
// Instantiate a page view with image views as content | ||
let contentView = PageView<ImageView>.instantiate() | ||
|
||
// Configure the model | ||
contentView.model = .init(pages: imageSourceURLs.map { .url($0) }) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# UserDefaults | ||
|
||
The user defaults module provides a property wrapper to access data in the device user defaults storage. | ||
|
||
Example: | ||
|
||
```swift | ||
struct MyDataRepository { | ||
@UserDefault(key: "<#value identifier#>", defaultValue: true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you could adjust the example in the way that a user defaults instance can be passed. |
||
var myPersistentProperty: Bool | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add an example for the full usage, together with passing the keychain instance