-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Danil Gontovnik
committed
Sep 20, 2016
1 parent
8d742ff
commit 833b9d5
Showing
6 changed files
with
130 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = "DGElasticPullToRefresh" | ||
spec.version = "1.0.3" | ||
spec.version = "1.1" | ||
spec.authors = { "Danil Gontovnik" => "[email protected]" } | ||
spec.homepage = "https://github.com/gontovnik/DGElasticPullToRefresh" | ||
spec.summary = "Elastic pull to refresh compontent developed in Swift" | ||
spec.source = { :git => "https://github.com/gontovnik/DGElasticPullToRefresh.git" } | ||
spec.source = { :git => "https://github.com/gontovnik/DGElasticPullToRefresh.git", | ||
:tag => '1.1' } | ||
spec.license = { :type => "MIT", :file => "LICENSE" } | ||
spec.platform = :ios, '7.0' | ||
spec.platform = :ios, '8.0' | ||
spec.source_files = "DGElasticPullToRefresh/*.swift" | ||
|
||
spec.requires_arc = true | ||
|
||
spec.ios.deployment_target = '7.0' | ||
spec.ios.deployment_target = '8.0' | ||
spec.ios.frameworks = ['UIKit', 'Foundation'] | ||
end |
Binary file added
BIN
+16.7 KB
...eproj/project.xcworkspace/xcuserdata/gontovnik.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
91 changes: 91 additions & 0 deletions
91
...odeproj/xcuserdata/gontovnik.xcuserdatad/xcschemes/DGElasticPullToRefreshExample.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0800" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "05CD14641BBE8FEA00AF4030" | ||
BuildableName = "DGElasticPullToRefreshExample.app" | ||
BlueprintName = "DGElasticPullToRefreshExample" | ||
ReferencedContainer = "container:DGElasticPullToRefreshExample.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "05CD14641BBE8FEA00AF4030" | ||
BuildableName = "DGElasticPullToRefreshExample.app" | ||
BlueprintName = "DGElasticPullToRefreshExample" | ||
ReferencedContainer = "container:DGElasticPullToRefreshExample.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "05CD14641BBE8FEA00AF4030" | ||
BuildableName = "DGElasticPullToRefreshExample.app" | ||
BlueprintName = "DGElasticPullToRefreshExample" | ||
ReferencedContainer = "container:DGElasticPullToRefreshExample.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "05CD14641BBE8FEA00AF4030" | ||
BuildableName = "DGElasticPullToRefreshExample.app" | ||
BlueprintName = "DGElasticPullToRefreshExample" | ||
ReferencedContainer = "container:DGElasticPullToRefreshExample.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
22 changes: 22 additions & 0 deletions
22
...reshExample.xcodeproj/xcuserdata/gontovnik.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>DGElasticPullToRefreshExample.xcscheme</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
<key>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>05CD14641BBE8FEA00AF4030</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Tutorial on how this bounce effect was achieved can be found [here](http://iostu | |
* Xcode 7 or higher | ||
* iOS 8.0 or higher (may work on previous versions, just did not test it) | ||
* ARC | ||
* Swift 2.0 | ||
* Swift 3.0 | ||
|
||
## Demo | ||
|
||
|
@@ -38,14 +38,14 @@ let loadingView = DGElasticPullToRefreshLoadingViewCircle() | |
loadingView.tintColor = UIColor(red: 78/255.0, green: 221/255.0, blue: 200/255.0, alpha: 1.0) | ||
tableView.dg_addPullToRefreshWithActionHandler({ [weak self] () -> Void in | ||
// Add your logic here | ||
// Do not forget to call dg_stopLoading() at the end | ||
// Do not forget to call dg_stopLoading() at the end | ||
self?.tableView.dg_stopLoading() | ||
}, loadingView: loadingView) | ||
tableView.dg_setPullToRefreshFillColor(UIColor(red: 57/255.0, green: 67/255.0, blue: 89/255.0, alpha: 1.0)) | ||
tableView.dg_setPullToRefreshBackgroundColor(tableView.backgroundColor!) | ||
``` | ||
|
||
Do not forget to remove pull to refresh on view controller deinit. It is a temporary solution. | ||
Do not forget to remove pull to refresh on view controller deinit. It is a temporary solution. | ||
|
||
``` swift | ||
deinit { | ||
|
@@ -58,21 +58,21 @@ deinit { | |
Add pull to refresh without loading view: | ||
|
||
``` swift | ||
func dg_addPullToRefreshWithActionHandler(actionHandler: () -> Void) | ||
func dg_addPullToRefreshWithActionHandler(_ actionHandler: @escaping () -> Void) | ||
``` | ||
|
||
Add pull to refresh with loading view: | ||
|
||
``` swift | ||
func dg_addPullToRefreshWithActionHandler(actionHandler: () -> Void, loadingView: DGElasticPullToRefreshLoadingView?) | ||
func dg_addPullToRefreshWithActionHandler(_ actionHandler: @escaping () -> Void, loadingView: DGElasticPullToRefreshLoadingView?) | ||
``` | ||
|
||
You can use built-in *DGElasticPullToRefreshLoadingViewCircle* or create your own by subclassing **DGElasticPullToRefreshLoadingView** and implementing these methods: | ||
|
||
``` swift | ||
func setPullProgress(progress: CGFloat) { } | ||
func startAnimating() { } | ||
func stopLoading() { } | ||
func setPullProgress(_ progress: CGFloat) | ||
func startAnimating() | ||
func stopLoading() | ||
``` | ||
|
||
Remove pull to refresh: | ||
|
@@ -90,13 +90,13 @@ func dg_startLoading() | |
Change pull to refresh background color: | ||
|
||
``` swift | ||
func dg_setPullToRefreshBackgroundColor(color: UIColor) | ||
func dg_setPullToRefreshBackgroundColor(_ color: UIColor) | ||
``` | ||
|
||
Change pull to refresh fill color: | ||
|
||
``` swift | ||
func dg_setPullToRefreshFillColor(color: UIColor) | ||
``` swift | ||
func dg_setPullToRefreshFillColor(_ color: UIColor) | ||
``` | ||
|
||
## Contribution | ||
|
@@ -111,7 +111,6 @@ Danil Gontovnik | |
- https://twitter.com/gontovnik | ||
- http://gontovnik.com/ | ||
- [email protected] | ||
- http://iostuts.io/author/danil-gontovnik/ | ||
|
||
## License | ||
|
||
|