Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
994f102
Created model for our words
Aug 26, 2020
94215fe
The storyboard outline is done. Implemented the buttons, text fields,…
trc96 Aug 26, 2020
6275cfc
Merge pull request #2 from ianbecker4/Storyboard
trc96 Aug 26, 2020
1a93cc7
Merge pull request #1 from ianbecker4/Model
ianbecker4 Aug 26, 2020
c1a9ad1
Fixed minor isses on Storyboard
trc96 Aug 26, 2020
6b188b3
Merge pull request #3 from ianbecker4/Storyboard
trc96 Aug 26, 2020
ef9e387
Model controller done
Aug 26, 2020
2253f92
Merge pull request #4 from ianbecker4/ModelController
ianbecker4 Aug 26, 2020
a115b32
Finished the Style Guide and added a Colors.xassets folder for the cu…
trc96 Aug 26, 2020
c06ec1a
Merge pull request #6 from ianbecker4/Storyboard
trc96 Aug 26, 2020
5386fc8
Created ViewControllers, added outlets.
coltonswapp Aug 26, 2020
3fbb718
Merge pull request #7 from ianbecker4/ViewControllers
coltonswapp Aug 26, 2020
046d924
Dragged out a forgotten outlet for the final 'done' button
coltonswapp Aug 26, 2020
ff5fd73
Merge pull request #8 from ianbecker4/WordGuessViewController
coltonswapp Aug 26, 2020
a11afc5
Did a whole bunch of shiii
coltonswapp Aug 26, 2020
0848663
Merge pull request #9 from ianbecker4/WordGuessViewController
coltonswapp Aug 26, 2020
b9b29f3
setup initial view controller
Lythronax284 Aug 26, 2020
b47e9ce
Merge pull request #10 from ianbecker4/initialViewController
Lythronax284 Aug 26, 2020
417000b
This bitch works
Aug 27, 2020
bc6936e
Merge pull request #11 from ianbecker4/Ian
ianbecker4 Aug 27, 2020
5e09255
Added background color and printed count of words
Aug 27, 2020
0083b20
Merge pull request #12 from ianbecker4/Ian
ianbecker4 Aug 27, 2020
3e58b06
I don't know all that I did, but it was a lot.
trc96 Aug 27, 2020
e32edc0
Merge pull request #14 from ianbecker4/Storyboard
trc96 Aug 27, 2020
d0c39c0
Adjusted View Controller to fit keyboard, added 'LIM' image for style…
trc96 Aug 27, 2020
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
56 changes: 56 additions & 0 deletions WordMatchGame/WordMatchGame.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
4B14265B24F6D4A500F6971D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B14265924F6D4A500F6971D /* Main.storyboard */; };
4B14265D24F6D4A500F6971D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B14265C24F6D4A500F6971D /* Assets.xcassets */; };
4B14266024F6D4A500F6971D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4B14265E24F6D4A500F6971D /* LaunchScreen.storyboard */; };
7525E4E824F70387008E9897 /* InitialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7525E4E724F70387008E9897 /* InitialViewController.swift */; };
7525E4EA24F70404008E9897 /* WordGuessViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7525E4E924F70404008E9897 /* WordGuessViewController.swift */; };
9F4D030024F80F7A0088023E /* wordMatchLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D02FF24F80F7A0088023E /* wordMatchLabel.swift */; };
9F4D030224F810500088023E /* wordMatchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D030124F810500088023E /* wordMatchTextField.swift */; };
9F4D030424F844370088023E /* wordMatchButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D030324F844370088023E /* wordMatchButton.swift */; };
9F4D030624F852600088023E /* generateWordButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D030524F852600088023E /* generateWordButton.swift */; };
9F4D030824F8672C0088023E /* instructionLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D030724F8672C0088023E /* instructionLabel.swift */; };
9F4D030A24F86A650088023E /* keyboardLayoutConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4D030924F86A650088023E /* keyboardLayoutConstraints.swift */; };
9F631C2E24F6FD27006CFDE5 /* StyleGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F631C2D24F6FD27006CFDE5 /* StyleGuide.swift */; };
9F631C3024F6FD41006CFDE5 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9F631C2F24F6FD41006CFDE5 /* Colors.xcassets */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -22,6 +32,16 @@
4B14265C24F6D4A500F6971D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4B14265F24F6D4A500F6971D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4B14266124F6D4A500F6971D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7525E4E724F70387008E9897 /* InitialViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitialViewController.swift; sourceTree = "<group>"; };
7525E4E924F70404008E9897 /* WordGuessViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordGuessViewController.swift; sourceTree = "<group>"; };
9F4D02FF24F80F7A0088023E /* wordMatchLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = wordMatchLabel.swift; sourceTree = "<group>"; };
9F4D030124F810500088023E /* wordMatchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = wordMatchTextField.swift; sourceTree = "<group>"; };
9F4D030324F844370088023E /* wordMatchButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = wordMatchButton.swift; sourceTree = "<group>"; };
9F4D030524F852600088023E /* generateWordButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = generateWordButton.swift; sourceTree = "<group>"; };
9F4D030724F8672C0088023E /* instructionLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = instructionLabel.swift; sourceTree = "<group>"; };
9F4D030924F86A650088023E /* keyboardLayoutConstraints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = keyboardLayoutConstraints.swift; sourceTree = "<group>"; };
9F631C2D24F6FD27006CFDE5 /* StyleGuide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StyleGuide.swift; sourceTree = "<group>"; };
9F631C2F24F6FD41006CFDE5 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -54,6 +74,7 @@
4B14265224F6D4A500F6971D /* WordMatchGame */ = {
isa = PBXGroup;
children = (
9F631C2C24F6FD0C006CFDE5 /* CustomUI */,
4B14266824F6D59B00F6971D /* Views */,
4B14266724F6D57A00F6971D /* Resources */,
);
Expand All @@ -66,6 +87,7 @@
4B14265324F6D4A500F6971D /* AppDelegate.swift */,
4B14265524F6D4A500F6971D /* SceneDelegate.swift */,
4B14265C24F6D4A500F6971D /* Assets.xcassets */,
9F631C2F24F6FD41006CFDE5 /* Colors.xcassets */,
4B14265E24F6D4A500F6971D /* LaunchScreen.storyboard */,
4B14266124F6D4A500F6971D /* Info.plist */,
);
Expand All @@ -75,11 +97,35 @@
4B14266824F6D59B00F6971D /* Views */ = {
isa = PBXGroup;
children = (
7525E4E624F7036B008E9897 /* ViewControllers */,
4B14265924F6D4A500F6971D /* Main.storyboard */,
);
path = Views;
sourceTree = "<group>";
};
7525E4E624F7036B008E9897 /* ViewControllers */ = {
isa = PBXGroup;
children = (
7525E4E724F70387008E9897 /* InitialViewController.swift */,
7525E4E924F70404008E9897 /* WordGuessViewController.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
9F631C2C24F6FD0C006CFDE5 /* CustomUI */ = {
isa = PBXGroup;
children = (
9F631C2D24F6FD27006CFDE5 /* StyleGuide.swift */,
9F4D02FF24F80F7A0088023E /* wordMatchLabel.swift */,
9F4D030124F810500088023E /* wordMatchTextField.swift */,
9F4D030324F844370088023E /* wordMatchButton.swift */,
9F4D030524F852600088023E /* generateWordButton.swift */,
9F4D030724F8672C0088023E /* instructionLabel.swift */,
9F4D030924F86A650088023E /* keyboardLayoutConstraints.swift */,
);
path = CustomUI;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -139,6 +185,7 @@
buildActionMask = 2147483647;
files = (
4B14266024F6D4A500F6971D /* LaunchScreen.storyboard in Resources */,
9F631C3024F6FD41006CFDE5 /* Colors.xcassets in Resources */,
4B14265D24F6D4A500F6971D /* Assets.xcassets in Resources */,
4B14265B24F6D4A500F6971D /* Main.storyboard in Resources */,
);
Expand All @@ -153,6 +200,15 @@
files = (
4B14265424F6D4A500F6971D /* AppDelegate.swift in Sources */,
4B14265624F6D4A500F6971D /* SceneDelegate.swift in Sources */,
9F4D030A24F86A650088023E /* keyboardLayoutConstraints.swift in Sources */,
9F4D030224F810500088023E /* wordMatchTextField.swift in Sources */,
7525E4E824F70387008E9897 /* InitialViewController.swift in Sources */,
9F4D030024F80F7A0088023E /* wordMatchLabel.swift in Sources */,
9F4D030824F8672C0088023E /* instructionLabel.swift in Sources */,
9F4D030424F844370088023E /* wordMatchButton.swift in Sources */,
9F4D030624F852600088023E /* generateWordButton.swift in Sources */,
9F631C2E24F6FD27006CFDE5 /* StyleGuide.swift in Sources */,
7525E4EA24F70404008E9897 /* WordGuessViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
29 changes: 29 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/StyleGuide.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// StyleGuide.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/26/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

extension UIView {

func addCornerRadius(_ radius: CGFloat = 4) {
self.layer.cornerRadius = radius
}
}//End of Extension

struct FontNames {

static let helveticaBold = "Helvetica-Bold"
}//End of Struct

extension UIColor {

static let customDarkPurple = UIColor(named: "customDarkPurple")!
static let customGreen = UIColor(named: "customGreen")
static let customPink = UIColor(named: "customPink")
static let customPurple = UIColor(named: "customPurple")
}//End of Extension
30 changes: 30 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/generateWordButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// generateWordButton.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

class generateWordButton: UIButton {

override func awakeFromNib() {
super.awakeFromNib()

setUpViews()
}

func setUpViews() {
self.backgroundColor = .customGreen
self.setTitleColor(.white, for: .normal)
updateFontTo(font: FontNames.helveticaBold)
addCornerRadius()
}

func updateFontTo(font: String) {
guard let size = self.titleLabel?.font.pointSize else { return }
self.titleLabel?.font = UIFont(name: font, size: size)
}
}//End of Class
9 changes: 9 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/instructionLabel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// instructionLabel.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import Foundation
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// keyboardLayoutConstraints.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

class KeyboardLayoutConstraint: NSLayoutConstraint {

var offset : CGFloat = 0
var keyboardVisibleHeight : CGFloat = 0

override func awakeFromNib() {
super.awakeFromNib()

offset = constant

NotificationCenter.default.addObserver(self, selector: #selector(KeyboardLayoutConstraint.keyboardWillShowNotification(_:)), name: UIWindow.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(KeyboardLayoutConstraint.keyboardWillHideNotification(_:)), name: UIWindow.keyboardWillHideNotification, object: nil)
}

deinit {
NotificationCenter.default.removeObserver(self)
}

// MARK: Notification

@objc func keyboardWillShowNotification(_ notification: Notification) {
if let userInfo = notification.userInfo {
if let frameValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
let frame = frameValue.cgRectValue
keyboardVisibleHeight = frame.size.height
}

self.updateConstant()
switch (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber, userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber) {
case let (.some(duration), .some(curve)):

let options = UIView.AnimationOptions(rawValue: curve.uintValue)

UIView.animate(
withDuration: TimeInterval(duration.doubleValue),
delay: 0,
options: options,
animations: {
UIApplication.shared.keyWindow?.layoutIfNeeded()
return
}, completion: { finished in
})
default:

break
}

}

}

@objc func keyboardWillHideNotification(_ notification: NSNotification) {
keyboardVisibleHeight = 0
self.updateConstant()

if let userInfo = notification.userInfo {

switch (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber, userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber) {
case let (.some(duration), .some(curve)):

let options = UIView.AnimationOptions(rawValue: curve.uintValue)

UIView.animate(
withDuration: TimeInterval(duration.doubleValue),
delay: 0,
options: options,
animations: {
UIApplication.shared.keyWindow?.layoutIfNeeded()
return
}, completion: { finished in
})
default:
break
}
}
}

func updateConstant() {
self.constant = offset + keyboardVisibleHeight
}

}
30 changes: 30 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/wordMatchButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// wordMatchButton.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

class wordMatchButton: UIButton {

override func awakeFromNib() {
super.awakeFromNib()

setUpViews()
}

func setUpViews() {
self.backgroundColor = .customDarkPurple
self.setTitleColor(.white, for: .normal)
updateFontTo(font: FontNames.helveticaBold)
addCornerRadius()
}

func updateFontTo(font: String) {
guard let size = self.titleLabel?.font.pointSize else { return }
self.titleLabel?.font = UIFont(name: font, size: size)
}
}//End of Class
24 changes: 24 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/wordMatchLabel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// wordMatchLabel.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

class wordMatchLabel: UILabel {

override func awakeFromNib() {
super.awakeFromNib()

setUpViews()
}

func setUpViews() {
self.backgroundColor = .customDarkPurple
self.textColor = .white
self.addCornerRadius()
}
}//End of Class
41 changes: 41 additions & 0 deletions WordMatchGame/WordMatchGame/CustomUI/wordMatchTextField.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// wordMatchTextField.swift
// WordMatchGame
//
// Created by Todd Crandall on 8/27/20.
// Copyright © 2020 Ian Becker. All rights reserved.
//

import UIKit

class wordMatchTextField: UITextField {

override func awakeFromNib() {
super.awakeFromNib()

setUpUI()
}

func updateFontTo(fontName: String) {
guard let size = self.font?.pointSize else { return }
self.font = UIFont(name: fontName, size: size)
}

func updatePlaceHolder() {

let currentPlaceHolderText = self.placeholder
self.attributedPlaceholder = NSAttributedString(string: currentPlaceHolderText ?? "", attributes: [
NSAttributedString.Key.foregroundColor : UIColor.white,
NSAttributedString.Key.font : UIFont(name: FontNames.helveticaBold, size: 0)!
])
}

func setUpUI() {
self.backgroundColor = .customPink
self.addCornerRadius()
self.layer.masksToBounds = true
self.textColor = .white
self.updateFontTo(fontName: FontNames.helveticaBold)
self.updatePlaceHolder()
}
}//End of Class
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,21 @@
{
"images" : [
{
"filename" : "Asset_3THELASTONE.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading