Skip to content

Commit

Permalink
CenteredScrollView 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agruchala committed Dec 11, 2021
1 parent 0ca4be8 commit 542aba0
Show file tree
Hide file tree
Showing 37 changed files with 1,396 additions and 171 deletions.
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Xcode
# macOS
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
.DS_Store

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
# Xcode
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
Expand All @@ -11,22 +24,45 @@ build/
!default.mode2v3
*.perspectivev3
!default.perspectivev3

xcuserdata/
*.xccheckout
profile
## Obj-C/Swift specific
*.moved-aside
DerivedData
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
# Bundler
timeline.xctimeline
playground.xcworkspace
.bundle

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/
Carthage/Build

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
Expand All @@ -35,3 +71,38 @@ Carthage/Build
# `pod install` in .travis.yml
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
archives/
xcframeworks/
42 changes: 10 additions & 32 deletions CenteredScrollView.podspec
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
34 changes: 34 additions & 0 deletions CenteredScrollView/Classes/CenteredScrollView.swift
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.
16 changes: 6 additions & 10 deletions Example/CenteredScrollView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
607FACE51AFB9204008FA782 /* CenteredScrollView_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CenteredScrollView_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = "<group>"; };
6E95BF34E251549D9A74AF04 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
C186DE09FF275843862938E8 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = "<group>"; };
D46642B0B79355E4B1F7B825 /* CenteredScrollView.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = CenteredScrollView.podspec; path = ../CenteredScrollView.podspec; sourceTree = "<group>"; };
6E95BF34E251549D9A74AF04 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
C186DE09FF275843862938E8 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
D46642B0B79355E4B1F7B825 /* CenteredScrollView.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = CenteredScrollView.podspec; path = ../CenteredScrollView.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
D8781DE923C29C4E29A75507 /* Pods-CenteredScrollView_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CenteredScrollView_Tests.debug.xcconfig"; path = "Target Support Files/Pods-CenteredScrollView_Tests/Pods-CenteredScrollView_Tests.debug.xcconfig"; sourceTree = "<group>"; };
F76585C36DF28959CF687AA5 /* Pods-CenteredScrollView_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CenteredScrollView_Tests.release.xcconfig"; path = "Target Support Files/Pods-CenteredScrollView_Tests/Pods-CenteredScrollView_Tests.release.xcconfig"; sourceTree = "<group>"; };
FAC4A20F955F9F0883318DFA /* Pods_CenteredScrollView_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CenteredScrollView_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -95,7 +95,6 @@
D8781DE923C29C4E29A75507 /* Pods-CenteredScrollView_Tests.debug.xcconfig */,
F76585C36DF28959CF687AA5 /* Pods-CenteredScrollView_Tests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -131,10 +130,6 @@
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
LastSwiftMigration = 0900;
Expand All @@ -147,6 +142,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -270,7 +266,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -316,7 +312,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
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>

This file was deleted.

10 changes: 10 additions & 0 deletions Example/CenteredScrollView.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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>
Loading

0 comments on commit 542aba0

Please sign in to comment.