Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 255 additions & 2 deletions NoughtsAndCrosses/NoughtsAndCrosses.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42D447C91CD765670070326E"
BuildableName = "NoughtsAndCrosses.app"
BlueprintName = "NoughtsAndCrosses"
ReferencedContainer = "container:NoughtsAndCrosses.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 = "42D447DD1CD765680070326E"
BuildableName = "NoughtsAndCrossesTests.xctest"
BlueprintName = "NoughtsAndCrossesTests"
ReferencedContainer = "container:NoughtsAndCrosses.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42D447E81CD765680070326E"
BuildableName = "NoughtsAndCrossesUITests.xctest"
BlueprintName = "NoughtsAndCrossesUITests"
ReferencedContainer = "container:NoughtsAndCrosses.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42D447C91CD765670070326E"
BuildableName = "NoughtsAndCrosses.app"
BlueprintName = "NoughtsAndCrosses"
ReferencedContainer = "container:NoughtsAndCrosses.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 = "42D447C91CD765670070326E"
BuildableName = "NoughtsAndCrosses.app"
BlueprintName = "NoughtsAndCrosses"
ReferencedContainer = "container:NoughtsAndCrosses.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "42D447C91CD765670070326E"
BuildableName = "NoughtsAndCrosses.app"
BlueprintName = "NoughtsAndCrosses"
ReferencedContainer = "container:NoughtsAndCrosses.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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>NoughtsAndCrosses.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>42D447C91CD765670070326E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>42D447DD1CD765680070326E</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>42D447E81CD765680070326E</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
</Bucket>
110 changes: 104 additions & 6 deletions NoughtsAndCrosses/NoughtsAndCrosses/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,121 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var navigationController: UINavigationController?

var boardNavigationController: UINavigationController?

var authorisationNavigationController: UINavigationController?


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//var easterEggNavigationController: UINavigationController?




func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{

// Override point for customization after application launch.

let boardViewController = BoardViewController(nibName:"BoardViewController",bundle:nil)
self.navigationController = UINavigationController(rootViewController: boardViewController)
self.navigationController?.navigationBarHidden = true
print("hey")

// landing view

let landingViewController = LandingViewController(nibName: "LandingViewController", bundle: nil)
authorisationNavigationController = UINavigationController(rootViewController: landingViewController)


self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window?.rootViewController = self.navigationController
// changing so that we dont hav to log in everytime

self.window?.rootViewController = self.authorisationNavigationController
//navigateToBoardNavigationController()

self.window?.makeKeyAndVisible()


EasterEggController.sharedInstance.initiate(self.window!)


//persistence

//let userIsLoggedIn = NSUserDefaults.standardUserDefaults().objectForKey("userIsLoggedIn")
var userIsLoggedIn: String?

if let _ = userIsLoggedIn
{
navigateToBoardNavigationController()
}
else
{
self.window?.rootViewController = self.authorisationNavigationController
}


return true
}


// navigation functions to assorted pages

func navigateToBoardNavigationController()
{

// board view

let boardViewController = BoardViewController(nibName:"BoardViewController",bundle:nil)
boardNavigationController = UINavigationController(rootViewController: boardViewController)

self.boardNavigationController?.navigationBarHidden = true


self.window?.rootViewController = self.boardNavigationController

}

func navigateToLoggedOutNavigationController()
{

let loggedOutViewController = LandingViewController(nibName: "LandingViewController", bundle: nil)
authorisationNavigationController = UINavigationController(rootViewController: loggedOutViewController)

self.window?.rootViewController = self.authorisationNavigationController

}

func navigateToEasterEggScreen()
{

let easterEggViewController = EasterEggViewController(nibName: "EasterEggViewController", bundle: nil)
//easterEggNavigationController = UINavigationController(rootViewController: easterEggViewController)

self.window?.rootViewController = easterEggViewController

//self.easterEggNavigationController

}


func navigateEasterEggToOX()
{

if (UserController.sharedInstance.logged_in_user == nil)
{
let backToGameController = LandingViewController(nibName: "LandingViewController", bundle: nil)
authorisationNavigationController = UINavigationController(rootViewController: backToGameController)
self.window?.rootViewController = self.authorisationNavigationController
}
else
{
let backToGameController = BoardViewController(nibName: "BoardViewController", bundle: nil)
boardNavigationController = UINavigationController(rootViewController: backToGameController)
self.boardNavigationController?.navigationBarHidden = true
self.window?.rootViewController = self.boardNavigationController
}

}



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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Image.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Image@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "Image@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "input_valid.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "input_valid@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "input_valid@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading