Skip to content

Commit

Permalink
Merge pull request #56 from fermoya/fix/backwards-compatibility
Browse files Browse the repository at this point in the history
Fix/backwards compatibility
  • Loading branch information
fermoya authored Jun 7, 2020
2 parents 863855f + cf841e8 commit 39856ab
Show file tree
Hide file tree
Showing 69 changed files with 456 additions and 99 deletions.
2 changes: 2 additions & 0 deletions Sources/SwiftUIPager/Helpers/Buildable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import Foundation

/// Adds a helper function to mutate a properties and help implement _Builder_ pattern
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
protocol Buildable { }

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Buildable {

/// Mutates a property of the instance
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftUIPager/Helpers/PositionAlignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import CoreGraphics

/// `Alignment` determines the focused page alignment inside `Pager`
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public enum PositionAlignment {
/// Sets the alignment to be centered
case center
Expand Down
3 changes: 3 additions & 0 deletions Sources/SwiftUIPager/Helpers/SizeViewModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import SwiftUI

/// This modifier wraps a view into a `GeometryReader` and tracks the available space by using `SizePreferenceKey` on the content
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
struct SizeViewModifier: ViewModifier {

@Binding var size: CGSize
Expand All @@ -27,6 +28,7 @@ struct SizeViewModifier: ViewModifier {

}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension View {

func onReload(perform: @escaping () -> Void) -> some View {
Expand All @@ -39,6 +41,7 @@ extension View {

}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension View {

/// Tracks the size available for the view
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftUIPager/Helpers/View+Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import SwiftUI

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension View {

func frame(size: CGSize) -> some View {
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftUIPager/Pager+Buildable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import SwiftUI

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager: Buildable {

/// Swipe direction for a vertical `Pager`
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftUIPager/Pager+Helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import SwiftUI

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {

/// Work around to avoid @State keeps wrong value
Expand Down
3 changes: 3 additions & 0 deletions Sources/SwiftUIPager/Pager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import SwiftUI
/// - 30 px of vertical insets
/// - 0.6 shrink ratio for items that aren't focused.
///
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Pager<Element, ID, PageView>: View where PageView: View, Element: Equatable, ID: Hashable {

/// `Direction` determines the direction of the swipe gesture
Expand Down Expand Up @@ -181,6 +182,7 @@ public struct Pager<Element, ID, PageView>: View where PageView: View, Element:

}

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager where ID == Element.ID, Element : Identifiable {

/// Initializes a new Pager.
Expand All @@ -198,6 +200,7 @@ extension Pager where ID == Element.ID, Element : Identifiable {

// MARK: Gestures

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {

/// `DragGesture` customized to work with `Pager`
Expand Down
2 changes: 1 addition & 1 deletion SwiftUIPager.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SwiftUIPager"
s.version = "1.6.0"
s.version = "1.6.1"
s.summary = "Native pager for SwiftUI. Easily to use, easy to customize."

s.description = <<-DESC
Expand Down
48 changes: 24 additions & 24 deletions SwiftUIPager.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-maccatalyst</string>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -16,75 +16,76 @@
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-x86_64-simulator</string>
<string>watchos-i386-simulator</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>i386</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>watchos-armv7k_arm64_32</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7k</string>
<string>arm64_32</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>watchos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-i386-simulator</string>
<string>macos-x86_64</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>macos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>macos-x86_64</string>
<string>tvos-arm64</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>tvos</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>tvos-arm64</string>
<string>tvos-x86_64-simulator</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>tvos</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<string>ios-x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -94,20 +95,19 @@
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>watchos-armv7k_arm64_32</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SwiftUIPager.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>armv7k</string>
<string>arm64_32</string>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>watchos</string>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Swift
import SwiftUI
@_exported import SwiftUIPager
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
public enum HorizontalSwipeDirection {
case leftToRight
Expand Down Expand Up @@ -54,8 +55,10 @@ extension Pager {
public func padding(_ insets: SwiftUI.EdgeInsets) -> SwiftUIPager.Pager<Element, ID, PageView>
public func padding(_ edges: SwiftUI.Edge.Set = .all, _ length: CoreGraphics.CGFloat? = nil) -> SwiftUIPager.Pager<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public enum PositionAlignment {
case center
case justified(CoreGraphics.CGFloat)
case start(CoreGraphics.CGFloat)
case end(CoreGraphics.CGFloat)
public static var start: SwiftUIPager.PositionAlignment {
Expand All @@ -64,22 +67,34 @@ public enum PositionAlignment {
public static var end: SwiftUIPager.PositionAlignment {
get
}
public static var justified: SwiftUIPager.PositionAlignment {
get
}
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Pager<Element, ID, PageView> : SwiftUI.View where Element : Swift.Equatable, ID : Swift.Hashable, PageView : SwiftUI.View {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], id: Swift.KeyPath<Element, ID>, @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
public var body: some SwiftUI.View {
get
}
public typealias Body = @_opaqueReturnTypeOf("$s12SwiftUIPager5PagerV4bodyQrvp", 0) 🦸<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager where Element : Swift.Identifiable, ID == Element.ID {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Hashable {}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Swift
import SwiftUI
@_exported import SwiftUIPager
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
public enum HorizontalSwipeDirection {
case leftToRight
Expand Down Expand Up @@ -54,8 +55,10 @@ extension Pager {
public func padding(_ insets: SwiftUI.EdgeInsets) -> SwiftUIPager.Pager<Element, ID, PageView>
public func padding(_ edges: SwiftUI.Edge.Set = .all, _ length: CoreGraphics.CGFloat? = nil) -> SwiftUIPager.Pager<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public enum PositionAlignment {
case center
case justified(CoreGraphics.CGFloat)
case start(CoreGraphics.CGFloat)
case end(CoreGraphics.CGFloat)
public static var start: SwiftUIPager.PositionAlignment {
Expand All @@ -64,22 +67,34 @@ public enum PositionAlignment {
public static var end: SwiftUIPager.PositionAlignment {
get
}
public static var justified: SwiftUIPager.PositionAlignment {
get
}
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Pager<Element, ID, PageView> : SwiftUI.View where Element : Swift.Equatable, ID : Swift.Hashable, PageView : SwiftUI.View {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], id: Swift.KeyPath<Element, ID>, @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
public var body: some SwiftUI.View {
get
}
public typealias Body = @_opaqueReturnTypeOf("$s12SwiftUIPager5PagerV4bodyQrvp", 0) 🦸<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager where Element : Swift.Identifiable, ID == Element.ID {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Hashable {}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Foundation
import Swift
import SwiftUI
@_exported import SwiftUIPager
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
public enum HorizontalSwipeDirection {
case leftToRight
Expand Down Expand Up @@ -54,8 +55,10 @@ extension Pager {
public func padding(_ insets: SwiftUI.EdgeInsets) -> SwiftUIPager.Pager<Element, ID, PageView>
public func padding(_ edges: SwiftUI.Edge.Set = .all, _ length: CoreGraphics.CGFloat? = nil) -> SwiftUIPager.Pager<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public enum PositionAlignment {
case center
case justified(CoreGraphics.CGFloat)
case start(CoreGraphics.CGFloat)
case end(CoreGraphics.CGFloat)
public static var start: SwiftUIPager.PositionAlignment {
Expand All @@ -64,22 +67,34 @@ public enum PositionAlignment {
public static var end: SwiftUIPager.PositionAlignment {
get
}
public static var justified: SwiftUIPager.PositionAlignment {
get
}
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Pager<Element, ID, PageView> : SwiftUI.View where Element : Swift.Equatable, ID : Swift.Hashable, PageView : SwiftUI.View {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], id: Swift.KeyPath<Element, ID>, @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
public var body: some SwiftUI.View {
get
}
public typealias Body = @_opaqueReturnTypeOf("$s12SwiftUIPager5PagerV4bodyQrvp", 0) 🦸<Element, ID, PageView>
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager where Element : Swift.Identifiable, ID == Element.ID {
public init(page: SwiftUI.Binding<Swift.Int>, data: [Element], @SwiftUI.ViewBuilder content: @escaping (Element) -> PageView)
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension Pager {
}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.HorizontalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.VerticalSwipeDirection : Swift.Hashable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Equatable {}
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
extension SwiftUIPager.Pager.SwipeInteractionArea : Swift.Hashable {}
Binary file not shown.
Loading

0 comments on commit 39856ab

Please sign in to comment.