All Projects → shial4 → SWindow

shial4 / SWindow

Licence: MIT License
Easy to use Swift windows manager

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to SWindow

LifecycleMvp
No description or website provided.
Stars: ✭ 20 (+42.86%)
Mutual labels:  presenter
FacebookMessengerActivity
Share with Facebook Messenger App.
Stars: ✭ 16 (+14.29%)
Mutual labels:  ios-lib
StackViewLayout
Coming soon!
Stars: ✭ 26 (+85.71%)
Mutual labels:  ios-lib
presenter
Easy class decoration.
Stars: ✭ 13 (-7.14%)
Mutual labels:  presenter
Chromecast-Kiosk
A open source software to create a digital signage system with google chromecasts.
Stars: ✭ 81 (+478.57%)
Mutual labels:  presenter
Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+1592.86%)
Mutual labels:  ios-lib
SPWaterWaveProgressIndicatorView
An iOS Custom Water Wave Progress Indicator View with Demo
Stars: ✭ 24 (+71.43%)
Mutual labels:  ios-lib
FoldViewController
FoldViewController is folding menu view controller for the iOS platform based on the excellent ECSlidingViewController and XYOrigami projects.
Stars: ✭ 12 (-14.29%)
Mutual labels:  ios-lib
ABatteryView
A Custom Battery View for iOS and Android
Stars: ✭ 14 (+0%)
Mutual labels:  ios-lib
cordova-spotify-oauth
🔐 Easy Spotify authentication for Cordova / PhoneGap apps
Stars: ✭ 15 (+7.14%)
Mutual labels:  ios-lib
sent
a simple plaintext presentation tool
Stars: ✭ 22 (+57.14%)
Mutual labels:  presentation-tools
Unity.Blog.Override App Delegate
A maintainable way to extend / override app delegate in Unity iOS / OSX standalone player. (Much) more at http://eppz.eu/blog/override-app-delegate-unity-ios-osx-1/
Stars: ✭ 28 (+100%)
Mutual labels:  ios-lib
cordova-spotify
🎶 A Cordova / PhoneGap plugin for the Spotify SDKs on iOS and Android
Stars: ✭ 22 (+57.14%)
Mutual labels:  ios-lib
tiff-ios
Tagged Image File Format iOS Library
Stars: ✭ 26 (+85.71%)
Mutual labels:  ios-lib
yii2-presenter
Yii2 View Presenter
Stars: ✭ 13 (-7.14%)
Mutual labels:  presenter
Teller-iOS
iOS library that manages your app's cached data with ease.
Stars: ✭ 12 (-14.29%)
Mutual labels:  ios-lib
routing
Aplus Framework Routing Library
Stars: ✭ 186 (+1228.57%)
Mutual labels:  presenter
burgundy
A simple wrapper for objects (think of Burgundy as a decorator/presenter) in less than 150 lines.
Stars: ✭ 48 (+242.86%)
Mutual labels:  presenter
ArtShredder
📱Banksy Shredder for iOS
Stars: ✭ 41 (+192.86%)
Mutual labels:  presenter
M2DWebViewController
Simple built-in web view controller using WebKit.
Stars: ✭ 25 (+78.57%)
Mutual labels:  ios-lib

SWindow

Language License TravisCI CocoaPods Carthage

SWindow is an easy to use Swift windows manager. Don't spend hours writing your code to present and dismiss modal view controllers, stop wasting your time on debugging why your modal presentation disapear. Without issues, simple and safe present your controller!

💊 Usage

Basic Example Make your controller conform to SModalPresentation protocol

class YourController: UIViewController, SModalPresentation {}

To present your controller simple call:

let controller = YourController()
controller.sPresent()

To dismiss or remove from wait queue call:

controller.sWithdraw()

If you want replace current presented controller with other call:

controller.sReplace(with: newController)

SWindow automatically add your controller to queue if other is currently presented. Moreover on sWithdraw() event after dismiss will present first controller from queue with highest priority.

Advance Configuration Above was pretty simple example. However SWindow provides multiple configuration options.

First thing what you can do is to extend SModal class with your own values. Belove you can see an example what can you modify.

extension SModal {
    static var shouldMakeKey: Bool {
        return false
    }
    
    static var windowLevel: UIWindowLevel {
        return UIWindowLevelAlert - 1
    }
    
    static var animationDuration: TimeInterval {
        return 0.2
    }
}

First of all in every project I would extend SModal to return true under shouldMakeKey thanks to that our window will become keyWindow and will receive system events.

Second thing you can adjust is SModalPresentation. your Controller can be dismiss by SWindow if you return true under canDismiss. Thanks to this parameter what ever will pop in to queue and the current presented controller will be return positive value under this flag SWindow will dismiss it and present next one from the queue.

extension YourController {    
    public var canDismiss: Bool {
        return false
    }
    
    public var priority: SModalPriority {
        return .Required
    }
}

As I have wrote earlier YourController is ordered by priority during dequeue for presentation. You can change priority for each of your controllers coresponding to SModalPresentation.

Last things to extend are: sPresent() sWithdraw() sReplace(with: UIViewController) Each of this method have additional arguments with defaults set as follows animated: Bool = false, completion: (() -> Void)? = nil

🔧 Installation

CocoaPods:

Add the line pod "SWindow" to your Podfile

Carthage:

Add the line github "shial4/swindow" to your Cartfile

Manual:

Clone the repo and drag the file SWindow.swift into your Xcode project.

Swift Package Manager:

Add the line .package(url: "https://github.com/shial4/SWindow.git", from: "0.1.10") to your Package.swift

Contributing

Be welcome to contribute to this project! :)

Questions

Just create an issue on GitHub.

📝 License

This project was released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].