Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noppefoxwolf/swiftuiextensions
https://github.com/noppefoxwolf/swiftuiextensions
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/noppefoxwolf/swiftuiextensions
- Owner: noppefoxwolf
- Created: 2019-11-08T15:11:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-26T12:36:33.000Z (almost 4 years ago)
- Last Synced: 2024-05-02T05:46:15.490Z (6 months ago)
- Language: Swift
- Size: 1.12 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftUIExtensions
## Presentation items
```swift
@State var alertItem: AlertItem? = nil
@State var sheetItem: SheetItem? = nil
@State var actionSheetItem: ActionSheetItem? = nilcurrentView
.alert(item: $alertItem, content: { $0.alert })
.sheet(item: $sheetItem, content: { $0 })
.actionSheet(item: $actionSheetItem, content: { $0.actionSheet })
```## Fitting Image Scale
```swift
Image("img").fitting(width: 56, height: 32, contentMode: .fill)
Image("img").fitting(width: 45, height: 86, contentMode: .fit)
```## UIKit Wrapper
- ActivityIndicator
- SafariView## TabBarView
Tab style view that able to keep view presentation state.
```swift
private let tabBarViewStore: TabBarViewStore = .init()TabBarView(store: tabBarViewStore) {
Text("1").tabBarItem(tag: 0, title: "item1", image: UIImage(systemName: "circle.fill"))
Text("2").tabBarItem(tag: 1, title: "item2", image: UIImage(systemName: "circle.fill"))Text("3").tabBarItem(tag: 2, title: "item3", image: UIImage(systemName: "circle.fill"))
}
```## SwiftUIExtensions.UIView
Easy to wrap UIView and optimizing differential update.
```swift
import UIKit
import SwiftUIExtensions
typealias UITextView = SwiftUIExtensions.UIView
``````swift
UITextView(text) { (textView, value, context) in
// call only value changed
uiView.attributedText = NSAttributedString(string: value, options: options)
}
```# Other extensions
[noppefoxwolf/RefreshUI](https://github.com/noppefoxwolf/RefreshUI)