├── .gitignore
├── LICENSE.md
├── README.md
├── SwiftScrollViewExample
├── SwiftScrollViewExample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ │ └── apple.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── apple.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── SwiftScrollViewExample
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── ScrollViewExample.swift
├── SwiftScrollViews
├── README.md
├── SwiftScrollViews.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ │ └── apple.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── apple.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── SwiftScrollViews
│ ├── Info.plist
│ ├── SwiftCollectionView.swift
│ ├── SwiftScrollView.swift
│ ├── SwiftScrollViews.swift
│ ├── SwiftScrollViewsDelegate.swift
│ ├── SwiftScrollViewsExtensions.swift
│ └── SwiftTableView.swift
├── SwiftScrollViewsExample
├── SwiftScrollViewExample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ │ └── apple.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── apple.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── SwiftScrollViewExample
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── ScrollViewExample.swift
│ ├── SwiftCollectionViewExample.swift
│ └── SwiftTableViewExample.swift
└── _config.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .gitignore
3 | SwiftScrollViews.podspec
4 | .swift-version
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Licensed under the **MIT** license
2 |
3 | >Copyright (c) 2018 Rajamohan S. All rights reserved.
4 | >
5 | > Permission is hereby granted, free of charge, to any person obtaining
6 | > a copy of this software and associated documentation files (the
7 | > "Software"), to deal in the Software without restriction, including
8 | > without limitation the rights to use, copy, modify, merge, publish,
9 | > distribute, sublicense, and/or sell copies of the Software, and to
10 | > permit persons to whom the Software is furnished to do so, subject to
11 | > the following conditions:
12 | >
13 | > The above copyright notice and this permission notice shall be
14 | > included in all copies or substantial portions of the Software.
15 | >
16 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | > IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 | > CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 | > TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 | > SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | A simple approach to handle UITextField & UITextViews over scroll view accross keyboard. The SwiftScrollViews framework is written with the extension UIScrollView.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ## Features
14 |
15 | - Auto scroll for actvie `UITextFied` and `UITextView` over `UIScrollView`, `UITableView` and `UICollectionView`.
16 | - Set grouping by using `ReturnKeyType` of `UITextField`.
17 | - Execute action when last `UITextField` of the group did end editing if need by using `SwiftScrollViewDelegate`. (Refer `SwiftScrollViewExample` project).
18 | - Set custom `ReturnKeyType` and vertical space between keyboard and active `UITextField` or `UITextView`.
19 |
20 | ## Requirements
21 |
22 | - iOS 8.0+
23 | - Xcode 10.1+
24 |
25 | ## Installation
26 |
27 | ### Using Cocoapods
28 |
29 | ```ruby
30 | pod 'SwiftScrollViews', '~>1.0' # Swift 4.2.1
31 | ```
32 |
33 | ### Manually
34 | 1. Download and drop ```Source``` folder in your project.
35 | 2. Congratulations!
36 |
37 | ## Usage
38 |
39 | ### The Basic Setup
40 | 1. Select scrollview in xib or storyboard in viewcontroller.
41 | 2. Go to **Assistand Editor/Identity Inspector/Custom Class/Class** as `SwiftScrollView`. If you have `UITableView` then use `SwiftTableView` and then `SwiftCollectionView` for `UICollectionView`.
42 |
43 | ### SwiftScrollViewDelegate
44 |
45 | It is delegating the method ```func didEditingDone(for textField: UITextField) {}``` will exceute when **view did end editing**.
46 |
47 | The view will end edit when directly taping the **ScrollViews** or Taping the keyboard return button if ` textField.returnKeyType != .default || textField.returnKeyType != .next`.
48 |
49 | ### Grouping
50 |
51 | The group of `UITextFields` in a view by setting `textField.returnKeyType != .default || textField.returnKeyType != .next` at last field of that group.
52 |
53 | ### Aditional Configuration
54 |
55 | ```swift
56 | SwiftScrollViews.config.textComponentSpaceFromKeyboard = 40 //vertical space between keyboard and active text field or text view.
57 | SwiftScrollViews.config.defaultDoneKey = .done // The default return key of last text field over the scroll view.
58 | ```
59 |
60 | ### Example:
61 | ```swift
62 | class ScrollViewExample: UIViewController,SwiftScrollViewDelegate {
63 |
64 | @IBOutlet weak var scrollView: SwiftScrollView!
65 |
66 | override func viewDidLoad() {
67 | super.viewDidLoad()
68 |
69 | self.scrollView.swiftScrollViewsDelegate = self
70 | }
71 |
72 | func didEditingDone(for textField: UITextField) {
73 |
74 | //TODO:- Do further with by comparing textField with self.textField
75 | let controller = UIAlertController(title: textField.placeholder ?? "Place Holder Nil", message: "✅ Editing Done!", preferredStyle: .alert)
76 | controller.addAction(UIAlertAction(title: "👍", style: .default, handler: nil))
77 | self.present(controller, animated: true, completion: nil)
78 | }
79 | }
80 | ```
81 | ## Contribute
82 | I would love you for the contribution to **SwiftScrollViews**, check the [LICENSE](https://github.com/RAJAMOHAN-S/SwiftScrollViews/blob/master/LICENSE.md) file for more info.
83 |
84 | ## Meta
85 |
86 | Rajamohan S – (https://rajamohan-s.github.io/)
87 |
88 | Distributed under the MIT license. See [LICENSE](https://github.com/RAJAMOHAN-S/SwiftScrollViews/blob/master/LICENSE.md) for more information.
89 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1843E5DB21B1AF710008AFD6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */; };
11 | 1843E5DD21B1AF710008AFD6 /* ScrollViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */; };
12 | 1843E5E221B1AF720008AFD6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1843E5E121B1AF720008AFD6 /* Assets.xcassets */; };
13 | 1843E5E521B1AF720008AFD6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */; };
14 | 18D9F99721B3C8B700839757 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18D9F99521B3C8B700839757 /* Main.storyboard */; };
15 | 18EA977423094FED00670B9A /* SwiftScrollViews.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1839E41021B628320049E45A /* SwiftScrollViews.framework */; };
16 | 18EA977523094FED00670B9A /* SwiftScrollViews.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1839E41021B628320049E45A /* SwiftScrollViews.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXContainerItemProxy section */
20 | 1839E40F21B628320049E45A /* PBXContainerItemProxy */ = {
21 | isa = PBXContainerItemProxy;
22 | containerPortal = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
23 | proxyType = 2;
24 | remoteGlobalIDString = 1843E5C121B1A94F0008AFD6;
25 | remoteInfo = SwiftScrollViews;
26 | };
27 | 18EA977623094FED00670B9A /* PBXContainerItemProxy */ = {
28 | isa = PBXContainerItemProxy;
29 | containerPortal = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
30 | proxyType = 1;
31 | remoteGlobalIDString = 1843E5C021B1A94F0008AFD6;
32 | remoteInfo = SwiftScrollViews;
33 | };
34 | /* End PBXContainerItemProxy section */
35 |
36 | /* Begin PBXCopyFilesBuildPhase section */
37 | 18EA977823094FED00670B9A /* Embed Frameworks */ = {
38 | isa = PBXCopyFilesBuildPhase;
39 | buildActionMask = 2147483647;
40 | dstPath = "";
41 | dstSubfolderSpec = 10;
42 | files = (
43 | 18EA977523094FED00670B9A /* SwiftScrollViews.framework in Embed Frameworks */,
44 | );
45 | name = "Embed Frameworks";
46 | runOnlyForDeploymentPostprocessing = 0;
47 | };
48 | /* End PBXCopyFilesBuildPhase section */
49 |
50 | /* Begin PBXFileReference section */
51 | 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftScrollViews.xcodeproj; path = ../SwiftScrollViews/SwiftScrollViews.xcodeproj; sourceTree = ""; };
52 | 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftScrollViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
54 | 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewExample.swift; sourceTree = ""; };
55 | 1843E5E121B1AF720008AFD6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
56 | 1843E5E421B1AF720008AFD6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
57 | 1843E5E621B1AF720008AFD6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | 18D9F97121B3ABC900839757 /* SwiftScrollViews.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftScrollViews.framework; sourceTree = BUILT_PRODUCTS_DIR; };
59 | 18D9F99621B3C8B700839757 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
60 | /* End PBXFileReference section */
61 |
62 | /* Begin PBXFrameworksBuildPhase section */
63 | 1843E5D421B1AF710008AFD6 /* Frameworks */ = {
64 | isa = PBXFrameworksBuildPhase;
65 | buildActionMask = 2147483647;
66 | files = (
67 | 18EA977423094FED00670B9A /* SwiftScrollViews.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 1839E40C21B628320049E45A /* Products */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 1839E41021B628320049E45A /* SwiftScrollViews.framework */,
78 | );
79 | name = Products;
80 | sourceTree = "";
81 | };
82 | 1843E5CE21B1AF710008AFD6 = {
83 | isa = PBXGroup;
84 | children = (
85 | 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */,
86 | 1843E5D921B1AF710008AFD6 /* SwiftScrollViewExample */,
87 | 1843E5D821B1AF710008AFD6 /* Products */,
88 | 18D9F97021B3ABC900839757 /* Frameworks */,
89 | );
90 | sourceTree = "";
91 | };
92 | 1843E5D821B1AF710008AFD6 /* Products */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */,
96 | );
97 | name = Products;
98 | sourceTree = "";
99 | };
100 | 1843E5D921B1AF710008AFD6 /* SwiftScrollViewExample */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */,
104 | 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */,
105 | 18D9F99521B3C8B700839757 /* Main.storyboard */,
106 | 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */,
107 | 1843E5E121B1AF720008AFD6 /* Assets.xcassets */,
108 | 1843E5E621B1AF720008AFD6 /* Info.plist */,
109 | );
110 | path = SwiftScrollViewExample;
111 | sourceTree = "";
112 | };
113 | 18D9F97021B3ABC900839757 /* Frameworks */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 18D9F97121B3ABC900839757 /* SwiftScrollViews.framework */,
117 | );
118 | name = Frameworks;
119 | sourceTree = "";
120 | };
121 | /* End PBXGroup section */
122 |
123 | /* Begin PBXNativeTarget section */
124 | 1843E5D621B1AF710008AFD6 /* SwiftScrollViewExample */ = {
125 | isa = PBXNativeTarget;
126 | buildConfigurationList = 1843E5E921B1AF720008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViewExample" */;
127 | buildPhases = (
128 | 1843E5D321B1AF710008AFD6 /* Sources */,
129 | 1843E5D421B1AF710008AFD6 /* Frameworks */,
130 | 1843E5D521B1AF710008AFD6 /* Resources */,
131 | 18EA977823094FED00670B9A /* Embed Frameworks */,
132 | );
133 | buildRules = (
134 | );
135 | dependencies = (
136 | 18EA977723094FED00670B9A /* PBXTargetDependency */,
137 | );
138 | name = SwiftScrollViewExample;
139 | productName = SwiftScrollViewExample;
140 | productReference = 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */;
141 | productType = "com.apple.product-type.application";
142 | };
143 | /* End PBXNativeTarget section */
144 |
145 | /* Begin PBXProject section */
146 | 1843E5CF21B1AF710008AFD6 /* Project object */ = {
147 | isa = PBXProject;
148 | attributes = {
149 | LastSwiftUpdateCheck = 1010;
150 | LastUpgradeCheck = 1010;
151 | ORGANIZATIONNAME = "Rajamohan-S";
152 | TargetAttributes = {
153 | 1843E5D621B1AF710008AFD6 = {
154 | CreatedOnToolsVersion = 10.1;
155 | LastSwiftMigration = 1020;
156 | };
157 | };
158 | };
159 | buildConfigurationList = 1843E5D221B1AF710008AFD6 /* Build configuration list for PBXProject "SwiftScrollViewExample" */;
160 | compatibilityVersion = "Xcode 9.3";
161 | developmentRegion = en;
162 | hasScannedForEncodings = 0;
163 | knownRegions = (
164 | en,
165 | Base,
166 | );
167 | mainGroup = 1843E5CE21B1AF710008AFD6;
168 | productRefGroup = 1843E5D821B1AF710008AFD6 /* Products */;
169 | projectDirPath = "";
170 | projectReferences = (
171 | {
172 | ProductGroup = 1839E40C21B628320049E45A /* Products */;
173 | ProjectRef = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
174 | },
175 | );
176 | projectRoot = "";
177 | targets = (
178 | 1843E5D621B1AF710008AFD6 /* SwiftScrollViewExample */,
179 | );
180 | };
181 | /* End PBXProject section */
182 |
183 | /* Begin PBXReferenceProxy section */
184 | 1839E41021B628320049E45A /* SwiftScrollViews.framework */ = {
185 | isa = PBXReferenceProxy;
186 | fileType = wrapper.framework;
187 | path = SwiftScrollViews.framework;
188 | remoteRef = 1839E40F21B628320049E45A /* PBXContainerItemProxy */;
189 | sourceTree = BUILT_PRODUCTS_DIR;
190 | };
191 | /* End PBXReferenceProxy section */
192 |
193 | /* Begin PBXResourcesBuildPhase section */
194 | 1843E5D521B1AF710008AFD6 /* Resources */ = {
195 | isa = PBXResourcesBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | 18D9F99721B3C8B700839757 /* Main.storyboard in Resources */,
199 | 1843E5E521B1AF720008AFD6 /* LaunchScreen.storyboard in Resources */,
200 | 1843E5E221B1AF720008AFD6 /* Assets.xcassets in Resources */,
201 | );
202 | runOnlyForDeploymentPostprocessing = 0;
203 | };
204 | /* End PBXResourcesBuildPhase section */
205 |
206 | /* Begin PBXSourcesBuildPhase section */
207 | 1843E5D321B1AF710008AFD6 /* Sources */ = {
208 | isa = PBXSourcesBuildPhase;
209 | buildActionMask = 2147483647;
210 | files = (
211 | 1843E5DD21B1AF710008AFD6 /* ScrollViewExample.swift in Sources */,
212 | 1843E5DB21B1AF710008AFD6 /* AppDelegate.swift in Sources */,
213 | );
214 | runOnlyForDeploymentPostprocessing = 0;
215 | };
216 | /* End PBXSourcesBuildPhase section */
217 |
218 | /* Begin PBXTargetDependency section */
219 | 18EA977723094FED00670B9A /* PBXTargetDependency */ = {
220 | isa = PBXTargetDependency;
221 | name = SwiftScrollViews;
222 | targetProxy = 18EA977623094FED00670B9A /* PBXContainerItemProxy */;
223 | };
224 | /* End PBXTargetDependency section */
225 |
226 | /* Begin PBXVariantGroup section */
227 | 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */ = {
228 | isa = PBXVariantGroup;
229 | children = (
230 | 1843E5E421B1AF720008AFD6 /* Base */,
231 | );
232 | name = LaunchScreen.storyboard;
233 | sourceTree = "";
234 | };
235 | 18D9F99521B3C8B700839757 /* Main.storyboard */ = {
236 | isa = PBXVariantGroup;
237 | children = (
238 | 18D9F99621B3C8B700839757 /* Base */,
239 | );
240 | name = Main.storyboard;
241 | sourceTree = "";
242 | };
243 | /* End PBXVariantGroup section */
244 |
245 | /* Begin XCBuildConfiguration section */
246 | 1843E5E721B1AF720008AFD6 /* Debug */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | ALWAYS_SEARCH_USER_PATHS = NO;
250 | CLANG_ANALYZER_NONNULL = YES;
251 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
252 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
253 | CLANG_CXX_LIBRARY = "libc++";
254 | CLANG_ENABLE_MODULES = YES;
255 | CLANG_ENABLE_OBJC_ARC = YES;
256 | CLANG_ENABLE_OBJC_WEAK = YES;
257 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
258 | CLANG_WARN_BOOL_CONVERSION = YES;
259 | CLANG_WARN_COMMA = YES;
260 | CLANG_WARN_CONSTANT_CONVERSION = YES;
261 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
262 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
263 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
264 | CLANG_WARN_EMPTY_BODY = YES;
265 | CLANG_WARN_ENUM_CONVERSION = YES;
266 | CLANG_WARN_INFINITE_RECURSION = YES;
267 | CLANG_WARN_INT_CONVERSION = YES;
268 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
269 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
270 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
272 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
273 | CLANG_WARN_STRICT_PROTOTYPES = YES;
274 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
275 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
276 | CLANG_WARN_UNREACHABLE_CODE = YES;
277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
278 | CODE_SIGN_IDENTITY = "iPhone Developer";
279 | COPY_PHASE_STRIP = NO;
280 | DEBUG_INFORMATION_FORMAT = dwarf;
281 | ENABLE_STRICT_OBJC_MSGSEND = YES;
282 | ENABLE_TESTABILITY = YES;
283 | GCC_C_LANGUAGE_STANDARD = gnu11;
284 | GCC_DYNAMIC_NO_PIC = NO;
285 | GCC_NO_COMMON_BLOCKS = YES;
286 | GCC_OPTIMIZATION_LEVEL = 0;
287 | GCC_PREPROCESSOR_DEFINITIONS = (
288 | "DEBUG=1",
289 | "$(inherited)",
290 | );
291 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
292 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
293 | GCC_WARN_UNDECLARED_SELECTOR = YES;
294 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
295 | GCC_WARN_UNUSED_FUNCTION = YES;
296 | GCC_WARN_UNUSED_VARIABLE = YES;
297 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
298 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
299 | MTL_FAST_MATH = YES;
300 | ONLY_ACTIVE_ARCH = YES;
301 | SDKROOT = iphoneos;
302 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
303 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
304 | };
305 | name = Debug;
306 | };
307 | 1843E5E821B1AF720008AFD6 /* Release */ = {
308 | isa = XCBuildConfiguration;
309 | buildSettings = {
310 | ALWAYS_SEARCH_USER_PATHS = NO;
311 | CLANG_ANALYZER_NONNULL = YES;
312 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
313 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
314 | CLANG_CXX_LIBRARY = "libc++";
315 | CLANG_ENABLE_MODULES = YES;
316 | CLANG_ENABLE_OBJC_ARC = YES;
317 | CLANG_ENABLE_OBJC_WEAK = YES;
318 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
319 | CLANG_WARN_BOOL_CONVERSION = YES;
320 | CLANG_WARN_COMMA = YES;
321 | CLANG_WARN_CONSTANT_CONVERSION = YES;
322 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
323 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
324 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
325 | CLANG_WARN_EMPTY_BODY = YES;
326 | CLANG_WARN_ENUM_CONVERSION = YES;
327 | CLANG_WARN_INFINITE_RECURSION = YES;
328 | CLANG_WARN_INT_CONVERSION = YES;
329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
334 | CLANG_WARN_STRICT_PROTOTYPES = YES;
335 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
336 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
337 | CLANG_WARN_UNREACHABLE_CODE = YES;
338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
339 | CODE_SIGN_IDENTITY = "iPhone Developer";
340 | COPY_PHASE_STRIP = NO;
341 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
342 | ENABLE_NS_ASSERTIONS = NO;
343 | ENABLE_STRICT_OBJC_MSGSEND = YES;
344 | GCC_C_LANGUAGE_STANDARD = gnu11;
345 | GCC_NO_COMMON_BLOCKS = YES;
346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
348 | GCC_WARN_UNDECLARED_SELECTOR = YES;
349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
350 | GCC_WARN_UNUSED_FUNCTION = YES;
351 | GCC_WARN_UNUSED_VARIABLE = YES;
352 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
353 | MTL_ENABLE_DEBUG_INFO = NO;
354 | MTL_FAST_MATH = YES;
355 | SDKROOT = iphoneos;
356 | SWIFT_COMPILATION_MODE = wholemodule;
357 | SWIFT_OPTIMIZATION_LEVEL = "-O";
358 | VALIDATE_PRODUCT = YES;
359 | };
360 | name = Release;
361 | };
362 | 1843E5EA21B1AF720008AFD6 /* Debug */ = {
363 | isa = XCBuildConfiguration;
364 | buildSettings = {
365 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
367 | CODE_SIGN_STYLE = Manual;
368 | DEVELOPMENT_TEAM = QUHD7NM634;
369 | INFOPLIST_FILE = SwiftScrollViewExample/Info.plist;
370 | LD_RUNPATH_SEARCH_PATHS = (
371 | "$(inherited)",
372 | "@executable_path/Frameworks",
373 | );
374 | PRODUCT_BUNDLE_IDENTIFIER = "com.rajamohan-s.com.SwiftScrollViewExample";
375 | PRODUCT_NAME = "$(TARGET_NAME)";
376 | PROVISIONING_PROFILE_SPECIFIER = "Wild Card - iOS Development";
377 | SWIFT_VERSION = 5.0;
378 | TARGETED_DEVICE_FAMILY = "1,2";
379 | };
380 | name = Debug;
381 | };
382 | 1843E5EB21B1AF720008AFD6 /* Release */ = {
383 | isa = XCBuildConfiguration;
384 | buildSettings = {
385 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
386 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
387 | CODE_SIGN_STYLE = Manual;
388 | DEVELOPMENT_TEAM = QUHD7NM634;
389 | INFOPLIST_FILE = SwiftScrollViewExample/Info.plist;
390 | LD_RUNPATH_SEARCH_PATHS = (
391 | "$(inherited)",
392 | "@executable_path/Frameworks",
393 | );
394 | PRODUCT_BUNDLE_IDENTIFIER = "com.rajamohan-s.com.SwiftScrollViewExample";
395 | PRODUCT_NAME = "$(TARGET_NAME)";
396 | PROVISIONING_PROFILE_SPECIFIER = "Wild Card - iOS Development";
397 | SWIFT_VERSION = 5.0;
398 | TARGETED_DEVICE_FAMILY = "1,2";
399 | };
400 | name = Release;
401 | };
402 | /* End XCBuildConfiguration section */
403 |
404 | /* Begin XCConfigurationList section */
405 | 1843E5D221B1AF710008AFD6 /* Build configuration list for PBXProject "SwiftScrollViewExample" */ = {
406 | isa = XCConfigurationList;
407 | buildConfigurations = (
408 | 1843E5E721B1AF720008AFD6 /* Debug */,
409 | 1843E5E821B1AF720008AFD6 /* Release */,
410 | );
411 | defaultConfigurationIsVisible = 0;
412 | defaultConfigurationName = Release;
413 | };
414 | 1843E5E921B1AF720008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViewExample" */ = {
415 | isa = XCConfigurationList;
416 | buildConfigurations = (
417 | 1843E5EA21B1AF720008AFD6 /* Debug */,
418 | 1843E5EB21B1AF720008AFD6 /* Release */,
419 | );
420 | defaultConfigurationIsVisible = 0;
421 | defaultConfigurationName = Release;
422 | };
423 | /* End XCConfigurationList section */
424 | };
425 | rootObject = 1843E5CF21B1AF710008AFD6 /* Project object */;
426 | }
427 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajamohan0s/SwiftScrollViews/73de6c9ac4ff165677c079986f4d8e47e83bd762/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SwiftScrollViewExample.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 30/11/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 | import SwiftScrollViews
13 |
14 | @UIApplicationMain
15 | class AppDelegate: UIResponder, UIApplicationDelegate {
16 |
17 | var window: UIWindow?
18 |
19 |
20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
21 | // Override point for customization after application launch.
22 | return true
23 | }
24 |
25 | func applicationWillResignActive(_ application: UIApplication) {
26 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
28 | }
29 |
30 | func applicationDidEnterBackground(_ application: UIApplication) {
31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 | func applicationWillEnterForeground(_ application: UIApplication) {
36 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
37 | }
38 |
39 | func applicationDidBecomeActive(_ application: UIApplication) {
40 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
41 | }
42 |
43 | func applicationWillTerminate(_ application: UIApplication) {
44 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
45 | }
46 |
47 |
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UIRequiresFullScreen
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/SwiftScrollViewExample/SwiftScrollViewExample/ScrollViewExample.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Apple on 30/11/18.
6 | // Copyright © 2018 Rajamohan-S. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import SwiftScrollViews
11 |
12 | class ScrollViewExample: UIViewController,SwiftScrollViewsDelegate {
13 |
14 |
15 | func didEditingDone(for textField: UITextField) {
16 |
17 | print("Ended editing:\(String(describing: textField.placeholder))")
18 | }
19 |
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/SwiftScrollViews/README.md:
--------------------------------------------------------------------------------
1 | # SwiftScrollView
2 | Swift Code for Avoiding Keyboard & Binding keyboard UITextField and UITextView on UIScrollView
3 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1843E5CD21B1AB7A0008AFD6 /* SwiftScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1843E5CC21B1AB7A0008AFD6 /* SwiftScrollView.swift */; };
11 | 18D9F98821B3AD1700839757 /* SwiftScrollViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D9F98721B3AD1700839757 /* SwiftScrollViews.swift */; };
12 | 18D9F98C21B3C82C00839757 /* SwiftScrollViewsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D9F98921B3C82C00839757 /* SwiftScrollViewsExtensions.swift */; };
13 | 18D9F98D21B3C82C00839757 /* SwiftTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D9F98A21B3C82C00839757 /* SwiftTableView.swift */; };
14 | 18D9F98E21B3C82C00839757 /* SwiftCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D9F98B21B3C82C00839757 /* SwiftCollectionView.swift */; };
15 | 18EA977123094FC900670B9A /* SwiftScrollViewsDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18EA977023094FC900670B9A /* SwiftScrollViewsDelegate.swift */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | 1843E5C121B1A94F0008AFD6 /* SwiftScrollViews.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftScrollViews.framework; sourceTree = BUILT_PRODUCTS_DIR; };
20 | 1843E5C521B1A94F0008AFD6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
21 | 1843E5CC21B1AB7A0008AFD6 /* SwiftScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftScrollView.swift; sourceTree = ""; };
22 | 18D9F98721B3AD1700839757 /* SwiftScrollViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftScrollViews.swift; sourceTree = ""; };
23 | 18D9F98921B3C82C00839757 /* SwiftScrollViewsExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftScrollViewsExtensions.swift; sourceTree = ""; };
24 | 18D9F98A21B3C82C00839757 /* SwiftTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftTableView.swift; sourceTree = ""; };
25 | 18D9F98B21B3C82C00839757 /* SwiftCollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftCollectionView.swift; sourceTree = ""; };
26 | 18EA977023094FC900670B9A /* SwiftScrollViewsDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftScrollViewsDelegate.swift; sourceTree = ""; };
27 | /* End PBXFileReference section */
28 |
29 | /* Begin PBXFrameworksBuildPhase section */
30 | 1843E5BE21B1A94F0008AFD6 /* Frameworks */ = {
31 | isa = PBXFrameworksBuildPhase;
32 | buildActionMask = 2147483647;
33 | files = (
34 | );
35 | runOnlyForDeploymentPostprocessing = 0;
36 | };
37 | /* End PBXFrameworksBuildPhase section */
38 |
39 | /* Begin PBXGroup section */
40 | 1843E5B721B1A94F0008AFD6 = {
41 | isa = PBXGroup;
42 | children = (
43 | 1843E5C321B1A94F0008AFD6 /* SwiftScrollViews */,
44 | 1843E5C221B1A94F0008AFD6 /* Products */,
45 | );
46 | sourceTree = "";
47 | };
48 | 1843E5C221B1A94F0008AFD6 /* Products */ = {
49 | isa = PBXGroup;
50 | children = (
51 | 1843E5C121B1A94F0008AFD6 /* SwiftScrollViews.framework */,
52 | );
53 | name = Products;
54 | sourceTree = "";
55 | };
56 | 1843E5C321B1A94F0008AFD6 /* SwiftScrollViews */ = {
57 | isa = PBXGroup;
58 | children = (
59 | 1843E5C521B1A94F0008AFD6 /* Info.plist */,
60 | 18D9F98721B3AD1700839757 /* SwiftScrollViews.swift */,
61 | 1843E5CC21B1AB7A0008AFD6 /* SwiftScrollView.swift */,
62 | 18D9F98A21B3C82C00839757 /* SwiftTableView.swift */,
63 | 18D9F98B21B3C82C00839757 /* SwiftCollectionView.swift */,
64 | 18EA977023094FC900670B9A /* SwiftScrollViewsDelegate.swift */,
65 | 18D9F98921B3C82C00839757 /* SwiftScrollViewsExtensions.swift */,
66 | );
67 | path = SwiftScrollViews;
68 | sourceTree = "";
69 | };
70 | /* End PBXGroup section */
71 |
72 | /* Begin PBXHeadersBuildPhase section */
73 | 1843E5BC21B1A94F0008AFD6 /* Headers */ = {
74 | isa = PBXHeadersBuildPhase;
75 | buildActionMask = 2147483647;
76 | files = (
77 | );
78 | runOnlyForDeploymentPostprocessing = 0;
79 | };
80 | /* End PBXHeadersBuildPhase section */
81 |
82 | /* Begin PBXNativeTarget section */
83 | 1843E5C021B1A94F0008AFD6 /* SwiftScrollViews */ = {
84 | isa = PBXNativeTarget;
85 | buildConfigurationList = 1843E5C921B1A94F0008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViews" */;
86 | buildPhases = (
87 | 1843E5BC21B1A94F0008AFD6 /* Headers */,
88 | 1843E5BD21B1A94F0008AFD6 /* Sources */,
89 | 1843E5BE21B1A94F0008AFD6 /* Frameworks */,
90 | 1843E5BF21B1A94F0008AFD6 /* Resources */,
91 | );
92 | buildRules = (
93 | );
94 | dependencies = (
95 | );
96 | name = SwiftScrollViews;
97 | productName = SwiftScrollView;
98 | productReference = 1843E5C121B1A94F0008AFD6 /* SwiftScrollViews.framework */;
99 | productType = "com.apple.product-type.framework";
100 | };
101 | /* End PBXNativeTarget section */
102 |
103 | /* Begin PBXProject section */
104 | 1843E5B821B1A94F0008AFD6 /* Project object */ = {
105 | isa = PBXProject;
106 | attributes = {
107 | LastUpgradeCheck = 1010;
108 | ORGANIZATIONNAME = "Rajamohan-S";
109 | TargetAttributes = {
110 | 1843E5C021B1A94F0008AFD6 = {
111 | CreatedOnToolsVersion = 10.1;
112 | LastSwiftMigration = 1020;
113 | };
114 | };
115 | };
116 | buildConfigurationList = 1843E5BB21B1A94F0008AFD6 /* Build configuration list for PBXProject "SwiftScrollViews" */;
117 | compatibilityVersion = "Xcode 9.3";
118 | developmentRegion = en;
119 | hasScannedForEncodings = 0;
120 | knownRegions = (
121 | en,
122 | Base,
123 | );
124 | mainGroup = 1843E5B721B1A94F0008AFD6;
125 | productRefGroup = 1843E5C221B1A94F0008AFD6 /* Products */;
126 | projectDirPath = "";
127 | projectRoot = "";
128 | targets = (
129 | 1843E5C021B1A94F0008AFD6 /* SwiftScrollViews */,
130 | );
131 | };
132 | /* End PBXProject section */
133 |
134 | /* Begin PBXResourcesBuildPhase section */
135 | 1843E5BF21B1A94F0008AFD6 /* Resources */ = {
136 | isa = PBXResourcesBuildPhase;
137 | buildActionMask = 2147483647;
138 | files = (
139 | );
140 | runOnlyForDeploymentPostprocessing = 0;
141 | };
142 | /* End PBXResourcesBuildPhase section */
143 |
144 | /* Begin PBXSourcesBuildPhase section */
145 | 1843E5BD21B1A94F0008AFD6 /* Sources */ = {
146 | isa = PBXSourcesBuildPhase;
147 | buildActionMask = 2147483647;
148 | files = (
149 | 18EA977123094FC900670B9A /* SwiftScrollViewsDelegate.swift in Sources */,
150 | 18D9F98E21B3C82C00839757 /* SwiftCollectionView.swift in Sources */,
151 | 18D9F98C21B3C82C00839757 /* SwiftScrollViewsExtensions.swift in Sources */,
152 | 18D9F98D21B3C82C00839757 /* SwiftTableView.swift in Sources */,
153 | 18D9F98821B3AD1700839757 /* SwiftScrollViews.swift in Sources */,
154 | 1843E5CD21B1AB7A0008AFD6 /* SwiftScrollView.swift in Sources */,
155 | );
156 | runOnlyForDeploymentPostprocessing = 0;
157 | };
158 | /* End PBXSourcesBuildPhase section */
159 |
160 | /* Begin XCBuildConfiguration section */
161 | 1843E5C721B1A94F0008AFD6 /* Debug */ = {
162 | isa = XCBuildConfiguration;
163 | buildSettings = {
164 | ALWAYS_SEARCH_USER_PATHS = NO;
165 | CLANG_ANALYZER_NONNULL = YES;
166 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
167 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
168 | CLANG_CXX_LIBRARY = "libc++";
169 | CLANG_ENABLE_MODULES = YES;
170 | CLANG_ENABLE_OBJC_ARC = YES;
171 | CLANG_ENABLE_OBJC_WEAK = YES;
172 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
173 | CLANG_WARN_BOOL_CONVERSION = YES;
174 | CLANG_WARN_COMMA = YES;
175 | CLANG_WARN_CONSTANT_CONVERSION = YES;
176 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
177 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
178 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
179 | CLANG_WARN_EMPTY_BODY = YES;
180 | CLANG_WARN_ENUM_CONVERSION = YES;
181 | CLANG_WARN_INFINITE_RECURSION = YES;
182 | CLANG_WARN_INT_CONVERSION = YES;
183 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
184 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
185 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
186 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
187 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
188 | CLANG_WARN_STRICT_PROTOTYPES = YES;
189 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
190 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
191 | CLANG_WARN_UNREACHABLE_CODE = YES;
192 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
193 | CODE_SIGN_IDENTITY = "iPhone Developer";
194 | COPY_PHASE_STRIP = NO;
195 | CURRENT_PROJECT_VERSION = 1;
196 | DEBUG_INFORMATION_FORMAT = dwarf;
197 | ENABLE_STRICT_OBJC_MSGSEND = YES;
198 | ENABLE_TESTABILITY = YES;
199 | GCC_C_LANGUAGE_STANDARD = gnu11;
200 | GCC_DYNAMIC_NO_PIC = NO;
201 | GCC_NO_COMMON_BLOCKS = YES;
202 | GCC_OPTIMIZATION_LEVEL = 0;
203 | GCC_PREPROCESSOR_DEFINITIONS = (
204 | "DEBUG=1",
205 | "$(inherited)",
206 | );
207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
209 | GCC_WARN_UNDECLARED_SELECTOR = YES;
210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
211 | GCC_WARN_UNUSED_FUNCTION = YES;
212 | GCC_WARN_UNUSED_VARIABLE = YES;
213 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
214 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
215 | MTL_FAST_MATH = YES;
216 | ONLY_ACTIVE_ARCH = YES;
217 | SDKROOT = iphoneos;
218 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
219 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
220 | SWIFT_VERSION = 4.2;
221 | VERSIONING_SYSTEM = "apple-generic";
222 | VERSION_INFO_PREFIX = "";
223 | };
224 | name = Debug;
225 | };
226 | 1843E5C821B1A94F0008AFD6 /* Release */ = {
227 | isa = XCBuildConfiguration;
228 | buildSettings = {
229 | ALWAYS_SEARCH_USER_PATHS = NO;
230 | CLANG_ANALYZER_NONNULL = YES;
231 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
233 | CLANG_CXX_LIBRARY = "libc++";
234 | CLANG_ENABLE_MODULES = YES;
235 | CLANG_ENABLE_OBJC_ARC = YES;
236 | CLANG_ENABLE_OBJC_WEAK = YES;
237 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
238 | CLANG_WARN_BOOL_CONVERSION = YES;
239 | CLANG_WARN_COMMA = YES;
240 | CLANG_WARN_CONSTANT_CONVERSION = YES;
241 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
242 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
243 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
244 | CLANG_WARN_EMPTY_BODY = YES;
245 | CLANG_WARN_ENUM_CONVERSION = YES;
246 | CLANG_WARN_INFINITE_RECURSION = YES;
247 | CLANG_WARN_INT_CONVERSION = YES;
248 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
249 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
250 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
251 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
252 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
253 | CLANG_WARN_STRICT_PROTOTYPES = YES;
254 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
255 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
256 | CLANG_WARN_UNREACHABLE_CODE = YES;
257 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
258 | CODE_SIGN_IDENTITY = "iPhone Developer";
259 | COPY_PHASE_STRIP = NO;
260 | CURRENT_PROJECT_VERSION = 1;
261 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
262 | ENABLE_NS_ASSERTIONS = NO;
263 | ENABLE_STRICT_OBJC_MSGSEND = YES;
264 | GCC_C_LANGUAGE_STANDARD = gnu11;
265 | GCC_NO_COMMON_BLOCKS = YES;
266 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
267 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
268 | GCC_WARN_UNDECLARED_SELECTOR = YES;
269 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
270 | GCC_WARN_UNUSED_FUNCTION = YES;
271 | GCC_WARN_UNUSED_VARIABLE = YES;
272 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
273 | MTL_ENABLE_DEBUG_INFO = NO;
274 | MTL_FAST_MATH = YES;
275 | SDKROOT = iphoneos;
276 | SWIFT_COMPILATION_MODE = wholemodule;
277 | SWIFT_OPTIMIZATION_LEVEL = "-O";
278 | SWIFT_VERSION = 4.2;
279 | VALIDATE_PRODUCT = YES;
280 | VERSIONING_SYSTEM = "apple-generic";
281 | VERSION_INFO_PREFIX = "";
282 | };
283 | name = Release;
284 | };
285 | 1843E5CA21B1A94F0008AFD6 /* Debug */ = {
286 | isa = XCBuildConfiguration;
287 | buildSettings = {
288 | CLANG_ENABLE_MODULES = YES;
289 | CODE_SIGN_IDENTITY = "";
290 | CODE_SIGN_STYLE = Automatic;
291 | DEFINES_MODULE = YES;
292 | DYLIB_COMPATIBILITY_VERSION = 1;
293 | DYLIB_CURRENT_VERSION = 1;
294 | DYLIB_INSTALL_NAME_BASE = "@rpath";
295 | INFOPLIST_FILE = "$(SRCROOT)/SwiftScrollViews/Info.plist";
296 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
297 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
298 | LD_RUNPATH_SEARCH_PATHS = (
299 | "$(inherited)",
300 | "@executable_path/Frameworks",
301 | "@loader_path/Frameworks",
302 | );
303 | PRODUCT_BUNDLE_IDENTIFIER = "rajamohan-s.com.SwiftScrollView";
304 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
305 | SKIP_INSTALL = YES;
306 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
307 | SWIFT_VERSION = 5.0;
308 | TARGETED_DEVICE_FAMILY = "1,2";
309 | };
310 | name = Debug;
311 | };
312 | 1843E5CB21B1A94F0008AFD6 /* Release */ = {
313 | isa = XCBuildConfiguration;
314 | buildSettings = {
315 | CLANG_ENABLE_MODULES = YES;
316 | CODE_SIGN_IDENTITY = "";
317 | CODE_SIGN_STYLE = Automatic;
318 | DEFINES_MODULE = YES;
319 | DYLIB_COMPATIBILITY_VERSION = 1;
320 | DYLIB_CURRENT_VERSION = 1;
321 | DYLIB_INSTALL_NAME_BASE = "@rpath";
322 | INFOPLIST_FILE = "$(SRCROOT)/SwiftScrollViews/Info.plist";
323 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
324 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
325 | LD_RUNPATH_SEARCH_PATHS = (
326 | "$(inherited)",
327 | "@executable_path/Frameworks",
328 | "@loader_path/Frameworks",
329 | );
330 | PRODUCT_BUNDLE_IDENTIFIER = "rajamohan-s.com.SwiftScrollView";
331 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
332 | SKIP_INSTALL = YES;
333 | SWIFT_VERSION = 5.0;
334 | TARGETED_DEVICE_FAMILY = "1,2";
335 | };
336 | name = Release;
337 | };
338 | /* End XCBuildConfiguration section */
339 |
340 | /* Begin XCConfigurationList section */
341 | 1843E5BB21B1A94F0008AFD6 /* Build configuration list for PBXProject "SwiftScrollViews" */ = {
342 | isa = XCConfigurationList;
343 | buildConfigurations = (
344 | 1843E5C721B1A94F0008AFD6 /* Debug */,
345 | 1843E5C821B1A94F0008AFD6 /* Release */,
346 | );
347 | defaultConfigurationIsVisible = 0;
348 | defaultConfigurationName = Release;
349 | };
350 | 1843E5C921B1A94F0008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViews" */ = {
351 | isa = XCConfigurationList;
352 | buildConfigurations = (
353 | 1843E5CA21B1A94F0008AFD6 /* Debug */,
354 | 1843E5CB21B1A94F0008AFD6 /* Release */,
355 | );
356 | defaultConfigurationIsVisible = 0;
357 | defaultConfigurationName = Release;
358 | };
359 | /* End XCConfigurationList section */
360 | };
361 | rootObject = 1843E5B821B1A94F0008AFD6 /* Project object */;
362 | }
363 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajamohan0s/SwiftScrollViews/73de6c9ac4ff165677c079986f4d8e47e83bd762/SwiftScrollViews/SwiftScrollViews.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SwiftScrollView.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | SwiftScrollViews.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 1
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftCollectionView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftCollectionView.swift
3 | // SwiftScrollView
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 01/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | open class SwiftCollectionView:UICollectionView,TextComponentDelegate{
14 |
15 | private var textComponents = [UIView]()
16 | open var swiftScrollViewsDelegate:SwiftScrollViewsDelegate?
17 |
18 | override public init(frame: CGRect, collectionViewLayout layout: UICollectionViewLayout) {
19 | super.init(frame: frame, collectionViewLayout: layout)
20 | self.addNotifications()
21 | }
22 |
23 | required public init?(coder aDecoder: NSCoder) {
24 | super.init(coder: aDecoder)
25 | self.addNotifications()
26 | }
27 |
28 |
29 | override open func layoutSubviews() {
30 | super.layoutSubviews()
31 |
32 | self.delegateTextComponents(in: self, textComponents: &textComponents)
33 | }
34 |
35 | open func textFieldShouldReturn(_ textField: UITextField) -> Bool {
36 |
37 | if self.swiftScrollViewsDelegate?.textFieldShouldReturn?(textField) != false{
38 | self.shouldReturn(for: textField, with: self.swiftScrollViewsDelegate)
39 | return true
40 | }
41 | return false
42 | }
43 |
44 | open func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
45 |
46 | if self.swiftScrollViewsDelegate?.textFieldShouldBeginEditing?(textField) != false{
47 | self.shouldBegin(textField)
48 | return true
49 | }
50 | return false
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftScrollView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftScrollView.swift
3 | // SwiftScrollView
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 30/11/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | open class SwiftScrollView:UIScrollView,TextComponentDelegate{
14 |
15 |
16 | @IBOutlet var swiftScrollViewsDelegate:SwiftScrollViewsDelegate?
17 |
18 | private var identifier:String{
19 |
20 | return self.restorationIdentifier ?? "Nil"
21 | }
22 |
23 | private var textComponents = [UIView]()
24 |
25 | public override init(frame: CGRect) {
26 | super.init(frame: frame)
27 | self.addNotifications()
28 | }
29 |
30 | required public init?(coder aDecoder: NSCoder) {
31 | super.init(coder: aDecoder)
32 | self.addNotifications()
33 | }
34 |
35 | override open func layoutSubviews() {
36 | super.layoutSubviews()
37 |
38 | self.delegateTextComponents(in: self, textComponents: &textComponents)
39 | }
40 |
41 | //MARK:- UITextField
42 |
43 | open func textFieldShouldReturn(_ textField: UITextField) -> Bool {
44 |
45 | if self.swiftScrollViewsDelegate?.textFieldShouldReturn?(textField) != false{
46 | self.shouldReturn(for: textField, with: self.swiftScrollViewsDelegate)
47 | return true
48 | }
49 | return false
50 | }
51 |
52 | open func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
53 |
54 | if self.swiftScrollViewsDelegate?.textFieldShouldBeginEditing?(textField) != false{
55 | self.shouldBegin(textField)
56 | return true
57 | }
58 | return false
59 | }
60 |
61 |
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftScrollViews.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftScrollViews.swift
3 | // SwiftScrollViews
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 02/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | public final class SwiftScrollViews{
14 |
15 | public static var config = SwiftScrollViews()
16 | public var defaultDoneKey:UIReturnKeyType = .done
17 | public var textComponentSpaceFromKeyboard:CGFloat = 40
18 | }
19 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftScrollViewsDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftScrollViewsDelegate.swift
3 | // SwiftScrollView
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 02/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | @objc public protocol SwiftScrollViewsDelegate:UITextFieldDelegate,UITextViewDelegate{
14 |
15 | func didEditingDone(for textField: UITextField)
16 | }
17 |
18 |
19 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftScrollViewsExtensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Extension+UIScrollView.swift
3 | // SwiftScrollView
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 30/11/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | //MARK:- Keyboard Size
14 | fileprivate var keyboardHeight:CGFloat = 0
15 |
16 | //MARK:- Variable for kAssociationKeyNextField
17 | private var kAssociationKeyNextField: UInt8 = 0
18 |
19 | //MARK:- TextComponentDelegate
20 | typealias TextComponentDelegate = UITextFieldDelegate & UITextViewDelegate
21 |
22 | //MARK:- Protocol of SwiftScrollViewExtension
23 | protocol SwiftScrollViewExtension{}
24 |
25 | //MARK:- Extension of SwiftScrollViewExtension
26 | extension SwiftScrollViewExtension where Self:UIScrollView{
27 |
28 | private func keyboardSize(from notification:Notification)->CGRect?{
29 |
30 | return (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue
31 | }
32 |
33 | fileprivate var notification: NotificationCenter { return NotificationCenter.default }
34 |
35 | fileprivate var isSwiftScrollView:Bool{ return self is SwiftScrollView || self is SwiftTableView || self is SwiftCollectionView }
36 |
37 | //Observe keyboard notifications
38 | func addNotifications(){
39 |
40 | self.notification.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: nil) { (notification) in
41 | self.observeKeyboard(notification, isShow:true)
42 | }
43 |
44 | self.notification.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: nil) { (notification) in
45 | self.observeKeyboard(notification, isShow:false)
46 | }
47 | }
48 |
49 |
50 | //Remove observers of keyboard notifications
51 | fileprivate func removeNotifications(){
52 |
53 | self.notification.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
54 | self.notification.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
55 | }
56 |
57 | //Keyboard Show & Hide notifications
58 | private func observeKeyboard(_ notification:Notification,isShow:Bool){
59 |
60 | guard let keyboardSize = self.keyboardSize(from: notification) else{
61 | return
62 | }
63 |
64 | if isShow{
65 | let tabBarHeight = self.viewController?.tabBarController?.tabBar.frame.size.height ?? 0
66 | self.contentInset.bottom = (keyboardSize.height+SwiftScrollViews.config.textComponentSpaceFromKeyboard)-tabBarHeight
67 | keyboardHeight = keyboardSize.height
68 | self.scrollIndicatorInsets = contentInset
69 | }else{
70 | self.contentInset.bottom = 0
71 | self.scrollIndicatorInsets = .zero
72 | }
73 | }
74 |
75 | //Setting UITextFieldDelegate & UITextViewDelegate
76 | func delegateTextComponents(in rootView:UIView,textComponents:inout [UIView]){
77 |
78 | rootView.subviews.forEach { (view) in
79 |
80 | if view.isTextComponent{
81 |
82 | if !textComponents.contains(view){
83 | textComponents.append(view)
84 | }
85 |
86 | if let textField = view.textField{
87 | if textField.delegate == nil{
88 | self.setDelegate(for: textField)
89 | }
90 |
91 | }else if let textView = view.textView{
92 | if textView.delegate == nil{
93 | self.setDelegate(for: textView)
94 | }
95 | }
96 | }else{
97 | self.delegateTextComponents(in: view, textComponents: &textComponents)
98 | }
99 | }
100 |
101 | textComponents.sorted()
102 |
103 | textComponents.enumerated().forEach { (index,view) in
104 |
105 | if textComponents.count-1 > index{
106 | let nextView = textComponents[index+1]
107 | view.textComponent = nextView
108 | }
109 | }
110 | }
111 |
112 | func setDelegate(for textField:UITextField){
113 |
114 | if let scrollView = self as? SwiftScrollView{
115 | textField.delegate = scrollView
116 | }else if let tableView = self as? SwiftTableView{
117 |
118 | textField.delegate = tableView
119 | }else{
120 | let collectionView = self as? SwiftCollectionView
121 | textField.delegate = collectionView
122 | }
123 | }
124 |
125 | func setDelegate(for textView:UITextView){
126 |
127 | if let scrollView = self as? SwiftScrollView{
128 | textView.delegate = scrollView
129 | }else if let tableView = self as? SwiftTableView{
130 | textView.delegate = tableView
131 | }else{
132 | let collectionView = self as? SwiftCollectionView
133 | textView.delegate = collectionView
134 | }
135 | }
136 |
137 | func shouldBegin(_ textField: UITextField){
138 |
139 | textField.returnKeyType = textField.nextTextComponent == nil ? textField.returnKeyType == .default ? SwiftScrollViews.config.defaultDoneKey : textField.returnKeyType : textField.returnKeyType == .default ? .next : textField.returnKeyType
140 | }
141 |
142 | func shouldReturn(for textField: UITextField,with delegate:SwiftScrollViewsDelegate?){
143 |
144 | if let nextComponent = textField.nextTextComponent,textField.returnKeyType == .next{
145 | nextComponent.becomeFirstResponder()
146 |
147 | if nextComponent is UITextView{
148 | self.setContentForTextComponent()
149 | }
150 | }else{
151 |
152 | delegate?.didEditingDone(for: textField)
153 | textField.resignFirstResponder()
154 | }
155 | }
156 |
157 | private func setContentForTextComponent(){
158 |
159 | if let nextComponent = self.firstResponder{
160 | let point = nextComponent.superview!.convert(nextComponent.frame, to: nextComponent.window!).origin
161 |
162 | var fontSize:CGFloat = 0
163 |
164 | if let textField = nextComponent.textField{
165 |
166 | fontSize = textField.font?.pointSize ?? 0
167 | }else if let textView = nextComponent.textView{
168 |
169 | fontSize = textView.font?.pointSize ?? 0
170 | }
171 |
172 | let visibleHeight = self.viewController!.view.frame.height-keyboardHeight-fontSize
173 |
174 | if (point.y+fontSize) >= visibleHeight{
175 |
176 | self.setContentOffset(CGPoint(x: self.contentOffset.x, y: self.contentOffset.y+fontSize+SwiftScrollViews.config.textComponentSpaceFromKeyboard), animated: true)
177 | }
178 | }
179 | }
180 | }
181 |
182 | //MARK:- Extension of UIScrollView
183 | extension UIScrollView:SwiftScrollViewExtension{
184 |
185 | override open func touchesEnded(_ touches: Set, with event: UIEvent?) {
186 | super.touchesEnded(touches, with: event)
187 |
188 |
189 | if self.isSwiftScrollView{
190 |
191 | if self.isKeyboardPresented{
192 | self.firstResponder?.resignFirstResponder()
193 | }
194 | }
195 | }
196 |
197 | override open func willMove(toWindow newWindow: UIWindow?) {
198 | super.willMove(toWindow: newWindow)
199 |
200 | if self.isSwiftScrollView && newWindow == nil{
201 | self.removeNotifications()
202 | }
203 | }
204 | }
205 |
206 |
207 | //MARK:- Extension of UIView
208 | fileprivate extension UIView{
209 |
210 |
211 | //UITextField & UITextView
212 | var isTextComponent:Bool{
213 |
214 | return self is UITextField || self is UITextView
215 | }
216 |
217 | var textField:UITextField?{ return self as? UITextField }
218 |
219 | var textView:UITextView?{ return self as? UITextView }
220 |
221 | var firstResponder:UIView?{
222 |
223 | if self.isFirstResponder{
224 | return self
225 | }
226 |
227 | for view in self.subviews{
228 |
229 | if view.isFirstResponder{
230 | return view
231 | }
232 |
233 | if let firstResponder = view.firstResponder{
234 |
235 | return firstResponder
236 | }
237 | }
238 |
239 | return nil
240 | }
241 |
242 | var textComponent: UIView? {
243 | get {
244 | return objc_getAssociatedObject(self, &kAssociationKeyNextField) as? UIView
245 | }
246 | set(newTextComponent) {
247 |
248 | objc_setAssociatedObject(self, &kAssociationKeyNextField, newTextComponent, .OBJC_ASSOCIATION_RETAIN)
249 | }
250 | }
251 |
252 | var nextTextComponent:UIView?{
253 |
254 | if let nextComponent = self.textComponent{
255 |
256 | if !nextComponent.isHidden && nextComponent.isUserInteractionEnabled {
257 | return nextComponent
258 | }else{
259 | return nextComponent.nextTextComponent
260 | }
261 | }
262 | return nil
263 | }
264 |
265 | //UIKeyboard
266 | var isKeyboardPresented: Bool {
267 |
268 | for window in UIApplication.shared.windows{
269 |
270 | let className = NSStringFromClass(window.classForCoder)
271 | if className == "UIRemoteKeyboardWindow"{
272 | return true
273 | }
274 | }
275 | return false
276 | }
277 |
278 | //Parent view controller of a view
279 | var viewController: UIViewController? {
280 | var responder: UIResponder? = self
281 | while responder != nil {
282 | responder = responder!.next
283 | if let viewController = responder as? UIViewController {
284 | return viewController
285 | }
286 | }
287 | return nil
288 | }
289 | }
290 |
291 | //Shorting by origin
292 | fileprivate extension Array where Element == UIView{
293 |
294 | mutating func sorted(){
295 | self.sort { (v1, v2) -> Bool in
296 |
297 | let p1 = v1.superview!.convert(v1.frame, to: v1.window!).origin
298 | let p2 = v2.superview!.convert(v2.frame, to: v2.window!).origin
299 |
300 | return (p1.x < p2.x && p1.y == p2.y) || p1.y < p2.y
301 | }
302 | }
303 | }
304 |
--------------------------------------------------------------------------------
/SwiftScrollViews/SwiftScrollViews/SwiftTableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftTableView.swift
3 | // SwiftScrollView
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 01/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 |
13 | open class SwiftTableView:UITableView,TextComponentDelegate{
14 |
15 | private var textComponents = [UIView]()
16 | open var swiftScrollViewsDelegate:SwiftScrollViewsDelegate?
17 |
18 |
19 | override public init(frame: CGRect, style: UITableView.Style) {
20 | super.init(frame: frame, style: style)
21 | self.addNotifications()
22 |
23 | }
24 |
25 | required public init?(coder aDecoder: NSCoder) {
26 | super.init(coder: aDecoder)
27 | self.addNotifications()
28 | }
29 |
30 | override open func layoutSubviews() {
31 | super.layoutSubviews()
32 | self.delegateTextComponents(in: self, textComponents: &textComponents)
33 | }
34 |
35 |
36 | open func textFieldShouldReturn(_ textField: UITextField) -> Bool {
37 |
38 | if self.swiftScrollViewsDelegate?.textFieldShouldReturn?(textField) != false{
39 | self.shouldReturn(for: textField, with: self.swiftScrollViewsDelegate)
40 | return true
41 | }
42 | return false
43 | }
44 |
45 | open func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
46 |
47 | if self.swiftScrollViewsDelegate?.textFieldShouldBeginEditing?(textField) != false{
48 | self.shouldBegin(textField)
49 | return true
50 | }
51 | return false
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1843E5DB21B1AF710008AFD6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */; };
11 | 1843E5DD21B1AF710008AFD6 /* ScrollViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */; };
12 | 1843E5E221B1AF720008AFD6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1843E5E121B1AF720008AFD6 /* Assets.xcassets */; };
13 | 1843E5E521B1AF720008AFD6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */; };
14 | <<<<<<< HEAD:SwiftScrollViewExample/SwiftScrollViewExample.xcodeproj/project.pbxproj
15 | =======
16 | 18C2767D21B9F6BB00B5F682 /* SwiftCollectionViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C2767C21B9F6BB00B5F682 /* SwiftCollectionViewExample.swift */; };
17 | 18C2768021B9F6D000B5F682 /* SwiftTableViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18C2767F21B9F6D000B5F682 /* SwiftTableViewExample.swift */; };
18 | 18C2BA5821B6F7E20006D5F6 /* SwiftScrollViews.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1839E41021B628320049E45A /* SwiftScrollViews.framework */; };
19 | >>>>>>> 230723db524f6fc5d356bb9800f30a39c884fbc5:SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.pbxproj
20 | 18D9F99721B3C8B700839757 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18D9F99521B3C8B700839757 /* Main.storyboard */; };
21 | 18EA977423094FED00670B9A /* SwiftScrollViews.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1839E41021B628320049E45A /* SwiftScrollViews.framework */; };
22 | 18EA977523094FED00670B9A /* SwiftScrollViews.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 1839E41021B628320049E45A /* SwiftScrollViews.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXContainerItemProxy section */
26 | 1839E40F21B628320049E45A /* PBXContainerItemProxy */ = {
27 | isa = PBXContainerItemProxy;
28 | containerPortal = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
29 | proxyType = 2;
30 | remoteGlobalIDString = 1843E5C121B1A94F0008AFD6;
31 | remoteInfo = SwiftScrollViews;
32 | };
33 | 18EA977623094FED00670B9A /* PBXContainerItemProxy */ = {
34 | isa = PBXContainerItemProxy;
35 | containerPortal = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
36 | proxyType = 1;
37 | remoteGlobalIDString = 1843E5C021B1A94F0008AFD6;
38 | remoteInfo = SwiftScrollViews;
39 | };
40 | /* End PBXContainerItemProxy section */
41 |
42 | /* Begin PBXCopyFilesBuildPhase section */
43 | 18EA977823094FED00670B9A /* Embed Frameworks */ = {
44 | isa = PBXCopyFilesBuildPhase;
45 | buildActionMask = 2147483647;
46 | dstPath = "";
47 | dstSubfolderSpec = 10;
48 | files = (
49 | 18EA977523094FED00670B9A /* SwiftScrollViews.framework in Embed Frameworks */,
50 | );
51 | name = "Embed Frameworks";
52 | runOnlyForDeploymentPostprocessing = 0;
53 | };
54 | /* End PBXCopyFilesBuildPhase section */
55 |
56 | /* Begin PBXFileReference section */
57 | 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftScrollViews.xcodeproj; path = ../SwiftScrollViews/SwiftScrollViews.xcodeproj; sourceTree = ""; };
58 | 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftScrollViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
59 | 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
60 | 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewExample.swift; sourceTree = ""; };
61 | 1843E5E121B1AF720008AFD6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
62 | 1843E5E421B1AF720008AFD6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
63 | 1843E5E621B1AF720008AFD6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
64 | 18C2767C21B9F6BB00B5F682 /* SwiftCollectionViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftCollectionViewExample.swift; sourceTree = ""; };
65 | 18C2767F21B9F6D000B5F682 /* SwiftTableViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftTableViewExample.swift; sourceTree = ""; };
66 | 18D9F97121B3ABC900839757 /* SwiftScrollViews.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SwiftScrollViews.framework; sourceTree = BUILT_PRODUCTS_DIR; };
67 | 18D9F99621B3C8B700839757 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
68 | /* End PBXFileReference section */
69 |
70 | /* Begin PBXFrameworksBuildPhase section */
71 | 1843E5D421B1AF710008AFD6 /* Frameworks */ = {
72 | isa = PBXFrameworksBuildPhase;
73 | buildActionMask = 2147483647;
74 | files = (
75 | 18EA977423094FED00670B9A /* SwiftScrollViews.framework in Frameworks */,
76 | );
77 | runOnlyForDeploymentPostprocessing = 0;
78 | };
79 | /* End PBXFrameworksBuildPhase section */
80 |
81 | /* Begin PBXGroup section */
82 | 1839E40C21B628320049E45A /* Products */ = {
83 | isa = PBXGroup;
84 | children = (
85 | 1839E41021B628320049E45A /* SwiftScrollViews.framework */,
86 | );
87 | name = Products;
88 | sourceTree = "";
89 | };
90 | 1843E5CE21B1AF710008AFD6 = {
91 | isa = PBXGroup;
92 | children = (
93 | 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */,
94 | 1843E5D921B1AF710008AFD6 /* SwiftScrollViewExample */,
95 | 1843E5D821B1AF710008AFD6 /* Products */,
96 | 18D9F97021B3ABC900839757 /* Frameworks */,
97 | );
98 | sourceTree = "";
99 | };
100 | 1843E5D821B1AF710008AFD6 /* Products */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */,
104 | );
105 | name = Products;
106 | sourceTree = "";
107 | };
108 | 1843E5D921B1AF710008AFD6 /* SwiftScrollViewExample */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 1843E5DA21B1AF710008AFD6 /* AppDelegate.swift */,
112 | 1843E5DC21B1AF710008AFD6 /* ScrollViewExample.swift */,
113 | 18C2767C21B9F6BB00B5F682 /* SwiftCollectionViewExample.swift */,
114 | 18C2767F21B9F6D000B5F682 /* SwiftTableViewExample.swift */,
115 | 18D9F99521B3C8B700839757 /* Main.storyboard */,
116 | 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */,
117 | 1843E5E121B1AF720008AFD6 /* Assets.xcassets */,
118 | 1843E5E621B1AF720008AFD6 /* Info.plist */,
119 | );
120 | path = SwiftScrollViewExample;
121 | sourceTree = "";
122 | };
123 | 18D9F97021B3ABC900839757 /* Frameworks */ = {
124 | isa = PBXGroup;
125 | children = (
126 | 18D9F97121B3ABC900839757 /* SwiftScrollViews.framework */,
127 | );
128 | name = Frameworks;
129 | sourceTree = "";
130 | };
131 | /* End PBXGroup section */
132 |
133 | /* Begin PBXNativeTarget section */
134 | 1843E5D621B1AF710008AFD6 /* SwiftScrollViewExample */ = {
135 | isa = PBXNativeTarget;
136 | buildConfigurationList = 1843E5E921B1AF720008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViewExample" */;
137 | buildPhases = (
138 | 1843E5D321B1AF710008AFD6 /* Sources */,
139 | 1843E5D421B1AF710008AFD6 /* Frameworks */,
140 | 1843E5D521B1AF710008AFD6 /* Resources */,
141 | 18EA977823094FED00670B9A /* Embed Frameworks */,
142 | );
143 | buildRules = (
144 | );
145 | dependencies = (
146 | 18EA977723094FED00670B9A /* PBXTargetDependency */,
147 | );
148 | name = SwiftScrollViewExample;
149 | productName = SwiftScrollViewExample;
150 | productReference = 1843E5D721B1AF710008AFD6 /* SwiftScrollViewExample.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | /* End PBXNativeTarget section */
154 |
155 | /* Begin PBXProject section */
156 | 1843E5CF21B1AF710008AFD6 /* Project object */ = {
157 | isa = PBXProject;
158 | attributes = {
159 | LastSwiftUpdateCheck = 1010;
160 | LastUpgradeCheck = 1010;
161 | ORGANIZATIONNAME = "Rajamohan-S";
162 | TargetAttributes = {
163 | 1843E5D621B1AF710008AFD6 = {
164 | CreatedOnToolsVersion = 10.1;
165 | };
166 | };
167 | };
168 | buildConfigurationList = 1843E5D221B1AF710008AFD6 /* Build configuration list for PBXProject "SwiftScrollViewExample" */;
169 | compatibilityVersion = "Xcode 9.3";
170 | developmentRegion = en;
171 | hasScannedForEncodings = 0;
172 | knownRegions = (
173 | en,
174 | Base,
175 | );
176 | mainGroup = 1843E5CE21B1AF710008AFD6;
177 | productRefGroup = 1843E5D821B1AF710008AFD6 /* Products */;
178 | projectDirPath = "";
179 | projectReferences = (
180 | {
181 | ProductGroup = 1839E40C21B628320049E45A /* Products */;
182 | ProjectRef = 1839E40B21B628320049E45A /* SwiftScrollViews.xcodeproj */;
183 | },
184 | );
185 | projectRoot = "";
186 | targets = (
187 | 1843E5D621B1AF710008AFD6 /* SwiftScrollViewExample */,
188 | );
189 | };
190 | /* End PBXProject section */
191 |
192 | /* Begin PBXReferenceProxy section */
193 | 1839E41021B628320049E45A /* SwiftScrollViews.framework */ = {
194 | isa = PBXReferenceProxy;
195 | fileType = wrapper.framework;
196 | path = SwiftScrollViews.framework;
197 | remoteRef = 1839E40F21B628320049E45A /* PBXContainerItemProxy */;
198 | sourceTree = BUILT_PRODUCTS_DIR;
199 | };
200 | /* End PBXReferenceProxy section */
201 |
202 | /* Begin PBXResourcesBuildPhase section */
203 | 1843E5D521B1AF710008AFD6 /* Resources */ = {
204 | isa = PBXResourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 18D9F99721B3C8B700839757 /* Main.storyboard in Resources */,
208 | 1843E5E521B1AF720008AFD6 /* LaunchScreen.storyboard in Resources */,
209 | 1843E5E221B1AF720008AFD6 /* Assets.xcassets in Resources */,
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | };
213 | /* End PBXResourcesBuildPhase section */
214 |
215 | /* Begin PBXSourcesBuildPhase section */
216 | 1843E5D321B1AF710008AFD6 /* Sources */ = {
217 | isa = PBXSourcesBuildPhase;
218 | buildActionMask = 2147483647;
219 | files = (
220 | 18C2767D21B9F6BB00B5F682 /* SwiftCollectionViewExample.swift in Sources */,
221 | 1843E5DD21B1AF710008AFD6 /* ScrollViewExample.swift in Sources */,
222 | 18C2768021B9F6D000B5F682 /* SwiftTableViewExample.swift in Sources */,
223 | 1843E5DB21B1AF710008AFD6 /* AppDelegate.swift in Sources */,
224 | );
225 | runOnlyForDeploymentPostprocessing = 0;
226 | };
227 | /* End PBXSourcesBuildPhase section */
228 |
229 | /* Begin PBXTargetDependency section */
230 | 18EA977723094FED00670B9A /* PBXTargetDependency */ = {
231 | isa = PBXTargetDependency;
232 | name = SwiftScrollViews;
233 | targetProxy = 18EA977623094FED00670B9A /* PBXContainerItemProxy */;
234 | };
235 | /* End PBXTargetDependency section */
236 |
237 | /* Begin PBXVariantGroup section */
238 | 1843E5E321B1AF720008AFD6 /* LaunchScreen.storyboard */ = {
239 | isa = PBXVariantGroup;
240 | children = (
241 | 1843E5E421B1AF720008AFD6 /* Base */,
242 | );
243 | name = LaunchScreen.storyboard;
244 | sourceTree = "";
245 | };
246 | 18D9F99521B3C8B700839757 /* Main.storyboard */ = {
247 | isa = PBXVariantGroup;
248 | children = (
249 | 18D9F99621B3C8B700839757 /* Base */,
250 | );
251 | name = Main.storyboard;
252 | sourceTree = "";
253 | };
254 | /* End PBXVariantGroup section */
255 |
256 | /* Begin XCBuildConfiguration section */
257 | 1843E5E721B1AF720008AFD6 /* Debug */ = {
258 | isa = XCBuildConfiguration;
259 | buildSettings = {
260 | ALWAYS_SEARCH_USER_PATHS = NO;
261 | CLANG_ANALYZER_NONNULL = YES;
262 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
264 | CLANG_CXX_LIBRARY = "libc++";
265 | CLANG_ENABLE_MODULES = YES;
266 | CLANG_ENABLE_OBJC_ARC = YES;
267 | CLANG_ENABLE_OBJC_WEAK = YES;
268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
269 | CLANG_WARN_BOOL_CONVERSION = YES;
270 | CLANG_WARN_COMMA = YES;
271 | CLANG_WARN_CONSTANT_CONVERSION = YES;
272 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
274 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
275 | CLANG_WARN_EMPTY_BODY = YES;
276 | CLANG_WARN_ENUM_CONVERSION = YES;
277 | CLANG_WARN_INFINITE_RECURSION = YES;
278 | CLANG_WARN_INT_CONVERSION = YES;
279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
280 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
281 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
283 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
284 | CLANG_WARN_STRICT_PROTOTYPES = YES;
285 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
286 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
287 | CLANG_WARN_UNREACHABLE_CODE = YES;
288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
289 | CODE_SIGN_IDENTITY = "iPhone Developer";
290 | COPY_PHASE_STRIP = NO;
291 | DEBUG_INFORMATION_FORMAT = dwarf;
292 | ENABLE_STRICT_OBJC_MSGSEND = YES;
293 | ENABLE_TESTABILITY = YES;
294 | GCC_C_LANGUAGE_STANDARD = gnu11;
295 | GCC_DYNAMIC_NO_PIC = NO;
296 | GCC_NO_COMMON_BLOCKS = YES;
297 | GCC_OPTIMIZATION_LEVEL = 0;
298 | GCC_PREPROCESSOR_DEFINITIONS = (
299 | "DEBUG=1",
300 | "$(inherited)",
301 | );
302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
304 | GCC_WARN_UNDECLARED_SELECTOR = YES;
305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
306 | GCC_WARN_UNUSED_FUNCTION = YES;
307 | GCC_WARN_UNUSED_VARIABLE = YES;
308 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
309 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
310 | MTL_FAST_MATH = YES;
311 | ONLY_ACTIVE_ARCH = YES;
312 | SDKROOT = iphoneos;
313 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
314 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
315 | };
316 | name = Debug;
317 | };
318 | 1843E5E821B1AF720008AFD6 /* Release */ = {
319 | isa = XCBuildConfiguration;
320 | buildSettings = {
321 | ALWAYS_SEARCH_USER_PATHS = NO;
322 | CLANG_ANALYZER_NONNULL = YES;
323 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_ENABLE_OBJC_WEAK = YES;
329 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
330 | CLANG_WARN_BOOL_CONVERSION = YES;
331 | CLANG_WARN_COMMA = YES;
332 | CLANG_WARN_CONSTANT_CONVERSION = YES;
333 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
335 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
336 | CLANG_WARN_EMPTY_BODY = YES;
337 | CLANG_WARN_ENUM_CONVERSION = YES;
338 | CLANG_WARN_INFINITE_RECURSION = YES;
339 | CLANG_WARN_INT_CONVERSION = YES;
340 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
344 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
345 | CLANG_WARN_STRICT_PROTOTYPES = YES;
346 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
347 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
348 | CLANG_WARN_UNREACHABLE_CODE = YES;
349 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
350 | CODE_SIGN_IDENTITY = "iPhone Developer";
351 | COPY_PHASE_STRIP = NO;
352 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
353 | ENABLE_NS_ASSERTIONS = NO;
354 | ENABLE_STRICT_OBJC_MSGSEND = YES;
355 | GCC_C_LANGUAGE_STANDARD = gnu11;
356 | GCC_NO_COMMON_BLOCKS = YES;
357 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
358 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
359 | GCC_WARN_UNDECLARED_SELECTOR = YES;
360 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
361 | GCC_WARN_UNUSED_FUNCTION = YES;
362 | GCC_WARN_UNUSED_VARIABLE = YES;
363 | IPHONEOS_DEPLOYMENT_TARGET = 12.1;
364 | MTL_ENABLE_DEBUG_INFO = NO;
365 | MTL_FAST_MATH = YES;
366 | SDKROOT = iphoneos;
367 | SWIFT_COMPILATION_MODE = wholemodule;
368 | SWIFT_OPTIMIZATION_LEVEL = "-O";
369 | VALIDATE_PRODUCT = YES;
370 | };
371 | name = Release;
372 | };
373 | 1843E5EA21B1AF720008AFD6 /* Debug */ = {
374 | isa = XCBuildConfiguration;
375 | buildSettings = {
376 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
378 | CODE_SIGN_STYLE = Manual;
379 | DEVELOPMENT_TEAM = QUHD7NM634;
380 | INFOPLIST_FILE = SwiftScrollViewExample/Info.plist;
381 | LD_RUNPATH_SEARCH_PATHS = (
382 | "$(inherited)",
383 | "@executable_path/Frameworks",
384 | );
385 | PRODUCT_BUNDLE_IDENTIFIER = "com.rajamohan-s.com.SwiftScrollViewExample";
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | PROVISIONING_PROFILE_SPECIFIER = "Wild Card - iOS Development";
388 | SWIFT_VERSION = 4.2;
389 | TARGETED_DEVICE_FAMILY = "1,2";
390 | };
391 | name = Debug;
392 | };
393 | 1843E5EB21B1AF720008AFD6 /* Release */ = {
394 | isa = XCBuildConfiguration;
395 | buildSettings = {
396 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
397 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
398 | CODE_SIGN_STYLE = Manual;
399 | DEVELOPMENT_TEAM = QUHD7NM634;
400 | INFOPLIST_FILE = SwiftScrollViewExample/Info.plist;
401 | LD_RUNPATH_SEARCH_PATHS = (
402 | "$(inherited)",
403 | "@executable_path/Frameworks",
404 | );
405 | PRODUCT_BUNDLE_IDENTIFIER = "com.rajamohan-s.com.SwiftScrollViewExample";
406 | PRODUCT_NAME = "$(TARGET_NAME)";
407 | PROVISIONING_PROFILE_SPECIFIER = "Wild Card - iOS Development";
408 | SWIFT_VERSION = 4.2;
409 | TARGETED_DEVICE_FAMILY = "1,2";
410 | };
411 | name = Release;
412 | };
413 | /* End XCBuildConfiguration section */
414 |
415 | /* Begin XCConfigurationList section */
416 | 1843E5D221B1AF710008AFD6 /* Build configuration list for PBXProject "SwiftScrollViewExample" */ = {
417 | isa = XCConfigurationList;
418 | buildConfigurations = (
419 | 1843E5E721B1AF720008AFD6 /* Debug */,
420 | 1843E5E821B1AF720008AFD6 /* Release */,
421 | );
422 | defaultConfigurationIsVisible = 0;
423 | defaultConfigurationName = Release;
424 | };
425 | 1843E5E921B1AF720008AFD6 /* Build configuration list for PBXNativeTarget "SwiftScrollViewExample" */ = {
426 | isa = XCConfigurationList;
427 | buildConfigurations = (
428 | 1843E5EA21B1AF720008AFD6 /* Debug */,
429 | 1843E5EB21B1AF720008AFD6 /* Release */,
430 | );
431 | defaultConfigurationIsVisible = 0;
432 | defaultConfigurationName = Release;
433 | };
434 | /* End XCConfigurationList section */
435 | };
436 | rootObject = 1843E5CF21B1AF710008AFD6 /* Project object */;
437 | }
438 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rajamohan0s/SwiftScrollViews/73de6c9ac4ff165677c079986f4d8e47e83bd762/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SwiftScrollViewExample.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 30/11/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 | import SwiftScrollViews
13 |
14 | @UIApplicationMain
15 | class AppDelegate: UIResponder, UIApplicationDelegate {
16 |
17 | var window: UIWindow?
18 |
19 |
20 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
21 | // Override point for customization after application launch.
22 | SwiftScrollViews.config.textComponentSpaceFromKeyboard = 40
23 | SwiftScrollViews.config.defaultDoneKey = .continue
24 | return true
25 | }
26 |
27 | func applicationWillResignActive(_ application: UIApplication) {
28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
29 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
30 | }
31 |
32 | func applicationDidEnterBackground(_ application: UIApplication) {
33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35 | }
36 |
37 | func applicationWillEnterForeground(_ application: UIApplication) {
38 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
39 | }
40 |
41 | func applicationDidBecomeActive(_ application: UIApplication) {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 | func applicationWillTerminate(_ application: UIApplication) {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 |
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UIRequiresFullScreen
32 |
33 | UIStatusBarStyle
34 | UIStatusBarStyleLightContent
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/ScrollViewExample.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 30/11/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 | import SwiftScrollViews
13 |
14 | class ScrollViewExample: UIViewController,SwiftScrollViewsDelegate {
15 |
16 | @IBOutlet weak var scrollView: SwiftScrollView!
17 |
18 |
19 | override func viewDidLoad() {
20 | super.viewDidLoad()
21 |
22 | self.scrollView.swiftScrollViewsDelegate = self
23 | }
24 |
25 | func didEditingDone(for textField: UITextField) {
26 |
27 | let controller = UIAlertController(title: textField.placeholder ?? "Place Holder Empty!", message: "✅ Editing Done!", preferredStyle: .alert)
28 | controller.addAction(UIAlertAction(title: "👍", style: .default, handler: nil))
29 | self.present(controller, animated: true, completion: nil)
30 | }
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/SwiftCollectionViewExample.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftTableViewExample.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 07/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 |
12 | import UIKit
13 | import SwiftScrollViews
14 |
15 | class SwiftCollectionViewExample: UIViewController,UICollectionViewDataSource,SwiftScrollViewsDelegate {
16 |
17 | @IBOutlet weak var collectionView: SwiftCollectionView!
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 |
21 | self.collectionView.swiftScrollViewsDelegate = self
22 | }
23 |
24 | func numberOfSections(in collectionView: UICollectionView) -> Int {
25 |
26 | return 1
27 | }
28 |
29 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
30 |
31 | return 20
32 | }
33 |
34 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
35 |
36 | let cell = self.collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
37 | let textField = cell.viewWithTag(1) as! UITextField
38 | textField.placeholder = "Section \(indexPath.section) at Index \(indexPath.row)"
39 | textField.returnKeyType = indexPath.section == 0 && indexPath.row == 1 ? .search : indexPath.section == 1 && indexPath.row == 4 ? .go : .default
40 | return cell
41 |
42 | }
43 |
44 | func didEditingDone(for textField: UITextField) {
45 |
46 | let controller = UIAlertController(title: textField.placeholder ?? "Place Holder Empty!", message: "✅ Editing Done!", preferredStyle: .alert)
47 | controller.addAction(UIAlertAction(title: "👍", style: .default, handler: nil))
48 | self.present(controller, animated: true, completion: nil)
49 | }
50 |
51 |
52 |
53 | /*
54 | // MARK: - Navigation
55 |
56 | // In a storyboard-based application, you will often want to do a little preparation before navigation
57 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
58 | // Get the new view controller using segue.destination.
59 | // Pass the selected object to the new view controller.
60 | }
61 | */
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/SwiftScrollViewsExample/SwiftScrollViewExample/SwiftTableViewExample.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftCollectionViewExample.swift
3 | // SwiftScrollViewExample
4 | //
5 | // Created by Rajamohan S, Independent Software Developer on 07/12/18.
6 | // Copyright (c) 2018 Rajamohan S. All rights reserved.
7 | //
8 | // See https://rajamohan-s.github.io/ for author information.
9 | //
10 |
11 | import UIKit
12 | import SwiftScrollViews
13 |
14 | class SwiftTableViewExample: UIViewController,UITableViewDataSource,SwiftScrollViewsDelegate {
15 |
16 | @IBOutlet weak var tableView: SwiftTableView!
17 | override func viewDidLoad() {
18 | super.viewDidLoad()
19 |
20 |
21 | self.tableView.swiftScrollViewsDelegate = self
22 | }
23 |
24 | func numberOfSections(in tableView: UITableView) -> Int {
25 |
26 | return 3
27 | }
28 |
29 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
30 |
31 | return section == 0 ? 2 : section == 1 ? 5 : 4
32 | }
33 |
34 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
35 |
36 | let cell = self.tableView.dequeueReusableCell(withIdentifier: "cell")!
37 | let textField = cell.viewWithTag(1) as! UITextField
38 | textField.placeholder = "Section \(indexPath.section) at Index \(indexPath.row)"
39 | textField.returnKeyType = indexPath.section == 0 && indexPath.row == 1 ? .search : indexPath.section == 1 && indexPath.row == 4 ? .go : .default
40 | return cell
41 | }
42 |
43 | func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
44 |
45 | return ["Login","Client Register","Admin Register"][section]
46 | }
47 | func didEditingDone(for textField: UITextField) {
48 |
49 | let controller = UIAlertController(title: textField.placeholder ?? "Place Holder Empty!", message: "✅ Editing Done!", preferredStyle: .alert)
50 | controller.addAction(UIAlertAction(title: "👍", style: .default, handler: nil))
51 | self.present(controller, animated: true, completion: nil)
52 | }
53 |
54 |
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------