Skip to content

Commit

Permalink
alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
alauria33 authored and alauria33 committed Apr 21, 2016
1 parent 5c04596 commit 6f7c48e
Show file tree
Hide file tree
Showing 16 changed files with 414 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GrouPics/PictureViewController.swift"
timestampString = "482314168.502589"
timestampString = "482949720.544825"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "127"
endingLineNumber = "127"
startingLineNumber = "125"
endingLineNumber = "125"
landmarkName = "screenButtonAction(_:)"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -72,11 +72,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GrouPics/PictureViewController.swift"
timestampString = "482314168.502589"
timestampString = "482949720.544825"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "128"
endingLineNumber = "128"
startingLineNumber = "126"
endingLineNumber = "126"
landmarkName = "screenButtonAction(_:)"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -88,11 +88,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "GrouPics/EventsViewController.swift"
timestampString = "482829245.864122"
timestampString = "482950215.280129"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "127"
endingLineNumber = "127"
startingLineNumber = "190"
endingLineNumber = "190"
landmarkName = "eventAction(_:)"
landmarkType = "5">
</BreakpointContent>
Expand Down
9 changes: 0 additions & 9 deletions GrouPics/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ var eventName : String = String()
var eventsNavLocal : Int = 0
var onOpen : Bool = true

extension UIImage
{
var highestQualityJPEGNSData: NSData { return UIImageJPEGRepresentation(self, 1.0)! }
var highQualityJPEGNSData: NSData { return UIImageJPEGRepresentation(self, 0.75)!}
var mediumQualityJPEGNSData: NSData { return UIImageJPEGRepresentation(self, 0.5)! }
var lowQualityJPEGNSData: NSData { return UIImageJPEGRepresentation(self, 0.25)!}
var lowestQualityJPEGNSData: NSData { return UIImageJPEGRepresentation(self, 0.0)! }
}

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

Expand Down
8 changes: 4 additions & 4 deletions GrouPics/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="VIEW YOUR EVENTS" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IB1-zk-41j">
<rect key="frame" x="0.0" y="64" width="495" height="58"/>
<fontDescription key="fontDescription" name="Menlo-Bold" family="Menlo" pointSize="30"/>
<color key="textColor" red="0.19703201504387557" green="0.11890630860214825" blue="0.36003605769230773" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="0.36003605769230773" green="0.05366131407041113" blue="0.060548138944617497" alpha="1" colorSpace="calibratedRGB"/>
<color key="highlightedColor" red="1" green="0.21743424689999999" blue="0.78518389509999997" alpha="1" colorSpace="calibratedRGB"/>
</label>
</subviews>
<color key="backgroundColor" red="0.93991464872103192" green="0.952038517074002" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="1" green="0.93067869489252453" blue="0.88952496641672041" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="IB1-zk-41j" firstAttribute="centerX" secondItem="cZ7-80-Fk9" secondAttribute="centerX" id="QmS-T0-rmJ"/>
</constraints>
Expand All @@ -49,7 +49,7 @@
<view key="view" contentMode="scaleToFill" id="T6E-Td-91k">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.17642227564102564" green="0.17642227564102564" blue="0.17642227564102564" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.27844551282051277" green="0.27844551282051277" blue="0.27844551282051277" alpha="1" colorSpace="calibratedRGB"/>
<color key="tintColor" red="0.2784313725" green="0.59999999999999998" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</view>
<connections>
Expand Down Expand Up @@ -368,7 +368,7 @@
<tabBarItem key="tabBarItem" tag="1" title="Events" image="balloons" id="mRj-ZQ-1cw">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="tintColor">
<color key="value" red="0.61223846673965454" green="0.0094648879021406174" blue="0.99587470293045044" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="value" red="0.89148637820512822" green="0.16280583636278276" blue="0.11468395070905037" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</tabBarItem>
Expand Down
2 changes: 1 addition & 1 deletion GrouPics/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import UIKit

class Button : UIButton {
var buttonIdentifier: String = ""
var string: String = ""
}
19 changes: 6 additions & 13 deletions GrouPics/Create3ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,24 @@ class Create3ViewController: UIViewController, CLLocationManagerDelegate {
let tv = UITextView()
tv.frame = CGRectMake(0, 0, screenSize.width*0.85, screenSize.height * 0.15)
tv.frame.origin.x = (screenSize.width - tv.frame.size.width)/2
tv.frame.origin.y = (screenSize.height - tv.frame.size.height)*0.36
tv.frame.origin.y = (screenSize.height - tv.frame.size.height)*0.37
tv.backgroundColor = UIColor.clearColor()
let sampleText = "Using your current location..."
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = NSTextAlignment.Justified
let attributedString = NSAttributedString(string: sampleText,
attributes: [
NSParagraphStyleAttributeName: paragraphStyle,
NSBaselineOffsetAttributeName: NSNumber(float: 0)
])
tv.attributedText = attributedString
tv.text = "Using your current location..."
tv.textAlignment = .Center
tv.font = UIFont(name: "Arial", size: 15*screenSize.width/375)
tv.userInteractionEnabled = false
self.view.addSubview(tv)

let changeLoc = UIButton(type: UIButtonType.System) as UIButton
changeLoc.titleLabel!.font = UIFont(name: "Arial", size: 14*screenSize.width/320)
changeLoc.frame = CGRectMake(0, 0, screenSize.width * 0.45, screenSize.height * 0.1)
changeLoc.frame.origin.x = (screenSize.width - changeLoc.frame.size.width)*0.88
changeLoc.frame.origin.y = tv.frame.origin.y - screenSize.height/40//(screenSize.height - selPhoto.frame.size.height)*0.32
changeLoc.frame.origin.x = (screenSize.width - changeLoc.frame.size.width)*0.5
changeLoc.frame.origin.y = tv.frame.origin.y - screenSize.height/15
changeLoc.setTitle("change", forState: UIControlState.Normal)
let darkColor = UIColor(red: 46/255, green: 106/255, blue: 202/255, alpha: 1.0)
changeLoc.setTitleColor(darkColor, forState: UIControlState.Normal)
changeLoc.addTarget(self, action: "changeLocation:", forControlEvents:UIControlEvents.TouchUpInside)
self.view.addSubview(changeLoc)
//self.view.addSubview(changeLoc)

let circle : UIImage? = UIImage(named:"circle")
let next = UIButton(type: UIButtonType.System) as UIButton
Expand Down
13 changes: 9 additions & 4 deletions GrouPics/Create5ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Firebase
import GeoFire
import CoreLocation

var lastHostedEvent: String = String()

class Create5ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

var img : UIImageView = UIImageView()
Expand All @@ -36,7 +38,7 @@ class Create5ViewController: UIViewController, UIImagePickerControllerDelegate,
create.frame = CGRectMake(0, 0, screenSize.width * 0.5, screenSize.height * 0.14)
create.frame.origin.x = (screenSize.width - create.frame.size.width)/2
create.frame.origin.y = (screenSize.height - create.frame.size.height)*0.84
create.setTitle("Create Event!!", forState: UIControlState.Normal)
create.setTitle("Create Event!", forState: UIControlState.Normal)
let blueColor = UIColor(red: 136/255, green: 175/255, blue: 239/255, alpha: 1.0)
let lightBlueColor = UIColor(red: 50/255, green: 70/255, blue: 147/255, alpha: 1.0)
create.setTitleColor(lightBlueColor, forState: UIControlState.Normal)
Expand All @@ -51,8 +53,9 @@ class Create5ViewController: UIViewController, UIImagePickerControllerDelegate,
self.view.addSubview(buttonImg)

self.view.addSubview(create)

img = UIImageView()
img.frame = CGRectMake(0, 0, screenSize.width * 0.42, screenSize.height * 0.318)
img.frame = CGRectMake(0, 0, screenSize.width * 0.35, screenSize.height * 0.32)
img.frame.origin.x = (screenSize.width - img.frame.size.width)*0.8
img.frame.origin.y = (screenSize.height - img.frame.size.height)*0.5
//let grayColor = UIColor(red: 137/255, green: 140/255, blue: 145/255, alpha: 1.0)
Expand All @@ -77,6 +80,8 @@ class Create5ViewController: UIViewController, UIImagePickerControllerDelegate,
tempRef.setValue(nameInput)
tempRef = eventRef.childByAppendingPath("description/")
tempRef.setValue(descriptionInput)
tempRef = eventRef.childByAppendingPath("end time/")
tempRef.setValue(dateInput)
tempRef = eventRef.childByAppendingPath("password/")
tempRef.setValue(passwordInput)
tempRef = eventRef.childByAppendingPath("picture count/")
Expand All @@ -86,8 +91,7 @@ class Create5ViewController: UIViewController, UIImagePickerControllerDelegate,
tempRef = eventRef.childByAppendingPath("host/")
tempRef.setValue(userID)
if img.image != nil {
//let imgData: NSData = UIImageJPEGRepresentation(img.image!, 1.0)!
let imgData: NSData = img.image!.lowestQualityJPEGNSData
let imgData = UIImageJPEGRepresentation(img.image!, 0.0)!
let pictureInput = imgData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
tempRef = eventRef.childByAppendingPath("cover photo/")
tempRef.setValue(pictureInput)
Expand All @@ -98,6 +102,7 @@ class Create5ViewController: UIViewController, UIImagePickerControllerDelegate,
}
let usersRef = dataBase.childByAppendingPath("users/" + userID + "/hosted events/" + nameReference)
usersRef.setValue(nameReference)
lastHostedEvent = nameReference
eventName = nameInput
temp = 1
tabBarController!.selectedIndex = 2
Expand Down
62 changes: 51 additions & 11 deletions GrouPics/CreateViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,79 @@ class CreateViewController: UIViewController {
let borderColor = UIColor(red: 204.0/255.0, green:204.0/255.0, blue:204.0/255.0, alpha:1.0)

name = UITextView()
name.frame = CGRectMake(0, 0, screenSize.width * 0.7, screenSize.height * 0.05)
name.frame = CGRectMake(0, 0, screenSize.width * 0.7, screenSize.height * 0.06)
name.frame.origin.x = (screenSize.width - name.frame.size.width)/2
name.frame.origin.y = (screenSize.height - name.frame.size.height)*0.28
name.frame.origin.y = (screenSize.height - name.frame.size.height)*0.31
name.layer.borderColor = borderColor.CGColor;
name.layer.borderWidth = 0.8;
name.layer.cornerRadius = 5.0;
self.view.addSubview(name)

// let nameLabel = UILabel()
// nameLabel.text = "name"
// nameLabel.textAlignment = .Center
// nameLabel.font = UIFont(name: "Menlo", size: 14*screenSize.width/320)
// nameLabel.frame = CGRectMake(0, 0, screenSize.width*0.2, screenSize.height * 0.15)
// nameLabel.frame.origin.x = (screenSize.width - nameLabel.frame.size.width)/2
// nameLabel.frame.origin.y = name.frame.origin.y - screenSize.height/10
// self.view.addSubview(nameLabel)

let nameLabelBackground = UILabel()
nameLabelBackground.backgroundColor = darkBlueColor
nameLabelBackground.frame = CGRectMake(0, 0, name.frame.size.width, screenSize.height * 0.03)
nameLabelBackground.frame.origin.x = (screenSize.width - nameLabelBackground.frame.size.width)/2
nameLabelBackground.frame.origin.y = name.frame.origin.y - nameLabelBackground.frame.size.height
self.view.addSubview(nameLabelBackground)

let nameLabel = UILabel()
nameLabel.text = "name"
nameLabel.backgroundColor = darkBlueColor
nameLabel.textColor = UIColor.whiteColor()
nameLabel.textAlignment = .Center
nameLabel.font = UIFont(name: "Menlo-Bold", size: 14*screenSize.width/320)
nameLabel.frame = CGRectMake(0, 0, screenSize.width*0.2, screenSize.height * 0.15)
nameLabel.font = UIFont(name: "Menlo", size: 16*screenSize.width/320)
nameLabel.frame = CGRectMake(0, 0, name.frame.size.width, screenSize.height * 0.05)
nameLabel.frame.origin.x = (screenSize.width - nameLabel.frame.size.width)/2
nameLabel.frame.origin.y = name.frame.origin.y - screenSize.height/10
nameLabel.frame.origin.y = name.frame.origin.y - nameLabel.frame.size.height
nameLabel.clipsToBounds = true
nameLabel.layer.cornerRadius = 10
self.view.addSubview(nameLabel)

descrip = UITextView()
descrip.frame = CGRectMake(0, 0, screenSize.width * 0.7, screenSize.height * 0.3)
descrip.frame = CGRectMake(0, 0, screenSize.width * 0.7, screenSize.height * 0.24)
descrip.frame.origin.x = (screenSize.width - descrip.frame.size.width)/2
descrip.frame.origin.y = (screenSize.height - descrip.frame.size.height)*0.55
descrip.frame.origin.y = (screenSize.height - descrip.frame.size.height)*0.59
descrip.layer.borderColor = borderColor.CGColor;
descrip.layer.borderWidth = 0.8;
descrip.layer.cornerRadius = 5.0;
self.view.addSubview(descrip)

// let descripLabel = UILabel()
// descripLabel.text = "description"
// descripLabel.textAlignment = .Center
// descripLabel.font = UIFont(name: "Menlo", size: 14*screenSize.width/320)
// descripLabel.frame = CGRectMake(0, 0, screenSize.width*0.4, screenSize.height * 0.15)
// descripLabel.frame.origin.x = (screenSize.width - descripLabel.frame.size.width)/2
// descripLabel.frame.origin.y = descrip.frame.origin.y - screenSize.height/10
// self.view.addSubview(descripLabel)

let descripLabelBackground = UILabel()
descripLabelBackground.backgroundColor = darkBlueColor
descripLabelBackground.frame = CGRectMake(0, 0, descrip.frame.size.width, screenSize.height * 0.03)
descripLabelBackground.frame.origin.x = (screenSize.width - descripLabelBackground.frame.size.width)/2
descripLabelBackground.frame.origin.y = descrip.frame.origin.y - descripLabelBackground.frame.size.height
self.view.addSubview(descripLabelBackground)

let descripLabel = UILabel()
descripLabel.text = "description"
descripLabel.backgroundColor = darkBlueColor
descripLabel.textColor = UIColor.whiteColor()
descripLabel.textAlignment = .Center
descripLabel.font = UIFont(name: "Menlo-Bold", size: 14*screenSize.width/320)
descripLabel.frame = CGRectMake(0, 0, screenSize.width*0.4, screenSize.height * 0.15)
descripLabel.frame.origin.x = (screenSize.width - descripLabel.frame.size.width)/2
descripLabel.frame.origin.y = descrip.frame.origin.y - screenSize.height/10
descripLabel.font = UIFont(name: "Menlo", size: 16*screenSize.width/320)
descripLabel.frame = CGRectMake(0, 0, descrip.frame.size.width, screenSize.height * 0.05)
descripLabel.frame.origin.x = (screenSize.width - descripLabel.frame.size.width)/2
descripLabel.frame.origin.y = descrip.frame.origin.y - descripLabel.frame.size.height
descripLabel.clipsToBounds = true
descripLabel.layer.cornerRadius = 10
self.view.addSubview(descripLabel)

let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
Expand Down
Loading

0 comments on commit 6f7c48e

Please sign in to comment.