Skip to content

Complete all current API documentation and readme #53

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

Merged
merged 2 commits into from
Nov 12, 2019
Merged
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ If you need animated image, `AnimatedImage` is the one to choose. Remember it su

But, because `AnimatedImage` use `UIViewRepresentable` and driven by UIKit, currently there may be some small incompatible issues between UIKit and SwiftUI layout and animation system, or bugs related to SwiftUI itself. We try our best to match SwiftUI behavior, and provide the same API as `WebImage`, which make it easy to switch between these two types if needed.

For more information, it's really recommended to check our demo below, to learn detailed API usage.
For more information, it's really recommended to check our demo, to learn detailed API usage. You can also have a check at the latest API documentation, for advanced usage.

## Documentation

+ [SDWebImageSwiftUI API documentation](https://sdwebimage.github.io/SDWebImageSwiftUI/)
+ [SDWebImage API documentation](https://sdwebimage.github.io/)
+ [SDWebImage Wiki](https://github.com/SDWebImage/SDWebImage/wiki/)

## Demo

Expand Down
4 changes: 2 additions & 2 deletions SDWebImageSwiftUI/Classes/AnimatedImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SDWebImageSwiftUIObjC
public typealias AnimatedImageViewWrapper = SDAnimatedImageInterfaceWrapper
#endif

// Coordinator Life Cycle Binding Object
/// A coordinator object used for `AnimatedImage`native view bridge for UIKit/AppKit/WatchKit.
public final class AnimatedImageCoordinator: NSObject {

/// Any user-provided object for actual coordinator, such as delegate method, taget-action
Expand All @@ -27,7 +27,7 @@ public final class AnimatedImageCoordinator: NSObject {
public var userInfo: [AnyHashable : Any]?
}

// View
/// A Image View type to load image from url, data or bundle. Supports animated and static image format.
public struct AnimatedImage : PlatformViewRepresentable {
// Options
var url: URL?
Expand Down
4 changes: 4 additions & 0 deletions SDWebImageSwiftUI/Classes/Indicator/ActivityIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public struct ActivityIndicator: PlatformViewRepresentable {
@Binding var isAnimating: Bool
var style: Style

/// Create the indicator with animation binding and style
/// - Parameters:
/// - isAnimating: The binding to control the animation
/// - style: The indicator style
public init(_ isAnimating: Binding<Bool>, style: Style = .medium) {
self._isAnimating = isAnimating
self.style = style
Expand Down
5 changes: 5 additions & 0 deletions SDWebImageSwiftUI/Classes/Indicator/ProgressIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public struct ProgressIndicator: PlatformViewRepresentable {
@Binding var progress: CGFloat
var style: Style

/// Create indicator with animation binding, progress binding and the style
/// - Parameters:
/// - isAnimating: The binding to control the animation
/// - progress: The binding to update the progress
/// - style: The indicator style
public init(_ isAnimating: Binding<Bool>, progress: Binding<CGFloat>, style: Style = .default) {
self._isAnimating = isAnimating
self._progress = progress
Expand Down
1 change: 1 addition & 0 deletions SDWebImageSwiftUI/Classes/WebImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import SwiftUI
import SDWebImage

/// A Image View type to load image from url. Supports static image format.
public struct WebImage : View {
var url: URL?
var options: SDWebImageOptions
Expand Down
1 change: 0 additions & 1 deletion _Pods.xcodeproj

This file was deleted.