diff --git a/JSSAlertViewMasterDetail/.DS_Store b/JSSAlertViewMasterDetail/.DS_Store new file mode 100644 index 0000000..343624c Binary files /dev/null and b/JSSAlertViewMasterDetail/.DS_Store differ diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.pbxproj b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8c51048 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.pbxproj @@ -0,0 +1,444 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 0DB648861B6C04940005386A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB648851B6C04940005386A /* AppDelegate.swift */; }; + 0DB648881B6C04940005386A /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB648871B6C04940005386A /* MasterViewController.swift */; }; + 0DB6488A1B6C04940005386A /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB648891B6C04940005386A /* DetailViewController.swift */; }; + 0DB6488D1B6C04940005386A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0DB6488B1B6C04940005386A /* Main.storyboard */; }; + 0DB6488F1B6C04940005386A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0DB6488E1B6C04940005386A /* Images.xcassets */; }; + 0DB648921B6C04940005386A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0DB648901B6C04940005386A /* LaunchScreen.xib */; }; + 0DB6489E1B6C04940005386A /* JSSAlertViewMasterDetailTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB6489D1B6C04940005386A /* JSSAlertViewMasterDetailTests.swift */; }; + 0DB648A91B6C04AF0005386A /* JSSAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DB648A81B6C04AF0005386A /* JSSAlertView.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0DB648981B6C04940005386A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0DB648781B6C04940005386A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0DB6487F1B6C04940005386A; + remoteInfo = JSSAlertViewMasterDetail; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0DB648801B6C04940005386A /* JSSAlertViewMasterDetail.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JSSAlertViewMasterDetail.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0DB648841B6C04940005386A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0DB648851B6C04940005386A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 0DB648871B6C04940005386A /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; }; + 0DB648891B6C04940005386A /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; + 0DB6488C1B6C04940005386A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 0DB6488E1B6C04940005386A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 0DB648911B6C04940005386A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + 0DB648971B6C04940005386A /* JSSAlertViewMasterDetailTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JSSAlertViewMasterDetailTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 0DB6489C1B6C04940005386A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0DB6489D1B6C04940005386A /* JSSAlertViewMasterDetailTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSSAlertViewMasterDetailTests.swift; sourceTree = ""; }; + 0DB648A81B6C04AF0005386A /* JSSAlertView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = JSSAlertView.swift; path = ../../JSSAlertView.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0DB6487D1B6C04940005386A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0DB648941B6C04940005386A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0DB648771B6C04940005386A = { + isa = PBXGroup; + children = ( + 0DB648821B6C04940005386A /* JSSAlertViewMasterDetail */, + 0DB6489A1B6C04940005386A /* JSSAlertViewMasterDetailTests */, + 0DB648811B6C04940005386A /* Products */, + ); + sourceTree = ""; + }; + 0DB648811B6C04940005386A /* Products */ = { + isa = PBXGroup; + children = ( + 0DB648801B6C04940005386A /* JSSAlertViewMasterDetail.app */, + 0DB648971B6C04940005386A /* JSSAlertViewMasterDetailTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 0DB648821B6C04940005386A /* JSSAlertViewMasterDetail */ = { + isa = PBXGroup; + children = ( + 0DB648A71B6C04A50005386A /* JSSAlertView */, + 0DB648851B6C04940005386A /* AppDelegate.swift */, + 0DB648871B6C04940005386A /* MasterViewController.swift */, + 0DB648891B6C04940005386A /* DetailViewController.swift */, + 0DB6488B1B6C04940005386A /* Main.storyboard */, + 0DB6488E1B6C04940005386A /* Images.xcassets */, + 0DB648901B6C04940005386A /* LaunchScreen.xib */, + 0DB648831B6C04940005386A /* Supporting Files */, + ); + path = JSSAlertViewMasterDetail; + sourceTree = ""; + }; + 0DB648831B6C04940005386A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 0DB648841B6C04940005386A /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 0DB6489A1B6C04940005386A /* JSSAlertViewMasterDetailTests */ = { + isa = PBXGroup; + children = ( + 0DB6489D1B6C04940005386A /* JSSAlertViewMasterDetailTests.swift */, + 0DB6489B1B6C04940005386A /* Supporting Files */, + ); + path = JSSAlertViewMasterDetailTests; + sourceTree = ""; + }; + 0DB6489B1B6C04940005386A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 0DB6489C1B6C04940005386A /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 0DB648A71B6C04A50005386A /* JSSAlertView */ = { + isa = PBXGroup; + children = ( + 0DB648A81B6C04AF0005386A /* JSSAlertView.swift */, + ); + name = JSSAlertView; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0DB6487F1B6C04940005386A /* JSSAlertViewMasterDetail */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0DB648A11B6C04940005386A /* Build configuration list for PBXNativeTarget "JSSAlertViewMasterDetail" */; + buildPhases = ( + 0DB6487C1B6C04940005386A /* Sources */, + 0DB6487D1B6C04940005386A /* Frameworks */, + 0DB6487E1B6C04940005386A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = JSSAlertViewMasterDetail; + productName = JSSAlertViewMasterDetail; + productReference = 0DB648801B6C04940005386A /* JSSAlertViewMasterDetail.app */; + productType = "com.apple.product-type.application"; + }; + 0DB648961B6C04940005386A /* JSSAlertViewMasterDetailTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0DB648A41B6C04940005386A /* Build configuration list for PBXNativeTarget "JSSAlertViewMasterDetailTests" */; + buildPhases = ( + 0DB648931B6C04940005386A /* Sources */, + 0DB648941B6C04940005386A /* Frameworks */, + 0DB648951B6C04940005386A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 0DB648991B6C04940005386A /* PBXTargetDependency */, + ); + name = JSSAlertViewMasterDetailTests; + productName = JSSAlertViewMasterDetailTests; + productReference = 0DB648971B6C04940005386A /* JSSAlertViewMasterDetailTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0DB648781B6C04940005386A /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Jay Stakelon"; + TargetAttributes = { + 0DB6487F1B6C04940005386A = { + CreatedOnToolsVersion = 6.4; + }; + 0DB648961B6C04940005386A = { + CreatedOnToolsVersion = 6.4; + TestTargetID = 0DB6487F1B6C04940005386A; + }; + }; + }; + buildConfigurationList = 0DB6487B1B6C04940005386A /* Build configuration list for PBXProject "JSSAlertViewMasterDetail" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 0DB648771B6C04940005386A; + productRefGroup = 0DB648811B6C04940005386A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0DB6487F1B6C04940005386A /* JSSAlertViewMasterDetail */, + 0DB648961B6C04940005386A /* JSSAlertViewMasterDetailTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 0DB6487E1B6C04940005386A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0DB6488D1B6C04940005386A /* Main.storyboard in Resources */, + 0DB648921B6C04940005386A /* LaunchScreen.xib in Resources */, + 0DB6488F1B6C04940005386A /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0DB648951B6C04940005386A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0DB6487C1B6C04940005386A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0DB648A91B6C04AF0005386A /* JSSAlertView.swift in Sources */, + 0DB6488A1B6C04940005386A /* DetailViewController.swift in Sources */, + 0DB648881B6C04940005386A /* MasterViewController.swift in Sources */, + 0DB648861B6C04940005386A /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0DB648931B6C04940005386A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0DB6489E1B6C04940005386A /* JSSAlertViewMasterDetailTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 0DB648991B6C04940005386A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0DB6487F1B6C04940005386A /* JSSAlertViewMasterDetail */; + targetProxy = 0DB648981B6C04940005386A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 0DB6488B1B6C04940005386A /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 0DB6488C1B6C04940005386A /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 0DB648901B6C04940005386A /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + 0DB648911B6C04940005386A /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 0DB6489F1B6C04940005386A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = 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_SYMBOLS_PRIVATE_EXTERN = NO; + 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 = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 0DB648A01B6C04940005386A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + 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 = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 0DB648A21B6C04940005386A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = JSSAlertViewMasterDetail/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 0DB648A31B6C04940005386A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = JSSAlertViewMasterDetail/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 0DB648A51B6C04940005386A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = JSSAlertViewMasterDetailTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JSSAlertViewMasterDetail.app/JSSAlertViewMasterDetail"; + }; + name = Debug; + }; + 0DB648A61B6C04940005386A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = JSSAlertViewMasterDetailTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JSSAlertViewMasterDetail.app/JSSAlertViewMasterDetail"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0DB6487B1B6C04940005386A /* Build configuration list for PBXProject "JSSAlertViewMasterDetail" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0DB6489F1B6C04940005386A /* Debug */, + 0DB648A01B6C04940005386A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0DB648A11B6C04940005386A /* Build configuration list for PBXNativeTarget "JSSAlertViewMasterDetail" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0DB648A21B6C04940005386A /* Debug */, + 0DB648A31B6C04940005386A /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + 0DB648A41B6C04940005386A /* Build configuration list for PBXNativeTarget "JSSAlertViewMasterDetailTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0DB648A51B6C04940005386A /* Debug */, + 0DB648A61B6C04940005386A /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0DB648781B6C04940005386A /* Project object */; +} diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..eb2dd83 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/AppDelegate.swift b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/AppDelegate.swift new file mode 100644 index 0000000..5632ebf --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/AppDelegate.swift @@ -0,0 +1,63 @@ +// +// AppDelegate.swift +// JSSAlertViewMasterDetail +// +// Created by Jay Stakelon on 7/31/15. +// Copyright (c) 2015 Jay Stakelon. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + let splitViewController = self.window!.rootViewController as! UISplitViewController + let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController + navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() + splitViewController.delegate = self + return true + } + + func applicationWillResignActive(application: UIApplication) { + // 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. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // 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. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + // MARK: - Split view + + func splitViewController(splitViewController: UISplitViewController, collapseSecondaryViewController secondaryViewController:UIViewController!, ontoPrimaryViewController primaryViewController:UIViewController!) -> Bool { + if let secondaryAsNavController = secondaryViewController as? UINavigationController { + if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { + if topAsDetailController.detailItem == nil { + // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. + return true + } + } + } + return false + } + +} + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/LaunchScreen.xib b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..bc627e7 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/Main.storyboard b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/Main.storyboard new file mode 100644 index 0000000..5e19351 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Base.lproj/Main.storyboard @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/DetailViewController.swift b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/DetailViewController.swift new file mode 100644 index 0000000..36667d6 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/DetailViewController.swift @@ -0,0 +1,112 @@ +// +// DetailViewController.swift +// JSSAlertViewMasterDetail +// +// Created by Jay Stakelon on 7/31/15. +// Copyright (c) 2015 Jay Stakelon. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + @IBOutlet weak var detailDescriptionLabel: UILabel! + + + var detailItem: AnyObject? { + didSet { + // Update the view. + self.configureView() + } + } + + func configureView() { + // Update the user interface for the detail item. + if let detail: AnyObject = self.detailItem { + if let label = self.detailDescriptionLabel { + label.text = detail.description + } + } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + self.configureView() + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + @IBAction func basicAlertButtonPress() { + JSSAlertView().show(self, title: "Boring and basic, but with a multi-line title") + } + + @IBAction func standardAlertButtonPress() { + JSSAlertView().show(self, title: "Standard alert", text: "A standard alert with some text looks like this", buttonText: "Yay") + } + + @IBAction func customColorAlertButtonPress() { + var alertview = JSSAlertView().show(self, title: "Custom color", text: "All of the cool kids have purple alerts these days", buttonText: "Whoa", color: UIColorFromHex(0x9b59b6, alpha: 1)) + alertview.setTextTheme(.Light) + } + + @IBAction func customIconAlertButtonPress() { + var customIcon = UIImage(named: "lightbulb") + var alertview = JSSAlertView().show(self, title: "Custom icon", text: "Supply a UIImage as the iconImage for sexy results", buttonText: "Yes", color: UIColorFromHex(0x9b59b6, alpha: 1), iconImage: customIcon) + alertview.setTextTheme(.Light) + } + + @IBAction func customFontsAlertButtonPress() { + var alertview = JSSAlertView().show(self, title: "Check it out", text: "This alert is using a custom font: Clear Sans to be specific") + alertview.setTitleFont("ClearSans-Light") + alertview.setTextFont("ClearSans") + alertview.setButtonFont("ClearSans-Bold") + } + + @IBAction func infoAlertButtonPress() { + JSSAlertView().info(self, title: "Heads up!", text: "This is the built-in .info style", buttonText: "Aight then") + } + + @IBAction func successAlertButtonPress() { + JSSAlertView().success(self, title: "Great success", text: "This is the built-in .success style") + } + + @IBAction func warningAlertButtonPress() { + JSSAlertView().warning(self, title: "Take warning", text: "This is the built-in .warning style") + } + + @IBAction func dangerAlertButtonPress() { + JSSAlertView().danger(self, title: "Oh, shit.", text: "This is the built-in .danger style") + } + + + @IBAction func twoButtonAlertPress() { + var alertview = JSSAlertView().show(self, title: "Standard alert", text: "A standard alert with some text looks like this", buttonText: "Yep", cancelButtonText: "Nope") + alertview.addAction(closeCallback) + alertview.addCancelAction(cancelCallback) + } + + @IBAction func kitchenSinkAlertViewButtonPress() { + var customIcon = UIImage(named: "lightbulb") + var alertview = JSSAlertView().show(self, title: "Kitchen sink", text: "Here's a modal alert with descriptive text, an icon, custom fonts and a custom color", buttonText: "Sweet", color: UIColorFromHex(0xE0107A, alpha: 1), iconImage: customIcon) + alertview.addAction(closeCallback) + alertview.setTitleFont("ClearSans-Bold") + alertview.setTextFont("ClearSans") + alertview.setButtonFont("ClearSans-Light") + alertview.setTextTheme(.Light) + } + + func closeCallback() { + println("Close callback called") + } + + func cancelCallback() { + println("Cancel callback called") + } + + +} + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Images.xcassets/AppIcon.appiconset/Contents.json b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Info.plist b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Info.plist new file mode 100644 index 0000000..efadafb --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/Info.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.stakelon.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/MasterViewController.swift b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/MasterViewController.swift new file mode 100644 index 0000000..4ef0b01 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetail/MasterViewController.swift @@ -0,0 +1,75 @@ +// +// MasterViewController.swift +// JSSAlertViewMasterDetail +// +// Created by Jay Stakelon on 7/31/15. +// Copyright (c) 2015 Jay Stakelon. All rights reserved. +// + +import UIKit + +class MasterViewController: UITableViewController { + + var detailViewController: DetailViewController? = nil + var objects = [AnyObject]() + + + override func awakeFromNib() { + super.awakeFromNib() + if UIDevice.currentDevice().userInterfaceIdiom == .Pad { + self.clearsSelectionOnViewWillAppear = false + self.preferredContentSize = CGSize(width: 320.0, height: 600.0) + } + } + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. +// self.navigationItem.leftBarButtonItem = self.editButtonItem() + +// let addButton = UIBarButtonItem(barButtonSystemItem: .Add, target: self, action: "insertNewObject:") +// self.navigationItem.rightBarButtonItem = addButton + if let split = self.splitViewController { + let controllers = split.viewControllers + self.detailViewController = controllers[controllers.count-1].topViewController as? DetailViewController + } + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } +// +// func insertNewObject(sender: AnyObject) { +// objects.insert(NSDate(), atIndex: 0) +// let indexPath = NSIndexPath(forRow: 0, inSection: 0) +// self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic) +// } + + // MARK: - Segues + + override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { + if segue.identifier == "showDetail" { + if let indexPath = self.tableView.indexPathForSelectedRow() { +// let object = objects[indexPath.row] as! NSDate + let controller = (segue.destinationViewController as! UINavigationController).topViewController as! DetailViewController +// controller.detailItem = object + controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem() + controller.navigationItem.leftItemsSupplementBackButton = true + } + } + } + + // MARK: - Table View + + override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { + if indexPath.row == 1 { + JSSAlertView().show(self, title: "Standard alert", text: "A standard alert with some text looks like this", buttonText: "Yay") + tableView.deselectRowAtIndexPath(indexPath, animated: true) + } + } + + + +} + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/Info.plist b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/Info.plist new file mode 100644 index 0000000..cab27e1 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.stakelon.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/JSSAlertViewMasterDetailTests.swift b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/JSSAlertViewMasterDetailTests.swift new file mode 100644 index 0000000..c30cde9 --- /dev/null +++ b/JSSAlertViewMasterDetail/JSSAlertViewMasterDetailTests/JSSAlertViewMasterDetailTests.swift @@ -0,0 +1,36 @@ +// +// JSSAlertViewMasterDetailTests.swift +// JSSAlertViewMasterDetailTests +// +// Created by Jay Stakelon on 7/31/15. +// Copyright (c) 2015 Jay Stakelon. All rights reserved. +// + +import UIKit +import XCTest + +class JSSAlertViewMasterDetailTests: 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. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +}