CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

SuspendedViewStub 0.1.1

SuspendedViewStub 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release May 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Torlopov Andrey.



  • By
  • Torlopov Andrey

SuspendedViewStub

About

It’s my first pod, and if you find bugs, or some question - write me on email, or make issue in this repo.

It is just simple stub for your application, when you press home button. The main window is covered by a view of a specific color or your custom controller. Additionally, you can set autoclosing when your app resets foreground mode. In demo, I use custom controller with password field.

About

Installation

SuspendedViewStub is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SuspendedViewStub"

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

How it use

  • In your project add the following line to your Podfile:
pod "SuspendedViewStub"

In your project you have 2 ways:

  • Use colored view. Than you write in AppDelegate.swift:
func applicationDidEnterBackground(_ application: UIApplication) {
SuspendedViewStub.setStub(color: .green)
}
  • Use custom controller. Than you write in AppDelegate.swift:
func applicationDidEnterBackground(_ application: UIApplication) {
SuspendedViewStub.setStub(sceneName: CONTROLLER_IDENTITY, autocomplete: false)

//By default storyboardname is "Main" and autocomplete is true.
SuspendedViewStub.setStub(sceneName: CONTROLLER_IDENTITY, storyboardName: STORYBOARD_NAME, autocomplete: false)
}
  • Important to write in AppDelegate.swift next code:
func applicationWillEnterForeground(_ application: UIApplication) {
//This code is required!
SuspendedViewStub.removeStub() 
}

That’s all

Author

[email protected]

skype: torlopov.andrey

License

SuspendedViewStub is available under the MIT license. See the LICENSE file for more info.