From 7b87898222523df9fb9eafee7c7fc565b3c8eabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bednorz?= Date: Sat, 14 Mar 2026 03:41:28 +0100 Subject: [PATCH] docs: rewrite README with accurate content and examples --- PLAN.md | 80 ------------------------------------------------------- README.md | 71 +++++++++++++++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 102 deletions(-) delete mode 100644 PLAN.md diff --git a/PLAN.md b/PLAN.md deleted file mode 100644 index cdb06d8..0000000 --- a/PLAN.md +++ /dev/null @@ -1,80 +0,0 @@ -# Audit & Improvement Plan - -## PR 1 — Modernizacja CI -**Branch:** `ci/modernize-workflows` -**Commit:** `ci: modernize GitHub Actions workflows` - -- `ContinuousIntegration.yml`: `checkout@v2` → `checkout@v4`, `macos-latest` → `macos-15`, dodać `swift test` -- `swiftlint.yml`: `checkout@v1` → `v4`, zaktualizować `norio-nomura/action-swiftlint` - ---- - -## PR 2 — Naprawa SwiftLint -**Branch:** `fix/swiftlint-config` -**Commit:** `fix: repair SwiftLint configuration` - -- Usunąć `Sources` z `excluded` (cały kod źródłowy jest wyciszony) -- Usunąć zduplikowany klucz `excluded:` -- Podnieść lub usunąć `line_length: 140` - ---- - -## PR 3 — Aktualizacja wersji Swift -**Branch:** `chore/update-swift-version` -**Commit:** `chore: align Swift version across configuration files` - -- `.swift-version`: `5.5` → `6.1` -- `Package.swift`: `swift-tools-version: 5.10.0` → `6.1` - ---- - -## PR 4 — Migracja Preview API -**Branch:** `refactor/preview-macro` -**Commit:** `refactor: migrate previews from PreviewProvider to #Preview macro` - -- `SlidableImage.swift`, `Arrows.swift`, `Triangle.swift`: zamienić przestarzałe `PreviewProvider` na `#Preview {}` - ---- - -## PR 5 — Zastąpienie Jazzy przez DocC -**Branch:** `ci/replace-jazzy-with-docc` -**Commit:** `ci: replace Jazzy documentation with DocC` - -- Usunąć `PublishDocumentation.yml` -- Dodać `docs.yml` (DocC + GitHub Pages via Actions) -- Zmienić Pages source na `workflow` - ---- - -## PR 6 — Testy -**Branch:** `test/add-unit-tests` -**Commit:** `test: add test target and unit tests` - -- Dodać `testTarget` do `Package.swift` -- Pokryć testami: obliczenia maski, boundary conditions, inicjalizacje - ---- - -## PR 7 — README -**Branch:** `docs/improve-readme` -**Commit:** `docs: rewrite README with accurate content and examples` - -- Naprawić literówkę `Instalation` → `Installation` -- Zaktualizować badge CI -- Dodać badge Swift Package Index -- Rozszerzyć przykłady użycia -- Dodać link do dokumentacji (po PR 5) - ---- - -## Kolejność realizacji - -``` -PR 1, PR 2, PR 3 ← równolegle - ↓ - PR 4, PR 6 - ↓ - PR 5 - ↓ - PR 7 -``` diff --git a/README.md b/README.md index 367b061..b302bb2 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,71 @@ # SlidableImage -![iOS CI](https://github.com/quver/SlidableImage/workflows/iOS%20CI/badge.svg) -[![GitHub license](https://img.shields.io/github/license/quver/SlidableImage.svg)]() + +[![CI](https://github.com/quver/SlidableImage/actions/workflows/ci.yml/badge.svg)](https://github.com/quver/SlidableImage/actions/workflows/ci.yml) +[![GitHub license](https://img.shields.io/github/license/quver/SlidableImage.svg)](https://github.com/quver/SlidableImage/blob/main/LICENSE) [![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://swift.org/package-manager) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fquver%2FSlidableImage%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/quver/SlidableImage) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fquver%2FSlidableImage%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/quver/SlidableImage) -Easy to use library for before & after images. One-line initialization and SwiftUI. +SwiftUI before & after image slider with a draggable divider. ## Requirements -- iOS 15 -- Swift 5 +- iOS 15+ / macOS 12+ +- Swift 6.1+ +- Xcode 16.4+ -## Instalation +## Installation -This library support +### Swift Package Manager -- Swift Package Manager +Add to your `Package.swift`: -## Using +```swift +dependencies: [ + .package(url: "https://github.com/quver/SlidableImage.git", from: "5.0.0") +] +``` -![Code example](Assets/code.png) +Or add it directly in Xcode via **File → Add Package Dependencies**. -### Constructor +## Usage -```swfit -init(@ViewBuilder arrows: @escaping () -> ArrowsIcon, - @ViewBuilder leftView: @escaping () -> LeftView, - @ViewBuilder rightView: @escaping () -> RightView) +```swift +SlidableImage( + arrows: { Arrows() }, + leftView: { Image("before") }, + rightView: { Image("after") } +) ``` -### Arrows +### Custom arrows ```swift -init(arrowColor: Color = .white, backgroundColor: Color = .gray) +SlidableImage( + arrows: { + Arrows(arrowColor: .black, backgroundColor: .white) + }, + leftView: { Image("before") }, + rightView: { Image("after") } +) ``` -## Author +### Custom divider -Paweł Bednorz, Quver +Pass any SwiftUI view as the `arrows` parameter: + +```swift +SlidableImage( + arrows: { + Image(systemName: "arrow.left.and.right") + .padding() + .background(.ultraThinMaterial, in: Circle()) + }, + leftView: { Image("before") }, + rightView: { Image("after") } +) +``` -## License +## Documentation -SlidableImage Lib and Slider graphic are available under the MIT license. -Check the LICENSE file for more information. +Full API documentation is available at [quver.github.io/SlidableImage](https://quver.github.io/SlidableImage/documentation/slidableimage/).