Skip to content

Commit

Permalink
1. Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Syerram committed Jan 12, 2015
0 parents commit a83d057
Show file tree
Hide file tree
Showing 61 changed files with 6,113 additions and 0 deletions.
105 changes: 105 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
################################# IOS #######################################
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/

############################ Andriod ########################################
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log


########################### GO #############################################
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so

# Folders
_obj
_test

# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out

*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*

_testmain.go

*.exe
*.test
*.prof

############################# Python ###################################

# Ingnore eclipse files
.settings
*.tar.gz
.DS_Store

# ignore python files
*.pyc
*.egg
*egg*

src/log-ci.log
.coverage
landing_zone.egg-info/

build/
dist/

reports/


4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Asphalos

`Asphalos`: Greek for secured

768 changes: 768 additions & 0 deletions asphalos.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

22 changes: 22 additions & 0 deletions asphalos/Account.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// Account.swift
// asphalos
//
// Created by Saikiran Yerram on 12/30/14.
// Copyright (c) 2014 Blackhorn. All rights reserved.
//

import Foundation
import CoreData

class Account: NSManagedObject {

@NSManaged var name: String
@NSManaged var password: String
@NSManaged var userName: String
@NSManaged var website: String
@NSManaged var info: String
@NSManaged var category: Category


}
116 changes: 116 additions & 0 deletions asphalos/AccountController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
//
// PasswordViewController.swift
// asphalos
//
// Created by Saikiran Yerram on 12/28/14.
// Copyright (c) 2014 Blackhorn. All rights reserved.
//

import UIKit

class AccountController: FormViewController, FormViewControllerDelegate, AccountDelegate {

var account:Account?
var accountDelegate:AccountDelegate?

var notifyFrame:CGRect?
var notifyView:SFSwiftNotification?

required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.loadForm()
}

override func viewDidLoad() {
//ui
self.addNavigationBarTitle("\(account!.name)")
self.addRightButton("edit", title: "Edit", callback: nil)
self.tableView.hideFooter()
self.delegate = self

notifyFrame = CGRectMake(0, 0,
CGRectGetMaxX(self.view.frame), 50)
notifyView = SFSwiftNotification.NewNotification(notifyFrame!, delegate: nil)
self.view.addSubview(notifyView!)
//data
self.updateTableView()
}

func updateTableView() {
self.setValue(self.account!.name, forTag: Fields.Name)
self.setValue(self.account!.userName, forTag: Fields.UserName)
self.setValue(self.account!.password, forTag: Fields.Password)
self.setValue(self.account!.category.name, forTag: Fields.Category)
self.setValue(self.account!.website, forTag: Fields.Website)
self.setValue(self.account!.info, forTag: Fields.AdditionalInfo)
}

func edit() {
self.pushControllerOnNavigationStack("AccountEditController", callback: { (controller:AccountEditController) -> () in
controller.account = self.account!
controller.category = self.account!.category
controller.accountDelegate = self
})
}

func accountUpdated(account: Account, isNew: Bool) {
self.account = account
self.updateTableView()
self.notifyView!.animate(self.notifyFrame!, delay: 2, title: "Account saved!")
}

func accountDeleted() {
self.accountDelegate!.accountDeleted()
}

private func loadForm() {
let form = FormDescriptor()
form.title = "Password View"

let section = FormSectionDescriptor()
var row = FormRowDescriptor(tag: Fields.Name, rowType: .ReadOnlyTextField, title: "Account")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue]
section.addRow(row)

var bgView = UIView()
bgView.backgroundColor = Globals.Theme.AppTintColor
row = FormRowDescriptor(tag: Fields.UserName, rowType: .ReadOnlyTextField, title: "Username")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue,
"selectedBackgroundView": bgView,
"selectionStyle": UITableViewCellSelectionStyle.Default.rawValue]
section.addRow(row)

row = FormRowDescriptor(tag: Fields.Password, rowType: .ReadOnlyTextField, title: "Password")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue,
"selectedBackgroundView": bgView,
"selectionStyle": UITableViewCellSelectionStyle.Default.rawValue]
section.addRow(row)

let section2 = FormSectionDescriptor()

row = FormRowDescriptor(tag: Fields.Category, rowType: .ReadOnlyTextField, title: "Category")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue]
section2.addRow(row)

let section3 = FormSectionDescriptor()

row = FormRowDescriptor(tag: Fields.Website, rowType: .ReadOnlyTextField, title: "Website")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue]
section3.addRow(row)

row = FormRowDescriptor(tag: Fields.AdditionalInfo, rowType: .MultiLineLabel, title: "Additional Info")
row.cellConfiguration = ["titleLabel.textAlignment" : NSTextAlignment.Left.rawValue]
section3.addRow(row)

form.sections = [section, section2, section3]
self.form = form
}

func formViewController(controller: FormViewController, didSelectRowDescriptor: FormRowDescriptor) {
if didSelectRowDescriptor.tag == Fields.UserName || didSelectRowDescriptor.tag == Fields.Password {
UIPasteboard.generalPasteboard().string = (didSelectRowDescriptor.value as? String)!
self.notifyView!.animate(self.notifyFrame!, delay: 2, title: "Copied to clipboard")
}
}

}
Loading

0 comments on commit a83d057

Please sign in to comment.