SwiftUIKit

SwiftUIKit is a Swift SDK that adds extra functionality to Swift & SwiftUI.

MIT License

Stars
1.4K
Committers
5

Bot releases are visible (Hide)

SwiftUIKit -

Published by danielsaidi over 1 year ago

This release adds new support for Codable and AppStorage.

This release also adds new list functionality and text editor styling.

From this version, the demo application has been removed. Instead of the demo application, you can use the internal previews directly.

✨ New features

  • Array has new extensions that make it possible to use with Codable and AppStorage.
  • Dictionary has new extensions that make it possible to use with Codable and AppStorage.
  • ImageRepresentable has new resizing tools.
  • ListBadgeIcon is a new view that mimics the color badge icons in System Settings.
  • ListCard is a new view that can be used to create cards for a list or grid.
  • ListDragHandle is a new view to mimic the native iOS list drag handle.
  • ListSectionTitle is a new view that mimics a grouped iOS section title.
  • ListShelfSection is a new view that can be used to create horizontally scrolling shelves in vertically scrolling lists.
  • ProcessInfo has a new static preview property.
  • TextEditorStyle lets you style a TextEditor like a TextField.
  • Image+Symbol is a new Image initializer that serves as a shorthand for .init(systemName:).
  • Image+ListBadgeIcon is a new Image modifier that can be used to convert an image to a color badged icon.

✨ Behavior changes

  • Persisted has been deprecated due to AppStorageCodable.
  • ViewShadowStyle now allows not specifying a shadow color.
  • ViewShadowStyle.badge has been redesigned to look more like a sticker.

🐛 Bug fixes

  • The undimmed presentation detents move some code to after layout to improve behavior.

🗑 Deprecations

  • UndimmedPresentationDetent is renamed to PresentationDetentReference.
  • The .presentationDetents(undimmed:largestUndimmed:selection:) modifier is deprecated and replaced by .presentationDetents(:largestUndimmed:selection:).
SwiftUIKit -

Published by danielsaidi over 1 year ago

✨ New features

  • GestureButton is a new view that can be used to handle multiple gestures with a single button.
  • GestureButtonDefaults is a new class that can be used to configure the default values for the new gesture buttons.
  • LinkText is a new view that lets you combine text and tappable links without Markdown.
  • RepeatGestureTimer is a new class that can be used to trigger a repeating action.
  • ScrollViewGestureButton is a variant of GestureButton that works within a scroll view.
  • SwipeGestureViewModifier is a new view modifier that exposes the View+onSwipeGesture extension to DocC.
  • UndimmedPresentationDetentsViewModifier is a new view modifier that exposes the View+presentationDetents extension to DocC.

💡 Behavior changes

  • ImageRenderer now renders with correct scale - thanks alfredcc for this!

🗑 Deprecations

SwiftUIKit -

Published by danielsaidi almost 2 years ago

✨ New features

  • FormTextField is now available in iOS 13 as well.
  • LinearProgressBar is a new, style-based progress view.
  • ListSelectItem now supports providing a custom select indicator view.
  • ScrollViewHeader is a new header view with stretch and parallax support.
  • SwiftPreviewInspector and StandardSwiftPreviewInspector are new types for detecting SwiftUI preview mode.
  • UndimmedPresentationDetent is a new enum that is used to define undimmed detents with View+PresentationDetents.
  • View+PresentationDetents now supports specifying a largestUndimmed presentation detent.

💡 Behavior changes

  • FormActionButton now uses true as default value for the dimmed modifier.
  • FormActionButtonStyle now lets you style more parts of the form action button.
  • FormText no longers forces lowercase to its title.
  • SearchBar no longer adds a divider below the text field.
  • TextFieldClearButton now animates in the clear button.

🐛 Bug fixes

  • CircularProgressBar is no longer greedy and only allocates the space it needs.

🗑 Deprecations

  • The entire CollectionView namespace has been deprecated, since it's no longer needed on tvOS.

💥 Breaking Changes

  • CircularProgressBarStyle has been renamed to CircularProgressBar.Style.
  • ErrorAlertConvertible has a new errorButtonText property to avoid the hard-coded "OK".
  • ScanCodeGenerator has a cleaner function name for generating a scan code.
SwiftUIKit -

Published by danielsaidi about 2 years ago

This major version removes all previously deprecated logic to make the library tighter and cleaner.

If you need any parts of the library that have now been removed, just grab them from the previous 2.9 versions.

✨ New features

  • The disableDynamicType view extension now accepts a size category.
  • The ListSelectItem now accepts a customizable checkmark icon.

💥 Breaking Changes

  • The Documents namespace has been removed without being previously deprecated.
  • The .safeAreaInsets environment value has been removed without being previously deprecated.
  • The Views/DetailPanel namespace has been removed without being previously deprecated.
  • The UIViewWrapper view has been removed without being previously deprecated.
SwiftUIKit -

Published by danielsaidi about 2 years ago

This version removes the MockingKit dependency.

SwiftUIKit -

Published by danielsaidi about 2 years ago

This version makes ocmpiling for macOS work in Xcode 14.

The version also deprecates more things, such as the list items. The list views are deprecated since later SwiftUI versions makes great use of the Label view to render things natively. The list views just adds extra complexity with little gains.

One thing that the list views did well, though, was to make the entire list items tappable, where native labels only take up as much space as they need, even in lists. To address this, there is a new button style called ListButtonStyle, which you can apply to an entire list to make all buttons behave the same way.

✨ New features

  • ListButtonStyle makes the button span across the entire width and applies a rectangular content shape.

💡 Behavior changes

  • List items will render differently, without the padding.

🐛 Bug fixes

  • This version fixes compile errors on macOS by temporarily only making some types available for iOS.

🗑 Deprecations

  • ListButton has been deprecated.
  • ListDisclosureIndicator has been deprecated.
  • ListHeader has been deprecated.
  • ListItem has been deprecated.
  • ListNavigationButton has been renamed to NavigationButton.
  • ListNavigationLink has been deprecated.
  • ListText has been deprecated.
  • ListTextContent has been deprecated.
  • ListToggle has been deprecated.
SwiftUIKit -

Published by danielsaidi about 2 years ago

This version adjusts the undimmed presentation detents view extension, that has stopped working in later Xcode 14 betas.

The fix makes sure to always inject a .large detents into the provided set. This is hopefully temporary.

SwiftUIKit -

Published by danielsaidi about 2 years ago

This version adds a the possibility to present custom sized, undimmed sheets in SwiftUI.

This version also adds a backported version of the native SwiftUI 4 ImageRenderer. The backported version is only available in iOS 15 and before. In iOS 16 and later, you'll get the native one.

✨ New features

  • Font+FontRepresentable adds new ways to create SwiftUI fonts with platform-agnostic ones.
  • ImageRepresentable+Size adds resizing to macOS, tvOS and watchOS as well.
  • ImageRenderer is a new type that replaces the old View+Snapshot extension and serves as a bridge between iOs 16 and earlier versions.
  • ImageRenderer+Image extends the SwiftUI 4 renderer with a platform-agnostic image property.
  • ImageRenderer+Scale extends the SwiftUI 4 renderer with new scale initializers.
  • View+PresentationDetents adds new presentationDetents(undimmed:) view modifiers.

🗑 Deprecations

  • Image+Snapshot has been replaced by the new ImageRenderer.
SwiftUIKit -

Published by danielsaidi over 2 years ago

✨ New features

  • Color has new hex string- and int-based initializers.
  • ColorRepresentable is a new typealias that bridges NSColor and UIColor.
  • ColorRepresentable has new hex string- and int-based initializers.
  • ErrorAlerter is a new protocol that can be implemented by any type that can alert errors using an AlertContext.
  • ErrorAlertConvertible is a new protocol that can be implemented by any error that can describe itself as an error Alert.
  • FontRepresentable is a new typealias that bridges NSFont and UIFont.
  • Persisted can now be used with SwiftUI and will properly update observing views.

💡 Behavior changes

  • PresentationContext is now open instead of public.
  • DocumentCamera now passes on its actions instead of itself.
  • Unit tests no longer use Quick and Nimble.

🗑 Deprecations

  • DocumentGroupOnboardingScreen has been renamed to DocumentGroupSheet.
  • DocumentGroupOnboardingScreenError has been renamed to DocumentGroupSheetError.
  • DocumentGroupOnboardingScreen presentAsOnboarding has been renamed to presentFromDocumentGroup.
  • ImageResource has been renamed to ImageRepresentable.
  • ShadowStyle has been renamed to ViewShadowStyle to not conflict with the new SwiftUI 4 ShadowStyle that comes in Xcode 14.
SwiftUIKit -

Published by danielsaidi over 2 years ago

This version adds focus and printing utils, makes the system font picker work better on multiple platforms and deprecates web views.

Web views can be found in the new WebViewKit from now on.

✨ New features

  • AlertContextFocusedValueKey is a new type that can be used to bind and access an focused alert.
  • FullScreenModalContextFocusedValueKey is a new type that can be used to bind and access a focused full.
  • ItemPrinter is a new protocol that can be implemented by types that can print printable items.
  • ItemPrintingView is a view protocol that adds item printing functionality to any view.
  • PrintableItem defines a list of printable items, currently only pdf documents.
  • SheetContextFocusedValueKey is a new type that can be used to bind and access a focused sheet.
  • StandardItemPrinter is an multi-platform ItemPrinter implementation that prints using UIPrintInteractionController.

💡 Behavior changes

  • SystemFontPicker has been adjusted to work better on various platforms.
  • SystemFontPickerFont has been adjusted to work better on various platforms.

🐛 Bug fixes

  • SystemFontPicker now uses the provided fonts instead of all.

🗑 Deprecations

  • SafariWebView has been deprecated - use WebViewKit instead.
  • WebView has been deprecated - use WebViewKit instead.
SwiftUIKit -

Published by danielsaidi over 2 years ago

✨ New features

  • PageIndicator is a new view that mimics the page dots in a page view.
  • PageIndicatorDisplayMode is a new enum that can be used to control indicator views.
  • PageIndicatorStyle is a new enum that can be used to style indicator views.
  • PageView is now available for macOS as well.

💡 Behavior changes

  • PageView is now generic and no longer generates AnyView views.

💥 Breaking Changes

  • PageView for iOS is now generic with new initializer signatures.
  • PageView indexDisplayMode is now called pageIndicatorDisplayMode.
SwiftUIKit -

Published by danielsaidi over 2 years ago

This release adds a bunch of new views and features as well as new macOS utils.

This release also deprecates a bunch of stuff to make the library more focused.

Note that WebView now wraps a WKWebView instead of a SFSafariViewController. If you want the old behavior, use the new SafariWebView.

✨ New features

  • DetailPanel is a new macOS view that mimics a trailing detail panel.
  • DetailPanelButtonGroup is a new macOS view that can be used to mimic a native, segmented button group.
  • DetailPanelContainer is a new macOS view with a main content view and a trailing detail panel.
  • DetailPanelContext is a new macOS class that can be used with the new DetailPanelPresenter.
  • DetailPanelForm is a new macOS view that can be used to wrap form content within a SideBar.
  • DetailPanelHeader is a new macOS view that can adjust the provided text to look like a native detail panel header.
  • DetailPanelPresenter is a new macOS protocol that can be implemented to add detail panel functionality to the implementing type.
  • ForEachPicker is a new view that works like the ListPicker, but doesn't wrap the content in a List.
  • ForEachMultiPicker is a new view that works like the MultiListPicker, but doesn't wrap the content in a List.
  • Form has a new detailPanelForm modifier.
  • FormActionButtonStyle now has mutable properties.
  • ListItemSubtitle is a new view that copies its behavior from the deprecated MenuListSubtitle.
  • ListText has a new icon and subtitle parameter.
  • ListTextContent is a new view that just renders the content of a ListText.
  • SafariWebView is a new name for the previous version of WebView.
  • ScanCodeGenerator generateCodeView is now a protocol implementation.
  • ScanCodeType now supports aztek and pdf417 as well.
  • ScanCodeType now implements more protocols to make it more versatile.
  • ScanCodeType has a new code128 case that replaces barcode.
  • ScanCodeType.name is now the capitalized version of the raw string value.
  • SidebarPresenter is a new macOS protocol that can be implemented to add sidebar functionality to the implementing type.
  • SystemFontPicker is a new view that uses a Picker.
  • SystemFontForEachPicker is a new view that uses a ForEach picker instead of a List.
  • SystemFontListPicker now has a fonts init parameter.
  • SystemFontListPicker now has an itemFontSize init parameter.
  • SystemFontListPicker now has a dismissAfterPick init parameter.
  • SystemFontPickerFonts initializer and properties are now public.
  • SystemFontPickerFont is a new public struct that is used by the various font pickers.
  • SystemFontPickerItem is a new view that can be used to display a picked system font.
  • Text has a new detailPanelHeader modifier.
  • UrlOpener now supports macOS as well.

💡 Behavior changes

  • ListItem now only applies a min height on iOS.
  • ListPicker now uses a ForEachPicker for each section.
  • ListMultiPicker now uses a ForEachMultiPicker for each section.
  • ScanCodeType.barcode is now an alias for ScanCodeType.code128.
  • WebView now wraps a WKWebView instead of a SFSafariViewController.

🗑 Deprecations

  • AsyncImage has been deprecated. Use SwiftUI AsyncImage instead.
  • AsyncImageLoader has been deprecated. Use SwiftUI AsyncImage instead.
  • BlurView and View+Blur is deprecated. Use the native material approach instead.
  • ColorBadge has been deprecated.
  • FontListPicker has been renamed to SystemFontListPicker.
  • FullHeightView has been deprecated.
  • FullSizeView has been deprecated.
  • FullWidthView has been deprecated.
  • ListPicker no longer has a title.
  • ListMultiPicker no longer has a title.
  • SystemFontListPicker no longer has a title.
  • Presentation/Toast has been deprecated. Use the new SystemNotification library instead.
  • View+Alert alert(context:) has been renamed to alert(_ :).
  • View+FullScreenCover fullScreenCover(context:) has been renamed to fullScreenCover(_ :).
  • View+Sheet sheet(context:) has been renamed to sheet(_ :).

💥 Breaking Changes

  • Color.clearInteractable has been deprecated and should not be used anymore.
  • Picker has been removed, since it caused conflicts with SwiftUI.
  • UrlOpener default functions are no longer part of the protocol definition.
  • View.clearInteractable has been deprecated and should not be used anymore.
SwiftUIKit -

Published by danielsaidi almost 3 years ago

💡 Behavior changes

  • ListNavigationButton is now available on all platforms.
  • ListDisclosureIndicator is now available on all platforms.

🗑 Deprecations

  • ListButtonLink has been renamed to ListNavigationButton.
SwiftUIKit -

Published by danielsaidi almost 3 years ago

This release adjust the ListToggle.

💡 Behavior changes

  • ListToggle now applies .labelsHidden() to the toggle, to make it take up less space.
SwiftUIKit -

Published by danielsaidi almost 3 years ago

This release adds a brand new "list item" concept that replaces the previous "menu list" one.

NOTE This release was revised, with some list view names shortened and a few more list view items added. This is the official 2.1, but it is also released as a 2.1.1 to avoid dependency cache problems.

✨ New features

  • EdgeInsets has a new init(all:) initializer.

  • EdgeInsets has a new init(horizontal:,vertical:) initializer.

  • Label has a new init(String, Image) initializer.

  • View+Frame has a new frame(square:) view extension.

  • View+DynamicType has a new disableDynamicType() view extension.

  • ListItem is a new view that can be used to make items in a list get the same style and behavior.

  • ListButton is a new view that wraps its content in a ListItem that is embedded in a Button.

  • ListButtonLink is a new view that wraps its content in a ListButton and appends a trailing ListDisclosureIndicator.

  • ListDisclosureIndicator is a new view that imitates and iOS navigation link arrow.

  • ListNavigationLink is a new view that wraps its content in a ListItem that is embedded in a NavigationLink.

  • ListSelectItem is a new view that wraps its content in a ListItem and applies a checkmark if the item is selected.

  • ListText is a new view that wraps a Text view in a ListItem.

  • ListToggle is a new view that wraps its content in a ListItem and appends a trailing Toggle.

🗑 Deprecations

  • The MenuList namespace is deprecated and replaced with the new List namespace.
SwiftUIKit -

Published by danielsaidi about 3 years ago

This version requires Xcode 13 and later, since it refers to the latest api:s.

Parts of the library that have native corresponding parts in newer versions of SwiftUI, like SearchBar. They will be around until the library targets the versions of SwiftUI where they were introduced.

✨ New features

  • Color+Codable is a new extension that makes Color codable.
  • Color+Random now lets you randomize the color opacity as well.
  • EnvironmentValues+SafeAreaInsets lets you read the safe are insets of the key window.
  • FormActionButton can now be provided with a custom style.
  • FormActionButtonStyle can now be configured with a custom style.
  • MenuListIcon has a new emoji-based initializer.
  • MenuListItem now lets you use any custom content builder.
  • MenuListItemStack is a new view that lets you reuse the spacing and tap behavior.
  • MenuListSection is a new view for menu list sections.
  • MenuListSlider is a new view for menu list sliders.
  • MenuListSubtitle is a new view for menu list subtitles.
  • MenuListToggle is a new view for menu list toggles.
  • MultilineText is a new text view that can be used when a multiline text is cut off with ...
  • MultiPicker is a new, generic multi item picker. It will probably replace SimpleMultiPicker in due time.
  • Persisted now lets you inject a custom store.
  • Picker is a new, generic single item picker. It will probably replace SimplePicker in due time.
  • PickerListItem is a new protocol that can be used in Picker lists.
  • PickerSection is a new, generic struct that can be used to divide a Picker and MultiPicker into sections.
  • ShadowStyle has a new formActionButton type.
  • ShadowStyle has zero defaults for x and y.
  • SystemColor has a bunch of new colors.
  • SystemColor is now Codable and Equatable.
  • Text+Markdown is a new view extension that provides a new Text(markdown:) initializer.
  • UrlSharing is a new protocol that any view can implement to easily be able to share urls.
  • View+Autosave is a new view extension that provides a customizable autosave view modifier.

💡 Behavior changes

  • FormActionButtonStyle no longer applies a primary text color.
  • FormActionButtonStyle no longer applies a shadow by default. You can define one with the static shadowStyle property.

💥 Breaking Changes

  • All deprecated parts of the library have been removed.
  • MenuListItemIcon has been renamed to MenuListIcon.
  • SystemColor no longer auto-implements SimplePickerValue.
  • UserDefaultsPersisted has been renamed to Persisted.
SwiftUIKit -

Published by danielsaidi about 3 years ago

💡 Behavior changes

This release renames ActionButton and ActionButtonStyle to FormActionButton and FormActionButtonStyle, since the name "action button" is too general.

🐛 Bug fixes

  • This release fixes build errors on tvOS and macOS.

🗑 Deprecations

  • ActionButton and ActionButtonStyle has been deprecated.
SwiftUIKit -

Published by danielsaidi about 3 years ago

✨ New features

  • FlipView has a new isFlipped binding, so that it can be read from outside as well.
  • FormText now supports iOS 13.
  • FormText has a new trailingView property.
  • There is a new UIImage+Rotated extension.

💥 Breaking Changes

  • ScanCodeGenerator functions of parameter name is not omitted.
SwiftUIKit -

Published by danielsaidi about 3 years ago

✨ New features

  • FormText is a new view to present text in List forms.
  • FormTextEditor is a new view to present text editors in List forms.
  • FormTextField is a new view to present text fields in List forms.
  • ActionButton is a new button that resembles the action button in e.g. Contacts.
  • ActionButtonStyle is a new button style that can be used for action buttons.
  • ScanCodeGenerator is a new protocol for types that can generate scan codes.
  • StandardScanCodeGenerator is a new, standard implementation of ScanCodeGenerator.

🗑 Deprecations

  • QrCodeGenerator has been deprecated due to the new QrCodeGenerator.
  • StandardQrCodeGenerator has been deprecated due to the new StandardQrCodeGenerator.
SwiftUIKit -

Published by danielsaidi about 3 years ago

✨ New features

  • FlipView has a new flipDuration property.
  • FlipView is now supported by all platforms.
  • ImageResource is now supported by watchOS and tvOS as well.
  • MenuListItemIcon is a new view for menu list items.

🐛 Bug fixes

  • FlipView handles flipping and view transitions better than before.
  • ImagePicker now completes with failure if original image is missing.

🗑 Deprecations

  • FlippableView has been renamed to FlipView.

💥 Breaking Changes

  • ImagePicker's result now uses a raw UIImage instead of an Image.