diff --git a/GridDemo iOS/ModularGrid/ModularGridView.swift b/GridDemo iOS/ModularGrid/ModularGridView.swift index 18f5655..48d05e7 100644 --- a/GridDemo iOS/ModularGrid/ModularGridView.swift +++ b/GridDemo iOS/ModularGrid/ModularGridView.swift @@ -12,9 +12,7 @@ struct ModularGridView: View { Card(title: "\(item.number)", color: item.color) } .padding(8) - .gridStyle( - self.style - ) + } .navigationBarTitle("Modular Grid", displayMode: .inline) .navigationBarItems( @@ -32,6 +30,9 @@ struct ModularGridView: View { .sheet(isPresented: $showSettings) { ModularGridSettingsView(style: self.$style).accentColor(.purple) } + .gridStyle( + self.style + ) } func addMoreItems() { diff --git a/GridDemo iOS/StaggeredGrid/StaggeredGridView.swift b/GridDemo iOS/StaggeredGrid/StaggeredGridView.swift index 26886b5..a53eb62 100644 --- a/GridDemo iOS/StaggeredGrid/StaggeredGridView.swift +++ b/GridDemo iOS/StaggeredGrid/StaggeredGridView.swift @@ -31,12 +31,12 @@ struct StaggeredGridView: View { } ) - .gridStyle( - self.style - ) .sheet(isPresented: $showSettings) { StaggeredGridSettingsView(style: self.$style).accentColor(.purple) } + .gridStyle( + self.style + ) } func shuffleImages() { diff --git a/GridDemo macOS/Info.plist b/GridDemo macOS/Info.plist index e87993d..ac20487 100644 --- a/GridDemo macOS/Info.plist +++ b/GridDemo macOS/Info.plist @@ -20,6 +20,8 @@ 1.0 CFBundleVersion 1 + LSApplicationCategoryType + public.app-category.developer-tools LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSMainStoryboardFile diff --git a/GridDemo.xcodeproj/project.pbxproj b/GridDemo.xcodeproj/project.pbxproj index 326241d..1a1312f 100644 --- a/GridDemo.xcodeproj/project.pbxproj +++ b/GridDemo.xcodeproj/project.pbxproj @@ -555,7 +555,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1130; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1140; TargetAttributes = { FAA2C96623DEAECC00FBDE39 = { CreatedOnToolsVersion = 11.3.1; @@ -786,12 +786,64 @@ FAA2C94023DEAD2600FBDE39 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; }; name = Debug; }; FAA2C94123DEAD2600FBDE39 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; }; name = Release; }; @@ -971,6 +1023,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "GridDemo macOS/GridDemo_macOS.entitlements"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; @@ -1045,6 +1098,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "GridDemo macOS/GridDemo_macOS.entitlements"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; diff --git a/Sources/Grid/Styles/Style/EnvironmentValues+GridStyle.swift b/Sources/Grid/Styles/Style/EnvironmentValues+GridStyle.swift index ab640cd..1a65370 100644 --- a/Sources/Grid/Styles/Style/EnvironmentValues+GridStyle.swift +++ b/Sources/Grid/Styles/Style/EnvironmentValues+GridStyle.swift @@ -1,6 +1,6 @@ import SwiftUI -extension EnvironmentValues { +public extension EnvironmentValues { var gridStyle: GridStyle { get { return self[GridStyleKey.self] diff --git a/Sources/Grid/Styles/Style/GridStyleKey.swift b/Sources/Grid/Styles/Style/GridStyleKey.swift index 5d253cb..8bb62a0 100644 --- a/Sources/Grid/Styles/Style/GridStyleKey.swift +++ b/Sources/Grid/Styles/Style/GridStyleKey.swift @@ -1,5 +1,5 @@ import SwiftUI struct GridStyleKey: EnvironmentKey { - static let defaultValue: GridStyle = ModularGridStyle(columns: .min(100), rows: .min(100)) + static let defaultValue: GridStyle = ModularGridStyle(columns: .min(100), rows: .fixed(100)) } diff --git a/Sources/Grid/Styles/Style/View+GridStyle.swift b/Sources/Grid/Styles/Style/View+GridStyle.swift index 375a67a..091eefb 100644 --- a/Sources/Grid/Styles/Style/View+GridStyle.swift +++ b/Sources/Grid/Styles/Style/View+GridStyle.swift @@ -1,8 +1,8 @@ import SwiftUI -extension View { +public extension View { /// Sets the style for `Grid` within the environment of `self`. - public func gridStyle(_ style: S) -> some View where S : GridStyle { + @inlinable func gridStyle(_ style: S) -> some View where S : GridStyle { self.environment(\.gridStyle, style) } }