-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,396 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,20 @@ | ||
# | ||
# Be sure to run `pod lib lint CenteredScrollView.podspec' to ensure this is a | ||
# valid spec before submitting. | ||
# | ||
# Any lines starting with a # are optional, but their use is encouraged | ||
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html | ||
# | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'CenteredScrollView' | ||
s.version = '0.1.0' | ||
s.summary = 'A short description of CenteredScrollView.' | ||
|
||
# This description is used to generate tags and improve search results. | ||
# * Think: What does it do? Why did you write it? What is the focus? | ||
# * Try to keep it short, snappy and to the point. | ||
# * Write the description between the DESC delimiters below. | ||
# * Finally, don't worry about the indent, CocoaPods strips it! | ||
|
||
s.version = '1.0.0' | ||
s.summary = 'SwiftUI scroll view that centeres its content when it fits on screen.' | ||
s.description = <<-DESC | ||
TODO: Add long description of the pod here. | ||
SwiftUI scroll view that centeres its content when it fits on screen. | ||
It uses VStack internally to hold content. | ||
DESC | ||
|
||
s.homepage = 'https://github.com/Artur Gruchała/CenteredScrollView' | ||
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' | ||
s.swift_version = '5.3' | ||
s.homepage = 'https://github.com/agruchala/CenteredScrollView' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { 'Artur Gruchała' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/Artur Gruchała/CenteredScrollView.git', :tag => s.version.to_s } | ||
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>' | ||
s.source = { :git => 'https://github.com/agruchala/CenteredScrollView.git', :tag => s.version.to_s } | ||
s.social_media_url = 'https://twitter.com/GruchalaArtur' | ||
|
||
s.ios.deployment_target = '9.0' | ||
s.ios.deployment_target = '13.0' | ||
s.osx.deployment_target = '11.0' | ||
|
||
s.source_files = 'CenteredScrollView/Classes/**/*' | ||
|
||
# s.resource_bundles = { | ||
# 'CenteredScrollView' => ['CenteredScrollView/Assets/*.png'] | ||
# } | ||
|
||
# s.public_header_files = 'Pod/Classes/**/*.h' | ||
# s.frameworks = 'UIKit', 'MapKit' | ||
# s.dependency 'AFNetworking', '~> 2.3' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import SwiftUI | ||
|
||
public struct CenteredScrollView<Content: View>: View { | ||
var content: () -> Content | ||
|
||
public init(@ViewBuilder content: @escaping () -> Content) { | ||
self.content = content | ||
} | ||
public var body: some View { | ||
GeometryReader { geometry in | ||
ScrollView { | ||
VStack(alignment: .center, content: content) | ||
.frame(width: geometry.size.width) | ||
.frame(minHeight: geometry.size.height) | ||
} | ||
} | ||
} | ||
} | ||
|
||
struct CenteredScrollView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
Group { | ||
CenteredScrollView(){ | ||
Text("test") | ||
} | ||
CenteredScrollView(){ | ||
ForEach(1..<20) { | ||
Text("Test \($0)") | ||
.font(.largeTitle) | ||
} | ||
} | ||
} | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...le/CenteredScrollView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
117 changes: 0 additions & 117 deletions
117
...e/CenteredScrollView.xcodeproj/xcshareddata/xcschemes/CenteredScrollView-Example.xcscheme
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
Example/CenteredScrollView.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Example/CenteredScrollView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Oops, something went wrong.