Skip to content

Commit d8ea744

Browse files
committed
Update README.md
1 parent 8383e57 commit d8ea744

File tree

6 files changed

+98
-5
lines changed

6 files changed

+98
-5
lines changed

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [krzyzanowskim]

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/
6+
DerivedData/
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

AnimatedImage.xcodeproj/project.pbxproj

+13-4
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88

99
/* Begin PBXBuildFile section */
1010
7561272D266794AE0085F3BF /* AnimatedImageApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7561272C266794AE0085F3BF /* AnimatedImageApp.swift */; };
11-
7561272F266794AE0085F3BF /* AnimatedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7561272E266794AE0085F3BF /* AnimatedImage.swift */; };
1211
75612731266794AF0085F3BF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75612730266794AF0085F3BF /* Assets.xcassets */; };
1312
75612734266794AF0085F3BF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75612733266794AF0085F3BF /* Preview Assets.xcassets */; };
13+
75B14C4E26B4D1CC005757F9 /* AnimatedImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75B14C4D26B4D1CC005757F9 /* AnimatedImage.swift */; };
1414
/* End PBXBuildFile section */
1515

1616
/* Begin PBXFileReference section */
1717
75612729266794AE0085F3BF /* AnimatedImage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimatedImage.app; sourceTree = BUILT_PRODUCTS_DIR; };
1818
7561272C266794AE0085F3BF /* AnimatedImageApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedImageApp.swift; sourceTree = "<group>"; };
19-
7561272E266794AE0085F3BF /* AnimatedImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedImage.swift; sourceTree = "<group>"; };
2019
75612730266794AF0085F3BF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
2120
75612733266794AF0085F3BF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
2221
75612735266794AF0085F3BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
22+
75B14C4D26B4D1CC005757F9 /* AnimatedImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimatedImage.swift; sourceTree = "<group>"; };
2323
/* End PBXFileReference section */
2424

2525
/* Begin PBXFrameworksBuildPhase section */
@@ -52,8 +52,8 @@
5252
7561272B266794AE0085F3BF /* AnimatedImage */ = {
5353
isa = PBXGroup;
5454
children = (
55+
75B14C4C26B4D1CC005757F9 /* AnimatedImage */,
5556
7561272C266794AE0085F3BF /* AnimatedImageApp.swift */,
56-
7561272E266794AE0085F3BF /* AnimatedImage.swift */,
5757
75612730266794AF0085F3BF /* Assets.xcassets */,
5858
75612735266794AF0085F3BF /* Info.plist */,
5959
75612732266794AF0085F3BF /* Preview Content */,
@@ -69,6 +69,15 @@
6969
path = "Preview Content";
7070
sourceTree = "<group>";
7171
};
72+
75B14C4C26B4D1CC005757F9 /* AnimatedImage */ = {
73+
isa = PBXGroup;
74+
children = (
75+
75B14C4D26B4D1CC005757F9 /* AnimatedImage.swift */,
76+
);
77+
name = AnimatedImage;
78+
path = Sources/AnimatedImage;
79+
sourceTree = SOURCE_ROOT;
80+
};
7281
/* End PBXGroup section */
7382

7483
/* Begin PBXNativeTarget section */
@@ -138,7 +147,7 @@
138147
isa = PBXSourcesBuildPhase;
139148
buildActionMask = 2147483647;
140149
files = (
141-
7561272F266794AE0085F3BF /* AnimatedImage.swift in Sources */,
150+
75B14C4E26B4D1CC005757F9 /* AnimatedImage.swift in Sources */,
142151
7561272D266794AE0085F3BF /* AnimatedImageApp.swift in Sources */,
143152
);
144153
runOnlyForDeploymentPostprocessing = 0;

Package.swift

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// swift-tools-version:5.3
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "AnimatedImage",
7+
platforms: [.iOS(.v13)],
8+
products: [
9+
.library(
10+
name: "AnimatedImage",
11+
targets: ["AnimatedImage"]),
12+
],
13+
targets: [
14+
.target(
15+
name: "AnimatedImage",
16+
dependencies: []),
17+
]
18+
)

README.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# SwiftUI.AnimatedImage
2-
SwiftUI AnimatedImage View
2+
3+
SwiftUI animated image view that works on iOS and layout just as SwiftUI.Image
4+
5+
6+
https://user-images.githubusercontent.com/758033/127722908-4d760937-2420-4d78-a9d7-38c5bc6dffe0.mov
7+
8+
## Installation
9+
10+
### Swift Package Manager
11+
12+
```
13+
dependencies: [
14+
.package(url: "https://github.com/krzyzanowskim/SwiftUI.AnimatedImage", from: "1.0")
15+
],
16+
```
17+
18+
## Usage
19+
20+
```swift
21+
import AnimatedImage
22+
23+
struct MyView: View {
24+
25+
var body: some View {
26+
AnimatedImage(data: imageData)
27+
.scaledToFit()
28+
29+
}
30+
31+
}
32+
33+
```

AnimatedImage/AnimatedImage.swift renamed to Sources/AnimatedImage/AnimatedImage.swift

+25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
1+
/*
2+
MIT License
3+
4+
Copyright (c) 2021 Marcin Krzyzanowski
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
*/
24+
125
import SwiftUI
226
import Combine
27+
import UIKit
328

429
public struct AnimatedImage: View {
530
@State private var frameIndex = 0

0 commit comments

Comments
 (0)