Add SWindow

This commit is contained in:
Shial 2017-05-30 23:32:37 +10:00
commit a4e4611b2a
11 changed files with 823 additions and 0 deletions

View File

@ -0,0 +1,429 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
62A735B41EDDA1CA008174F2 /* SWindow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62A735AA1EDDA1CA008174F2 /* SWindow.framework */; };
62A735B91EDDA1CA008174F2 /* SWindowTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A735B81EDDA1CA008174F2 /* SWindowTests.swift */; };
62A735BB1EDDA1CA008174F2 /* SWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 62A735AD1EDDA1CA008174F2 /* SWindow.h */; settings = {ATTRIBUTES = (Public, ); }; };
62A735C51EDDA231008174F2 /* SWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A735C41EDDA231008174F2 /* SWindow.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
62A735B51EDDA1CA008174F2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 62A735A11EDDA1CA008174F2 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 62A735A91EDDA1CA008174F2;
remoteInfo = SWindow;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
62A735AA1EDDA1CA008174F2 /* SWindow.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SWindow.framework; sourceTree = BUILT_PRODUCTS_DIR; };
62A735AD1EDDA1CA008174F2 /* SWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWindow.h; sourceTree = "<group>"; };
62A735AE1EDDA1CA008174F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
62A735B31EDDA1CA008174F2 /* SWindowTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SWindowTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
62A735B81EDDA1CA008174F2 /* SWindowTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SWindowTests.swift; sourceTree = "<group>"; };
62A735BA1EDDA1CA008174F2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
62A735C41EDDA231008174F2 /* SWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWindow.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
62A735A61EDDA1CA008174F2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
62A735B01EDDA1CA008174F2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
62A735B41EDDA1CA008174F2 /* SWindow.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
62A735A01EDDA1CA008174F2 = {
isa = PBXGroup;
children = (
62A735AC1EDDA1CA008174F2 /* SWindow */,
62A735B71EDDA1CA008174F2 /* SWindowTests */,
62A735AB1EDDA1CA008174F2 /* Products */,
);
sourceTree = "<group>";
};
62A735AB1EDDA1CA008174F2 /* Products */ = {
isa = PBXGroup;
children = (
62A735AA1EDDA1CA008174F2 /* SWindow.framework */,
62A735B31EDDA1CA008174F2 /* SWindowTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
62A735AC1EDDA1CA008174F2 /* SWindow */ = {
isa = PBXGroup;
children = (
62A735AD1EDDA1CA008174F2 /* SWindow.h */,
62A735AE1EDDA1CA008174F2 /* Info.plist */,
62A735C41EDDA231008174F2 /* SWindow.swift */,
);
path = SWindow;
sourceTree = "<group>";
};
62A735B71EDDA1CA008174F2 /* SWindowTests */ = {
isa = PBXGroup;
children = (
62A735B81EDDA1CA008174F2 /* SWindowTests.swift */,
62A735BA1EDDA1CA008174F2 /* Info.plist */,
);
path = SWindowTests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
62A735A71EDDA1CA008174F2 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
62A735BB1EDDA1CA008174F2 /* SWindow.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
62A735A91EDDA1CA008174F2 /* SWindow */ = {
isa = PBXNativeTarget;
buildConfigurationList = 62A735BE1EDDA1CA008174F2 /* Build configuration list for PBXNativeTarget "SWindow" */;
buildPhases = (
62A735A51EDDA1CA008174F2 /* Sources */,
62A735A61EDDA1CA008174F2 /* Frameworks */,
62A735A71EDDA1CA008174F2 /* Headers */,
62A735A81EDDA1CA008174F2 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = SWindow;
productName = SWindow;
productReference = 62A735AA1EDDA1CA008174F2 /* SWindow.framework */;
productType = "com.apple.product-type.framework";
};
62A735B21EDDA1CA008174F2 /* SWindowTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 62A735C11EDDA1CA008174F2 /* Build configuration list for PBXNativeTarget "SWindowTests" */;
buildPhases = (
62A735AF1EDDA1CA008174F2 /* Sources */,
62A735B01EDDA1CA008174F2 /* Frameworks */,
62A735B11EDDA1CA008174F2 /* Resources */,
);
buildRules = (
);
dependencies = (
62A735B61EDDA1CA008174F2 /* PBXTargetDependency */,
);
name = SWindowTests;
productName = SWindowTests;
productReference = 62A735B31EDDA1CA008174F2 /* SWindowTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
62A735A11EDDA1CA008174F2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = Shial;
TargetAttributes = {
62A735A91EDDA1CA008174F2 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = 7Z5C7X6723;
LastSwiftMigration = 0830;
ProvisioningStyle = Automatic;
};
62A735B21EDDA1CA008174F2 = {
CreatedOnToolsVersion = 8.3.2;
DevelopmentTeam = 7Z5C7X6723;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 62A735A41EDDA1CA008174F2 /* Build configuration list for PBXProject "SWindow" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 62A735A01EDDA1CA008174F2;
productRefGroup = 62A735AB1EDDA1CA008174F2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
62A735A91EDDA1CA008174F2 /* SWindow */,
62A735B21EDDA1CA008174F2 /* SWindowTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
62A735A81EDDA1CA008174F2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
62A735B11EDDA1CA008174F2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
62A735A51EDDA1CA008174F2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62A735C51EDDA231008174F2 /* SWindow.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
62A735AF1EDDA1CA008174F2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62A735B91EDDA1CA008174F2 /* SWindowTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
62A735B61EDDA1CA008174F2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 62A735A91EDDA1CA008174F2 /* SWindow */;
targetProxy = 62A735B51EDDA1CA008174F2 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
62A735BC1EDDA1CA008174F2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
62A735BD1EDDA1CA008174F2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
62A735BF1EDDA1CA008174F2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7Z5C7X6723;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SWindow/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.shial.swindow.ios.SWindow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
62A735C01EDDA1CA008174F2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 7Z5C7X6723;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = SWindow/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.shial.swindow.ios.SWindow;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
62A735C21EDDA1CA008174F2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEVELOPMENT_TEAM = 7Z5C7X6723;
INFOPLIST_FILE = SWindowTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.shial.swindow.ios.SWindowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
62A735C31EDDA1CA008174F2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEVELOPMENT_TEAM = 7Z5C7X6723;
INFOPLIST_FILE = SWindowTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.shial.swindow.ios.SWindowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
62A735A41EDDA1CA008174F2 /* Build configuration list for PBXProject "SWindow" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62A735BC1EDDA1CA008174F2 /* Debug */,
62A735BD1EDDA1CA008174F2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
62A735BE1EDDA1CA008174F2 /* Build configuration list for PBXNativeTarget "SWindow" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62A735BF1EDDA1CA008174F2 /* Debug */,
62A735C01EDDA1CA008174F2 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
62A735C11EDDA1CA008174F2 /* Build configuration list for PBXNativeTarget "SWindowTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
62A735C21EDDA1CA008174F2 /* Debug */,
62A735C31EDDA1CA008174F2 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 62A735A11EDDA1CA008174F2 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:SWindow.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62A735A91EDDA1CA008174F2"
BuildableName = "SWindow.framework"
BlueprintName = "SWindow"
ReferencedContainer = "container:SWindow.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62A735B21EDDA1CA008174F2"
BuildableName = "SWindowTests.xctest"
BlueprintName = "SWindowTests"
ReferencedContainer = "container:SWindow.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62A735A91EDDA1CA008174F2"
BuildableName = "SWindow.framework"
BlueprintName = "SWindow"
ReferencedContainer = "container:SWindow.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">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62A735A91EDDA1CA008174F2"
BuildableName = "SWindow.framework"
BlueprintName = "SWindow"
ReferencedContainer = "container:SWindow.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "62A735A91EDDA1CA008174F2"
BuildableName = "SWindow.framework"
BlueprintName = "SWindow"
ReferencedContainer = "container:SWindow.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,27 @@
<?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>SWindow.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>62A735A91EDDA1CA008174F2</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>62A735B21EDDA1CA008174F2</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

24
SWindow/Info.plist Normal file
View File

@ -0,0 +1,24 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

19
SWindow/SWindow.h Normal file
View File

@ -0,0 +1,19 @@
//
// SWindow.h
// SWindow
//
// Created by Shial on 30/5/17.
// Copyright © 2017 Shial. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SWindow.
FOUNDATION_EXPORT double SWindowVersionNumber;
//! Project version string for SWindow.
FOUNDATION_EXPORT const unsigned char SWindowVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SWindow/PublicHeader.h>

155
SWindow/SWindow.swift Normal file
View File

@ -0,0 +1,155 @@
//
// SWindow.swift
// SWindow
//
// Created by Shial on 30/5/17.
// Copyright © 2017 Shial. All rights reserved.
//
import UIKit
public typealias SModalPriority = Float
extension SModalPriority {
public static var Low: SModalPriority = 250
public static var Required: SModalPriority = 500
public static var High: SModalPriority = 750
}
public enum SModalStatus {
case presented
case waitingInStack
case none
}
public class SModal {
static let modalWindow: UIWindow = {
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = .clear
window.windowLevel = windowLevel
window.isHidden = true
return window
}()
static var stack: [SModalPresentation] = []
static var windowLevel: UIWindowLevel {
return UIWindowLevelAlert - 1
}
static var animationDuration: TimeInterval {
return 0.2
}
}
public protocol SModalStack {
var stack: [SModalPresentation] { get }
var modalStatus: SModalStatus { get }
var canDismiss: Bool { get }
var priority: SModalPriority { get }
}
public protocol SModalPresentation: class, SModalStack {
func sPresent(animated: Bool, completion: (() -> Void)?)
func sWithdraw(animated: Bool, completion: (() -> Void)?)
}
extension SModalPresentation {
public var modalStatus: SModalStatus {
if SModal.modalWindow.rootViewController === self {
return .presented
}
if SModal.stack.contains(where: { $0 === self }) {
return .waitingInStack
}
return .none
}
public var canDismiss: Bool {
return false
}
public var stack: [SModalPresentation] {
return SModal.stack
}
public var priority: SModalPriority {
return .Required
}
}
extension SModalPresentation where Self: UIViewController {
func sReplace<T: UIViewController>(with controller: T, animated: Bool, completion: (() -> Void)?) where T: SModalPresentation {
if animated {
SModal.modalWindow.isHidden = false
UIView.animate(withDuration: SModal.animationDuration, animations: {
SModal.modalWindow.rootViewController = controller
SModal.modalWindow.makeKey()
SModal.modalWindow.alpha = 1
}, completion: { completed in
completion?()
})
} else {
SModal.modalWindow.rootViewController = controller
SModal.modalWindow.makeKey()
SModal.modalWindow.isHidden = false
completion?()
}
}
func sPresent(animated: Bool, completion: (() -> Void)?) {
guard let currentPresented = SModal.modalWindow.rootViewController else {
SModal.modalWindow.rootViewController = self
SModal.modalWindow.makeKey()
if animated {
SModal.modalWindow.alpha = 0
SModal.modalWindow.isHidden = false
UIView.animate(withDuration: SModal.animationDuration, animations: {
SModal.modalWindow.alpha = 1
}, completion: { completed in
completion?()
})
} else {
SModal.modalWindow.isHidden = false
completion?()
}
return
}
if let sModalController = currentPresented as? Self, sModalController.canDismiss == true {
sModalController.sReplace(with: self, animated: animated, completion: completion)
} else {
SModal.stack.append(self)
}
}
func sWithdraw(animated: Bool, completion: (() -> Void)?) {
if SModal.modalWindow.rootViewController === self {
if animated {
SModal.modalWindow.alpha = 1
UIView.animate(withDuration: SModal.animationDuration, animations: {
SModal.modalWindow.alpha = 0
}, completion: { completed in
SModal.modalWindow.isHidden = true
completion?()
})
} else {
SModal.modalWindow.isHidden = true
completion?()
}
SModal.modalWindow.rootViewController = nil
SModal.modalWindow.resignKey()
} else if SModal.stack.contains(where: { $0 === self }) {
SModal.stack = SModal.stack.filter() { !($0 === self) }
}
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + SModal.animationDuration) {
if let controller = SModal.stack.sorted(by: {$0.priority > $1.priority}).first {
SModal.stack.removeFirst()
controller.sPresent(animated: true, completion: nil)
}
}
}
}

22
SWindowTests/Info.plist Normal file
View File

@ -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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,36 @@
//
// SWindowTests.swift
// SWindowTests
//
// Created by Shial on 30/5/17.
// Copyright © 2017 Shial. All rights reserved.
//
import XCTest
@testable import SWindow
class SWindowTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}