├── Resources ├── icon29.png ├── icon40.png ├── icon58.png ├── icon76.png ├── icon80.png ├── icon87.png ├── icon120.png ├── icon152.png ├── icon180.png ├── voltDB_0.png ├── VoltDB Logo.png └── voltDB Icon.psd ├── VoltPanel ├── Images.xcassets │ ├── first.imageset │ │ ├── first.pdf │ │ └── Contents.json │ ├── cluster.imageset │ │ ├── home-3.png │ │ └── Contents.json │ ├── hosts.imageset │ │ ├── justify.png │ │ └── Contents.json │ ├── second.imageset │ │ ├── second.pdf │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── icon29.png │ │ ├── icon40.png │ │ ├── icon58.png │ │ ├── icon76.png │ │ ├── icon80.png │ │ ├── icon87.png │ │ ├── icon120-1.png │ │ ├── icon120.png │ │ ├── icon152.png │ │ ├── icon180.png │ │ ├── icon58-2.png │ │ ├── icon80-1.png │ │ └── Contents.json │ ├── host.imageset │ │ ├── computer-2.png │ │ └── Contents.json │ ├── settings.imageset │ │ ├── gear-5.pdf │ │ └── Contents.json │ ├── connection.imageset │ │ ├── signal.png │ │ └── Contents.json │ └── power.imageset │ │ ├── powe-symbol-2.png │ │ └── Contents.json ├── VoltPanel.playground │ ├── timeline.xctimeline │ ├── section-1.swift │ └── contents.xcplayground ├── PropertyViewCell.swift ├── InfoBox.swift ├── Info.plist ├── HostsViewController.swift ├── AppDelegate.swift ├── ClusterViewController.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── ConnectionViewController.swift ├── PropertyCell.xib ├── SharedData.swift └── VoltJSON.swift ├── README.md ├── .gitignore ├── VoltPanelTests ├── Info.plist └── VoltPanelTests.swift ├── LICENSE └── VoltPanel.xcodeproj └── project.pbxproj /Resources/icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon29.png -------------------------------------------------------------------------------- /Resources/icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon40.png -------------------------------------------------------------------------------- /Resources/icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon58.png -------------------------------------------------------------------------------- /Resources/icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon76.png -------------------------------------------------------------------------------- /Resources/icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon80.png -------------------------------------------------------------------------------- /Resources/icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon87.png -------------------------------------------------------------------------------- /Resources/icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon120.png -------------------------------------------------------------------------------- /Resources/icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon152.png -------------------------------------------------------------------------------- /Resources/icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/icon180.png -------------------------------------------------------------------------------- /Resources/voltDB_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/voltDB_0.png -------------------------------------------------------------------------------- /Resources/VoltDB Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/VoltDB Logo.png -------------------------------------------------------------------------------- /Resources/voltDB Icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/Resources/voltDB Icon.psd -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/first.imageset/first.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/first.imageset/first.pdf -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/cluster.imageset/home-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/cluster.imageset/home-3.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/hosts.imageset/justify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/hosts.imageset/justify.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/second.imageset/second.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/second.imageset/second.pdf -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon29.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon40.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon58.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon76.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon80.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon87.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/host.imageset/computer-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/host.imageset/computer-2.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/settings.imageset/gear-5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/settings.imageset/gear-5.pdf -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon120-1.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon120.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon152.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon180.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon58-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon58-2.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/icon80-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/AppIcon.appiconset/icon80-1.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/connection.imageset/signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/connection.imageset/signal.png -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/power.imageset/powe-symbol-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VoltDB/app-voltpanel-ios/master/VoltPanel/Images.xcassets/power.imageset/powe-symbol-2.png -------------------------------------------------------------------------------- /VoltPanel/VoltPanel.playground/timeline.xctimeline: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | app-voltpanel-ios 2 | ================= 3 | 4 | ## Introduction 5 | 6 | This is a sample iOS application written in Swift to get VoltDB system information 7 | using the HTTP/JSON interface. -------------------------------------------------------------------------------- /VoltPanel/VoltPanel.playground/section-1.swift: -------------------------------------------------------------------------------- 1 | import XCPlayground 2 | import UIKit 3 | 4 | //XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true) 5 | 6 | var d = [String:String]() 7 | d["a"] = "b" 8 | 9 | -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/first.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "first.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/second.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "second.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gear-5.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /VoltPanel/VoltPanel.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/cluster.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "home-3.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/connection.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "signal.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/host.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "computer-2.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/hosts.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "justify.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/power.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "powe-symbol-2.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | xcuserdata 20 | **/*.xcworkspace/** 21 | 22 | # Mac-isms 23 | .DS_Store 24 | 25 | # CocoaPods 26 | # 27 | # We recommend against adding the Pods directory to your .gitignore. However 28 | # you should judge for yourself, the pros and cons are mentioned at: 29 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 30 | # 31 | # Pods/ 32 | -------------------------------------------------------------------------------- /VoltPanelTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.wijjo.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /VoltPanel/PropertyViewCell.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | class PropertyCell : UITableViewCell { 21 | @IBOutlet var uiName: UILabel! 22 | @IBOutlet var uiValue: UILabel! 23 | 24 | required init(coder aDecoder: NSCoder) { 25 | super.init(coder: aDecoder) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /VoltPanelTests/VoltPanelTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VoltPanelTests.swift 3 | // VoltPanelTests 4 | // 5 | // Created by Steve Cooper on 12/12/14. 6 | // Copyright (c) 2014 Steve Cooper. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class VoltPanelTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 VoltDB 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /VoltPanel/InfoBox.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | class InfoBox { 21 | 22 | let uiField: UILabel 23 | 24 | init(_ uiField: UILabel) { 25 | self.uiField = uiField 26 | } 27 | 28 | func info(text: String) { 29 | self.uiField.text = text 30 | println("INFO: \(text)") 31 | } 32 | 33 | func error(text: String) { 34 | self.uiField.text = "* \(text) *" 35 | println("ERROR: \(text)") 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /VoltPanel/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "icon58.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "icon87.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "icon80.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "icon120.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "icon120-1.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "icon180.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "icon29.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "icon58-2.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "icon40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "icon80-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "icon76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "icon152.png", 73 | "scale" : "2x" 74 | } 75 | ], 76 | "info" : { 77 | "version" : 1, 78 | "author" : "xcode" 79 | } 80 | } -------------------------------------------------------------------------------- /VoltPanel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.wijjo.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarTintParameters 34 | 35 | UINavigationBar 36 | 37 | Style 38 | UIBarStyleDefault 39 | Translucent 40 | 41 | 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UISupportedInterfaceOrientations~ipad 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationPortraitUpsideDown 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /VoltPanel/HostsViewController.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | class HostsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { 21 | 22 | @IBOutlet weak var uiProperties: UITableView! 23 | @IBOutlet weak var uiMessage: UILabel! 24 | 25 | let sharedData = SharedData.data 26 | 27 | //=== View controller methods 28 | 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | 32 | self.uiProperties.registerClass(UITableViewCell.self, forCellReuseIdentifier: "propertyCell") 33 | 34 | // Register property cell NIB (resource) to allow use in tableView:cellForRowAtIndexPath 35 | let cellNib = UINib(nibName: "PropertyCell", bundle: nil) 36 | self.uiProperties.registerNib(cellNib, forCellReuseIdentifier: "propertyCell") 37 | } 38 | 39 | override func didReceiveMemoryWarning() { 40 | super.didReceiveMemoryWarning() 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | //=== Table view methods 45 | 46 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 47 | return self.sharedData.hosts.count 48 | } 49 | 50 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 51 | let cell = self.uiProperties.dequeueReusableCellWithIdentifier("propertyCell") as PropertyCell 52 | cell.uiName.text = "\(indexPath.row+1)" 53 | cell.uiValue.text = self.sharedData.hosts[indexPath.row].name 54 | return cell 55 | } 56 | 57 | func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 58 | return "Hosts" 59 | } 60 | 61 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /VoltPanel/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | @UIApplicationMain 21 | class AppDelegate: UIResponder, UIApplicationDelegate { 22 | 23 | var window: UIWindow? 24 | 25 | 26 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 27 | // Override point for customization after application launch. 28 | return true 29 | } 30 | 31 | func applicationWillResignActive(application: UIApplication) { 32 | // 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. 33 | // 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. 34 | } 35 | 36 | func applicationDidEnterBackground(application: UIApplication) { 37 | // 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. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | func applicationWillEnterForeground(application: UIApplication) { 42 | // 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. 43 | } 44 | 45 | func applicationDidBecomeActive(application: UIApplication) { 46 | // 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. 47 | } 48 | 49 | func applicationWillTerminate(application: UIApplication) { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /VoltPanel/ClusterViewController.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | class ClusterViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { 21 | 22 | @IBOutlet weak var uiProperties: UITableView! 23 | @IBOutlet weak var uiMessage: UILabel! 24 | 25 | let sharedData = SharedData.data 26 | 27 | //=== View controller methods 28 | 29 | override func viewDidLoad() { 30 | super.viewDidLoad() 31 | 32 | self.uiProperties.registerClass(UITableViewCell.self, forCellReuseIdentifier: "propertyCell") 33 | 34 | // Register property cell NIB (resource) to allow use in tableView:cellForRowAtIndexPath 35 | let cellNib = UINib(nibName: "PropertyCell", bundle: nil) 36 | self.uiProperties.registerNib(cellNib, forCellReuseIdentifier: "propertyCell") 37 | } 38 | 39 | override func didReceiveMemoryWarning() { 40 | super.didReceiveMemoryWarning() 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | //=== Table view methods 45 | 46 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 47 | if let results = sharedData.deployment.results { 48 | if let table = results.table(0) { 49 | return table.data.count 50 | } 51 | } 52 | return 0 53 | } 54 | 55 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 56 | let cell = self.uiProperties.dequeueReusableCellWithIdentifier("propertyCell") as PropertyCell 57 | var name = "?" 58 | var value = "?" 59 | if let results = sharedData.deployment.results { 60 | if let table = results.table(0) { 61 | let row = table.data[indexPath.row] 62 | if let rowName = row.string(0) { 63 | name = rowName 64 | } 65 | if let rowValue = row.string(1) { 66 | value = rowValue 67 | } 68 | } 69 | } 70 | cell.uiName.text = name 71 | cell.uiValue.text = value 72 | return cell 73 | } 74 | 75 | func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 76 | return "Cluster Properties" 77 | } 78 | 79 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /VoltPanel/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /VoltPanel/ConnectionViewController.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import UIKit 19 | 20 | class ConnectionViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { 21 | 22 | @IBOutlet weak var uiHostList: UITableView! 23 | @IBOutlet weak var uiHost: UITextField! 24 | @IBOutlet weak var uiMessage: UILabel! 25 | 26 | var infoBox: InfoBox! 27 | 28 | let sharedData = SharedData.data 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | self.infoBox = InfoBox(self.uiMessage) 33 | } 34 | 35 | override func didReceiveMemoryWarning() { 36 | super.didReceiveMemoryWarning() 37 | // Dispose of any resources that can be recreated. 38 | } 39 | 40 | // Close keyboard when touch happens outside fields. 41 | override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { 42 | self.view.endEditing(true) 43 | } 44 | 45 | //=== Connect button 46 | 47 | @IBAction func onConnect(sender: AnyObject) { 48 | let host = self.uiHost.text.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()) 49 | if host.isEmpty { 50 | self.infoBox.error("A host is required to connect.") 51 | } else { 52 | self.sharedData.selectHost(host) { 53 | if let results = self.sharedData.deployment.results { 54 | if let table = results.table(0) { 55 | self.uiHostList.reloadData() 56 | self.uiHost.resignFirstResponder() 57 | var numHosts = self.sharedData.hosts.count 58 | self.infoBox.info("\(host) has \(table.data.count) properties and \(numHosts) host(s).") 59 | } else { 60 | self.infoBox.error("Results did not have data.") 61 | } 62 | } else { 63 | self.infoBox.error(self.sharedData.deployment.error!) 64 | } 65 | } 66 | } 67 | } 68 | 69 | //=== UITableViewDataSource 70 | 71 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 72 | return self.sharedData.recentHosts.count 73 | } 74 | 75 | func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { 76 | return "Previous Hosts" 77 | } 78 | 79 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 80 | let id = "row\(indexPath.row+1)" 81 | let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: id) 82 | cell.textLabel?.text = self.sharedData.recentHosts[indexPath.row] 83 | return cell 84 | } 85 | 86 | //=== UITableViewDelegate 87 | 88 | func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 89 | if let cell = uiHostList.cellForRowAtIndexPath(indexPath) { 90 | if let textLabel = cell.textLabel { 91 | self.uiHost.text = textLabel.text 92 | } 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /VoltPanel/PropertyCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /VoltPanel/SharedData.swift: -------------------------------------------------------------------------------- 1 | /* This file is part of VoltDB. 2 | * Copyright (C) 2008-2015 VoltDB Inc. 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as 6 | * published by the Free Software Foundation, either version 3 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with VoltDB. If not, see . 16 | */ 17 | 18 | import Foundation 19 | 20 | enum PersistentDataState { 21 | case NO_DATA, LOADED, IGNORED_BAD, NOT_LOADED 22 | } 23 | 24 | enum UserDefaultsKey: String { 25 | case hosts = "hosts" 26 | } 27 | 28 | class Host { 29 | var properties = [String:String]() 30 | var name: String { 31 | get { 32 | if let hostname = self.properties["HOSTNAME"] { 33 | return hostname 34 | } 35 | return "" 36 | } 37 | } 38 | } 39 | 40 | let userDefaults = NSUserDefaults.standardUserDefaults() 41 | 42 | protocol SharedDataDelegate { 43 | func didReceiveData(data: NSDictionary) 44 | func didReceiveError(error: String) 45 | } 46 | 47 | class ProcedureResults { 48 | var results: VoltJSONResults? 49 | var error: String? 50 | 51 | init() { 52 | } 53 | } 54 | 55 | class ProcedureExecutor : VoltJSONResultsDelegate { 56 | let procName: String 57 | let procResults: ProcedureResults 58 | let callBack: (Void) -> Void 59 | 60 | init(procName: String, procResults: ProcedureResults, callBack: (Void) -> Void) { 61 | self.procName = procName 62 | self.procResults = procResults 63 | self.callBack = callBack 64 | } 65 | 66 | func get(host: String, params: [AnyObject]) { 67 | let voltJSON = VoltJSON(host: host, resultsDelegate: self) 68 | voltJSON.execProc(procName, params: params) 69 | } 70 | 71 | func get(host: String) { 72 | self.get(host, params: []) 73 | } 74 | 75 | func connectionDidFinishLoading(results: VoltJSONResults) { 76 | println("Received results: \(results.dict)") 77 | self.procResults.results = results 78 | self.procResults.error = nil 79 | self.callBack() 80 | } 81 | 82 | func didFailWithError(error: String) { 83 | self.procResults.results = nil 84 | self.procResults.error = error 85 | self.callBack() 86 | } 87 | } 88 | 89 | /** 90 | * Persistent data 91 | * Access data through the .data singleton member. 92 | * Do not access data (hosts, state, etc.) members directly! 93 | */ 94 | class SharedData { 95 | 96 | var recentHosts: [String] = [] 97 | var persistentDataState: PersistentDataState = .NOT_LOADED 98 | var selectedHost: String? 99 | var deployment = ProcedureResults() 100 | var hosts = [Host]() 101 | 102 | // The magic singleton property. 103 | class var data: SharedData { 104 | struct Static { 105 | static var instance: SharedData? 106 | static var token: dispatch_once_t = 0 107 | } 108 | 109 | dispatch_once(&Static.token) { 110 | Static.instance = SharedData() 111 | } 112 | 113 | return Static.instance! 114 | } 115 | 116 | init() { 117 | if let genericItems: AnyObject = userDefaults.objectForKey(UserDefaultsKey.hosts.rawValue) { 118 | if let loadedItems = genericItems as? [String] { 119 | self.recentHosts = loadedItems 120 | self.persistentDataState = .LOADED 121 | } else { 122 | self.persistentDataState = .IGNORED_BAD 123 | } 124 | } else { 125 | self.persistentDataState = .NO_DATA 126 | } 127 | if (self.persistentDataState != .LOADED) { 128 | // Seed the hosts list with localhost. 129 | self.recentHosts = ["localhost:8080"] 130 | } 131 | } 132 | 133 | func insertRecentHost(host: String) { 134 | self.deleteRecentHost(host) 135 | if let foundAtIndex = find(self.recentHosts, host) { 136 | self.recentHosts.removeAtIndex(foundAtIndex) 137 | } 138 | self.recentHosts.insert(host, atIndex: 0) 139 | self.save() 140 | } 141 | 142 | func deleteRecentHost(host: String) -> Bool { 143 | if let foundAtIndex = find(self.recentHosts, host) { 144 | self.recentHosts.removeAtIndex(foundAtIndex) 145 | self.save() 146 | return true 147 | } 148 | return false 149 | } 150 | 151 | func selectHost(host: String, callBack: (Void) -> Void) { 152 | 153 | //TODO: This nested code structure is a little weird? 154 | 155 | let deploymentRetriever = ProcedureExecutor( 156 | procName: "SystemInformation", procResults: self.deployment) { 157 | 158 | if let deploymentResults = self.deployment.results { 159 | 160 | var hostsRaw = ProcedureResults() 161 | 162 | let hostsRetriever = ProcedureExecutor( 163 | procName: "SystemInformation", procResults: hostsRaw) { 164 | 165 | if let hostsRawResults = hostsRaw.results { 166 | 167 | if let table = hostsRawResults.table(0) { 168 | var numHosts = 0 169 | for tuple in table.data { 170 | if let hostIndex = tuple.integer(0) { 171 | if hostIndex >= 0 && hostIndex + 1 > numHosts { 172 | numHosts = hostIndex + 1 173 | } 174 | } 175 | } 176 | if numHosts > 0 { 177 | self.hosts = [Host]() 178 | for hostIndex in 0... 16 | */ 17 | 18 | import Foundation 19 | 20 | // http://docs.voltdb.com/UsingVoltDB/ProgLangJson.php 21 | 22 | // Access to index-able items in a generic container. 23 | // Container subclass must override subscript method. 24 | class VoltJSONContainerWrapperBase { 25 | 26 | func integer(key: AnyObject) -> Int? { 27 | return self[key] as? Int 28 | } 29 | 30 | // Integer value extracted from string type 31 | func integerFromString(key: AnyObject) -> Int? { 32 | if let s = self[key] as? String { 33 | if let i = s.toInt() { 34 | return i 35 | } 36 | } 37 | return nil 38 | } 39 | 40 | func string(key: AnyObject) -> String? { 41 | return self[key] as? String 42 | } 43 | 44 | // String that can use "" for null values. 45 | func stringWithNull(key: AnyObject) -> String? { 46 | if let s = self[key] as? String { 47 | if s != "" { 48 | return s 49 | } 50 | } 51 | return nil 52 | } 53 | 54 | func dictionary(key: AnyObject) -> VoltJSONDictionaryWrapper? { 55 | if let d = self[key] as? NSDictionary { 56 | let wrapper = VoltJSONDictionaryWrapper(d) 57 | return wrapper 58 | } 59 | return nil 60 | } 61 | 62 | func tuple(key: AnyObject) -> VoltJSONTupleWrapper? { 63 | if let t = self[key] as? [AnyObject] { 64 | return VoltJSONTupleWrapper(t) 65 | } 66 | return nil 67 | } 68 | 69 | // Required override. 70 | subscript(key: AnyObject) -> AnyObject? { 71 | return nil 72 | } 73 | 74 | // Required override. 75 | var count: Int { 76 | get { 77 | return 0 78 | } 79 | } 80 | } 81 | 82 | class VoltJSONTupleWrapper : VoltJSONContainerWrapperBase { 83 | let tuple: [AnyObject] 84 | 85 | init(_ tuple: [AnyObject]) { 86 | self.tuple = tuple 87 | } 88 | 89 | // Required by VoltJSONContainerWrapperBase 90 | override subscript(key: AnyObject) -> AnyObject? { 91 | if let index = key as? Int { 92 | if index >= 0 && index < self.tuple.count { 93 | return self.tuple[index] 94 | } 95 | } else { 96 | println("Bad tuple index: \(key)") 97 | } 98 | return nil 99 | } 100 | 101 | // Required VoltJSONContainerWrapperBase override. 102 | override var count: Int { 103 | get { 104 | return self.tuple.count 105 | } 106 | } 107 | } 108 | 109 | class VoltJSONDictionaryWrapper : VoltJSONContainerWrapperBase { 110 | let dict: NSDictionary 111 | 112 | init(_ dict: NSDictionary) { 113 | self.dict = dict 114 | } 115 | 116 | // Required by VoltJSONContainerWrapperBase 117 | override subscript(key: AnyObject) -> AnyObject? { 118 | if let keyString = key as? String { 119 | return self.dict[keyString] 120 | } else { 121 | println("Bad dictionary key: \(key)") 122 | } 123 | return nil 124 | } 125 | 126 | // Required VoltJSONContainerWrapperBase override. 127 | override var count: Int { 128 | get { 129 | return self.dict.count 130 | } 131 | } 132 | } 133 | 134 | class VoltJSONSchema : VoltJSONDictionaryWrapper { 135 | 136 | var name: String? { 137 | get { 138 | return self.string("name") 139 | } 140 | } 141 | 142 | var type: Int? { 143 | get { 144 | return self.integer("type") 145 | } 146 | } 147 | } 148 | 149 | struct VoltJSONTable { 150 | let data: [VoltJSONTupleWrapper] 151 | let schema: [VoltJSONSchema] 152 | } 153 | 154 | class VoltJSONResult : VoltJSONDictionaryWrapper { 155 | 156 | var status: Int? { 157 | get { 158 | return self.integer("status") 159 | } 160 | } 161 | 162 | var table: VoltJSONTable? { 163 | if let data = self.data { 164 | if let schema = self.schema { 165 | return VoltJSONTable(data: data, schema: schema) 166 | } 167 | } 168 | return nil 169 | } 170 | 171 | var data: [VoltJSONTupleWrapper]? { 172 | if let dataTupleOfTuples = self.tuple("data") { 173 | //TODO: Pre-allocate or do something smarter? 174 | var dataTupleArray: [VoltJSONTupleWrapper] = [] 175 | for i in 0.. VoltJSONTable? { 258 | let tables = self.tables 259 | if index >= 0 && index < tables.count { 260 | return self.tables[index] 261 | } 262 | return nil 263 | } 264 | } 265 | 266 | protocol VoltJSONResultsDelegate { 267 | func connectionDidFinishLoading(results: VoltJSONResults) 268 | func didFailWithError(error: String) 269 | } 270 | 271 | class VoltJSONRequest { 272 | let url: NSURL 273 | var data = NSMutableData() 274 | let resultsDelegate: VoltJSONResultsDelegate 275 | 276 | init(url: NSURL, resultsDelegate: VoltJSONResultsDelegate) { 277 | self.url = url 278 | self.resultsDelegate = resultsDelegate 279 | } 280 | 281 | func get() { 282 | let task = NSURLSession.sharedSession().dataTaskWithURL(url) { 283 | (data, response, error) in 284 | var parseError: NSError? 285 | if let dict = NSJSONSerialization.JSONObjectWithData( 286 | data, options: NSJSONReadingOptions.MutableContainers, error: &parseError) 287 | as? NSDictionary { 288 | dispatch_async(dispatch_get_main_queue()) { 289 | self.resultsDelegate.connectionDidFinishLoading(VoltJSONResults(dict)) 290 | } 291 | } else { 292 | dispatch_async(dispatch_get_main_queue()) { 293 | if let parseError = parseError { 294 | self.resultsDelegate.didFailWithError(parseError.description) 295 | } else { 296 | self.resultsDelegate.didFailWithError( 297 | "Unknown error parsing JSON: \(data.description)") 298 | } 299 | } 300 | } 301 | } 302 | task.resume() 303 | } 304 | } 305 | 306 | func buildURLArrayParam(name: String, anyParams: [AnyObject]) -> String { 307 | var paramsBlock = "" 308 | for anyParam in anyParams { 309 | if paramsBlock.isEmpty { 310 | paramsBlock += "&\(name)=[" 311 | } else { 312 | paramsBlock += "," 313 | } 314 | if let intParam = anyParam as? Int { 315 | paramsBlock += "\(intParam)" 316 | } else if let stringParam = anyParam as? String { 317 | paramsBlock += "'\(stringParam)'" 318 | } else { 319 | paramsBlock += "\(anyParam)" 320 | } 321 | } 322 | if !paramsBlock.isEmpty { 323 | paramsBlock += "]" 324 | } 325 | return paramsBlock 326 | } 327 | 328 | func buildExecProcURL(host: String, procName: String, anyParams: [AnyObject]) -> String { 329 | var paramsBlock = buildURLArrayParam("Parameters", anyParams) 330 | return "http://\(host)/api/1.0/?Procedure=@\(procName)\(paramsBlock)" 331 | } 332 | 333 | class VoltJSON { 334 | let host: String 335 | let resultsDelegate: VoltJSONResultsDelegate 336 | 337 | init(host: String, resultsDelegate: VoltJSONResultsDelegate) { 338 | self.host = host 339 | self.resultsDelegate = resultsDelegate 340 | } 341 | 342 | func execProc(procName: String, params: [AnyObject]) { 343 | let urlString = buildExecProcURL(host, procName, params) 344 | if let url = NSURL(string: urlString) { 345 | println("GET: \(urlString)") 346 | let request = VoltJSONRequest(url: url, resultsDelegate: self.resultsDelegate) 347 | request.get() 348 | } else { 349 | self.resultsDelegate.didFailWithError("Bad NSURL: \(urlString)") 350 | } 351 | } 352 | } 353 | -------------------------------------------------------------------------------- /VoltPanel.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | AA0790801A43445A00154FDC /* InfoBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA07907F1A43445A00154FDC /* InfoBox.swift */; }; 11 | AA8400791A4077BE005B8748 /* ConnectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA8400781A4077BE005B8748 /* ConnectionViewController.swift */; }; 12 | AA84007B1A4082A7005B8748 /* SharedData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA84007A1A4082A7005B8748 /* SharedData.swift */; }; 13 | D14E2C551A3B85D3008BE699 /* VoltDB Logo.png in Resources */ = {isa = PBXBuildFile; fileRef = D14E2C541A3B85D3008BE699 /* VoltDB Logo.png */; }; 14 | D158AFA41A447E3D0095FDB0 /* PropertyViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D158AFA31A447E3D0095FDB0 /* PropertyViewCell.swift */; }; 15 | D195C5401A3BAABD006E7499 /* PropertyCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D195C53F1A3BAABD006E7499 /* PropertyCell.xib */; }; 16 | D1ABD59B1A3F77C0008D6551 /* VoltJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1ABD59A1A3F77C0008D6551 /* VoltJSON.swift */; }; 17 | D1DABC9E1A3B61C000225CEC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1DABC9D1A3B61C000225CEC /* AppDelegate.swift */; }; 18 | D1DABCA01A3B61C000225CEC /* ClusterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1DABC9F1A3B61C000225CEC /* ClusterViewController.swift */; }; 19 | D1DABCA21A3B61C000225CEC /* HostsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1DABCA11A3B61C000225CEC /* HostsViewController.swift */; }; 20 | D1DABCA51A3B61C000225CEC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D1DABCA31A3B61C000225CEC /* Main.storyboard */; }; 21 | D1DABCA71A3B61C000225CEC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D1DABCA61A3B61C000225CEC /* Images.xcassets */; }; 22 | D1DABCAA1A3B61C000225CEC /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D1DABCA81A3B61C000225CEC /* LaunchScreen.xib */; }; 23 | D1DABCB61A3B61C000225CEC /* VoltPanelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1DABCB51A3B61C000225CEC /* VoltPanelTests.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | D1DABCB01A3B61C000225CEC /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = D1DABC901A3B61C000225CEC /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = D1DABC971A3B61C000225CEC; 32 | remoteInfo = VoltPanel; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | AA07907F1A43445A00154FDC /* InfoBox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InfoBox.swift; sourceTree = ""; }; 38 | AA8400781A4077BE005B8748 /* ConnectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionViewController.swift; sourceTree = ""; }; 39 | AA84007A1A4082A7005B8748 /* SharedData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharedData.swift; sourceTree = ""; }; 40 | D14E2C541A3B85D3008BE699 /* VoltDB Logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "VoltDB Logo.png"; path = "Resources/VoltDB Logo.png"; sourceTree = ""; }; 41 | D158AFA31A447E3D0095FDB0 /* PropertyViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PropertyViewCell.swift; sourceTree = ""; }; 42 | D174AD461A420B4E008AD0F1 /* VoltPanel.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; name = VoltPanel.playground; path = VoltPanel/VoltPanel.playground; sourceTree = ""; }; 43 | D1884E4E1A44C5D900FB6E07 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 44 | D1884E4F1A44C5D900FB6E07 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 45 | D195C53F1A3BAABD006E7499 /* PropertyCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PropertyCell.xib; sourceTree = ""; }; 46 | D1ABD59A1A3F77C0008D6551 /* VoltJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VoltJSON.swift; sourceTree = ""; }; 47 | D1DABC981A3B61C000225CEC /* VoltPanel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VoltPanel.app; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | D1DABC9C1A3B61C000225CEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | D1DABC9D1A3B61C000225CEC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 50 | D1DABC9F1A3B61C000225CEC /* ClusterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClusterViewController.swift; sourceTree = ""; }; 51 | D1DABCA11A3B61C000225CEC /* HostsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostsViewController.swift; sourceTree = ""; }; 52 | D1DABCA41A3B61C000225CEC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | D1DABCA61A3B61C000225CEC /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 54 | D1DABCA91A3B61C000225CEC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 55 | D1DABCAF1A3B61C000225CEC /* VoltPanelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VoltPanelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | D1DABCB41A3B61C000225CEC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | D1DABCB51A3B61C000225CEC /* VoltPanelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoltPanelTests.swift; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | D1DABC951A3B61C000225CEC /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | D1DABCAC1A3B61C000225CEC /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXFrameworksBuildPhase section */ 76 | 77 | /* Begin PBXGroup section */ 78 | D14E2C531A3B85B6008BE699 /* Resources */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | D14E2C541A3B85D3008BE699 /* VoltDB Logo.png */, 82 | ); 83 | name = Resources; 84 | sourceTree = ""; 85 | }; 86 | D1ABD5971A3F745A008D6551 /* View */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | AA07907F1A43445A00154FDC /* InfoBox.swift */, 90 | D158AFA31A447E3D0095FDB0 /* PropertyViewCell.swift */, 91 | D1DABCA61A3B61C000225CEC /* Images.xcassets */, 92 | D195C53F1A3BAABD006E7499 /* PropertyCell.xib */, 93 | D1DABCA81A3B61C000225CEC /* LaunchScreen.xib */, 94 | D1DABCA31A3B61C000225CEC /* Main.storyboard */, 95 | ); 96 | name = View; 97 | sourceTree = ""; 98 | }; 99 | D1ABD5981A3F746E008D6551 /* Controller */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | D1DABC9D1A3B61C000225CEC /* AppDelegate.swift */, 103 | D1DABC9F1A3B61C000225CEC /* ClusterViewController.swift */, 104 | AA8400781A4077BE005B8748 /* ConnectionViewController.swift */, 105 | D1DABCA11A3B61C000225CEC /* HostsViewController.swift */, 106 | ); 107 | name = Controller; 108 | sourceTree = ""; 109 | }; 110 | D1ABD5991A3F747C008D6551 /* Model */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | AA84007A1A4082A7005B8748 /* SharedData.swift */, 114 | D1ABD59A1A3F77C0008D6551 /* VoltJSON.swift */, 115 | ); 116 | name = Model; 117 | sourceTree = ""; 118 | }; 119 | D1DABC8F1A3B61C000225CEC = { 120 | isa = PBXGroup; 121 | children = ( 122 | D1884E4E1A44C5D900FB6E07 /* LICENSE */, 123 | D1884E4F1A44C5D900FB6E07 /* README.md */, 124 | D174AD461A420B4E008AD0F1 /* VoltPanel.playground */, 125 | D14E2C531A3B85B6008BE699 /* Resources */, 126 | D1DABC9A1A3B61C000225CEC /* VoltPanel */, 127 | D1DABCB21A3B61C000225CEC /* VoltPanelTests */, 128 | D1DABC991A3B61C000225CEC /* Products */, 129 | ); 130 | sourceTree = ""; 131 | }; 132 | D1DABC991A3B61C000225CEC /* Products */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | D1DABC981A3B61C000225CEC /* VoltPanel.app */, 136 | D1DABCAF1A3B61C000225CEC /* VoltPanelTests.xctest */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | D1DABC9A1A3B61C000225CEC /* VoltPanel */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | D1ABD5991A3F747C008D6551 /* Model */, 145 | D1ABD5971A3F745A008D6551 /* View */, 146 | D1ABD5981A3F746E008D6551 /* Controller */, 147 | D1DABC9B1A3B61C000225CEC /* Supporting Files */, 148 | ); 149 | path = VoltPanel; 150 | sourceTree = ""; 151 | }; 152 | D1DABC9B1A3B61C000225CEC /* Supporting Files */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | D1DABC9C1A3B61C000225CEC /* Info.plist */, 156 | ); 157 | name = "Supporting Files"; 158 | sourceTree = ""; 159 | }; 160 | D1DABCB21A3B61C000225CEC /* VoltPanelTests */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | D1DABCB51A3B61C000225CEC /* VoltPanelTests.swift */, 164 | D1DABCB31A3B61C000225CEC /* Supporting Files */, 165 | ); 166 | path = VoltPanelTests; 167 | sourceTree = ""; 168 | }; 169 | D1DABCB31A3B61C000225CEC /* Supporting Files */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | D1DABCB41A3B61C000225CEC /* Info.plist */, 173 | ); 174 | name = "Supporting Files"; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXGroup section */ 178 | 179 | /* Begin PBXNativeTarget section */ 180 | D1DABC971A3B61C000225CEC /* VoltPanel */ = { 181 | isa = PBXNativeTarget; 182 | buildConfigurationList = D1DABCB91A3B61C000225CEC /* Build configuration list for PBXNativeTarget "VoltPanel" */; 183 | buildPhases = ( 184 | D1DABC941A3B61C000225CEC /* Sources */, 185 | D1DABC951A3B61C000225CEC /* Frameworks */, 186 | D1DABC961A3B61C000225CEC /* Resources */, 187 | ); 188 | buildRules = ( 189 | ); 190 | dependencies = ( 191 | ); 192 | name = VoltPanel; 193 | productName = VoltPanel; 194 | productReference = D1DABC981A3B61C000225CEC /* VoltPanel.app */; 195 | productType = "com.apple.product-type.application"; 196 | }; 197 | D1DABCAE1A3B61C000225CEC /* VoltPanelTests */ = { 198 | isa = PBXNativeTarget; 199 | buildConfigurationList = D1DABCBC1A3B61C000225CEC /* Build configuration list for PBXNativeTarget "VoltPanelTests" */; 200 | buildPhases = ( 201 | D1DABCAB1A3B61C000225CEC /* Sources */, 202 | D1DABCAC1A3B61C000225CEC /* Frameworks */, 203 | D1DABCAD1A3B61C000225CEC /* Resources */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | D1DABCB11A3B61C000225CEC /* PBXTargetDependency */, 209 | ); 210 | name = VoltPanelTests; 211 | productName = VoltPanelTests; 212 | productReference = D1DABCAF1A3B61C000225CEC /* VoltPanelTests.xctest */; 213 | productType = "com.apple.product-type.bundle.unit-test"; 214 | }; 215 | /* End PBXNativeTarget section */ 216 | 217 | /* Begin PBXProject section */ 218 | D1DABC901A3B61C000225CEC /* Project object */ = { 219 | isa = PBXProject; 220 | attributes = { 221 | LastUpgradeCheck = 0620; 222 | ORGANIZATIONNAME = "Steve Cooper"; 223 | TargetAttributes = { 224 | D1DABC971A3B61C000225CEC = { 225 | CreatedOnToolsVersion = 6.2; 226 | DevelopmentTeam = ZP6CC48C6Q; 227 | }; 228 | D1DABCAE1A3B61C000225CEC = { 229 | CreatedOnToolsVersion = 6.2; 230 | TestTargetID = D1DABC971A3B61C000225CEC; 231 | }; 232 | }; 233 | }; 234 | buildConfigurationList = D1DABC931A3B61C000225CEC /* Build configuration list for PBXProject "VoltPanel" */; 235 | compatibilityVersion = "Xcode 3.2"; 236 | developmentRegion = English; 237 | hasScannedForEncodings = 0; 238 | knownRegions = ( 239 | en, 240 | Base, 241 | ); 242 | mainGroup = D1DABC8F1A3B61C000225CEC; 243 | productRefGroup = D1DABC991A3B61C000225CEC /* Products */; 244 | projectDirPath = ""; 245 | projectRoot = ""; 246 | targets = ( 247 | D1DABC971A3B61C000225CEC /* VoltPanel */, 248 | D1DABCAE1A3B61C000225CEC /* VoltPanelTests */, 249 | ); 250 | }; 251 | /* End PBXProject section */ 252 | 253 | /* Begin PBXResourcesBuildPhase section */ 254 | D1DABC961A3B61C000225CEC /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | D1DABCA51A3B61C000225CEC /* Main.storyboard in Resources */, 259 | D1DABCAA1A3B61C000225CEC /* LaunchScreen.xib in Resources */, 260 | D14E2C551A3B85D3008BE699 /* VoltDB Logo.png in Resources */, 261 | D1DABCA71A3B61C000225CEC /* Images.xcassets in Resources */, 262 | D195C5401A3BAABD006E7499 /* PropertyCell.xib in Resources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | D1DABCAD1A3B61C000225CEC /* Resources */ = { 267 | isa = PBXResourcesBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | ); 271 | runOnlyForDeploymentPostprocessing = 0; 272 | }; 273 | /* End PBXResourcesBuildPhase section */ 274 | 275 | /* Begin PBXSourcesBuildPhase section */ 276 | D1DABC941A3B61C000225CEC /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | D1DABCA21A3B61C000225CEC /* HostsViewController.swift in Sources */, 281 | D158AFA41A447E3D0095FDB0 /* PropertyViewCell.swift in Sources */, 282 | AA84007B1A4082A7005B8748 /* SharedData.swift in Sources */, 283 | D1DABC9E1A3B61C000225CEC /* AppDelegate.swift in Sources */, 284 | AA8400791A4077BE005B8748 /* ConnectionViewController.swift in Sources */, 285 | D1ABD59B1A3F77C0008D6551 /* VoltJSON.swift in Sources */, 286 | D1DABCA01A3B61C000225CEC /* ClusterViewController.swift in Sources */, 287 | AA0790801A43445A00154FDC /* InfoBox.swift in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | D1DABCAB1A3B61C000225CEC /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | D1DABCB61A3B61C000225CEC /* VoltPanelTests.swift in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXSourcesBuildPhase section */ 300 | 301 | /* Begin PBXTargetDependency section */ 302 | D1DABCB11A3B61C000225CEC /* PBXTargetDependency */ = { 303 | isa = PBXTargetDependency; 304 | target = D1DABC971A3B61C000225CEC /* VoltPanel */; 305 | targetProxy = D1DABCB01A3B61C000225CEC /* PBXContainerItemProxy */; 306 | }; 307 | /* End PBXTargetDependency section */ 308 | 309 | /* Begin PBXVariantGroup section */ 310 | D1DABCA31A3B61C000225CEC /* Main.storyboard */ = { 311 | isa = PBXVariantGroup; 312 | children = ( 313 | D1DABCA41A3B61C000225CEC /* Base */, 314 | ); 315 | name = Main.storyboard; 316 | sourceTree = ""; 317 | }; 318 | D1DABCA81A3B61C000225CEC /* LaunchScreen.xib */ = { 319 | isa = PBXVariantGroup; 320 | children = ( 321 | D1DABCA91A3B61C000225CEC /* Base */, 322 | ); 323 | name = LaunchScreen.xib; 324 | sourceTree = ""; 325 | }; 326 | /* End PBXVariantGroup section */ 327 | 328 | /* Begin XCBuildConfiguration section */ 329 | D1DABCB71A3B61C000225CEC /* Debug */ = { 330 | isa = XCBuildConfiguration; 331 | buildSettings = { 332 | ALWAYS_SEARCH_USER_PATHS = NO; 333 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 334 | CLANG_CXX_LIBRARY = "libc++"; 335 | CLANG_ENABLE_MODULES = YES; 336 | CLANG_ENABLE_OBJC_ARC = YES; 337 | CLANG_WARN_BOOL_CONVERSION = YES; 338 | CLANG_WARN_CONSTANT_CONVERSION = YES; 339 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 340 | CLANG_WARN_EMPTY_BODY = YES; 341 | CLANG_WARN_ENUM_CONVERSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 344 | CLANG_WARN_UNREACHABLE_CODE = YES; 345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 347 | COPY_PHASE_STRIP = NO; 348 | ENABLE_STRICT_OBJC_MSGSEND = YES; 349 | GCC_C_LANGUAGE_STANDARD = gnu99; 350 | GCC_DYNAMIC_NO_PIC = NO; 351 | GCC_OPTIMIZATION_LEVEL = 0; 352 | GCC_PREPROCESSOR_DEFINITIONS = ( 353 | "DEBUG=1", 354 | "$(inherited)", 355 | ); 356 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 357 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 358 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 359 | GCC_WARN_UNDECLARED_SELECTOR = YES; 360 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 361 | GCC_WARN_UNUSED_FUNCTION = YES; 362 | GCC_WARN_UNUSED_VARIABLE = YES; 363 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 364 | MTL_ENABLE_DEBUG_INFO = YES; 365 | ONLY_ACTIVE_ARCH = YES; 366 | SDKROOT = iphoneos; 367 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 368 | TARGETED_DEVICE_FAMILY = "1,2"; 369 | }; 370 | name = Debug; 371 | }; 372 | D1DABCB81A3B61C000225CEC /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 377 | CLANG_CXX_LIBRARY = "libc++"; 378 | CLANG_ENABLE_MODULES = YES; 379 | CLANG_ENABLE_OBJC_ARC = YES; 380 | CLANG_WARN_BOOL_CONVERSION = YES; 381 | CLANG_WARN_CONSTANT_CONVERSION = YES; 382 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 383 | CLANG_WARN_EMPTY_BODY = YES; 384 | CLANG_WARN_ENUM_CONVERSION = YES; 385 | CLANG_WARN_INT_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_UNREACHABLE_CODE = YES; 388 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 389 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 390 | COPY_PHASE_STRIP = YES; 391 | ENABLE_NS_ASSERTIONS = NO; 392 | ENABLE_STRICT_OBJC_MSGSEND = YES; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 395 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 396 | GCC_WARN_UNDECLARED_SELECTOR = YES; 397 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 398 | GCC_WARN_UNUSED_FUNCTION = YES; 399 | GCC_WARN_UNUSED_VARIABLE = YES; 400 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 401 | MTL_ENABLE_DEBUG_INFO = NO; 402 | SDKROOT = iphoneos; 403 | TARGETED_DEVICE_FAMILY = "1,2"; 404 | VALIDATE_PRODUCT = YES; 405 | }; 406 | name = Release; 407 | }; 408 | D1DABCBA1A3B61C000225CEC /* Debug */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 412 | CODE_SIGN_IDENTITY = "iPhone Developer"; 413 | INFOPLIST_FILE = VoltPanel/Info.plist; 414 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 415 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 416 | PRODUCT_NAME = "$(TARGET_NAME)"; 417 | }; 418 | name = Debug; 419 | }; 420 | D1DABCBB1A3B61C000225CEC /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 424 | CODE_SIGN_IDENTITY = "iPhone Developer"; 425 | INFOPLIST_FILE = VoltPanel/Info.plist; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 428 | PRODUCT_NAME = "$(TARGET_NAME)"; 429 | }; 430 | name = Release; 431 | }; 432 | D1DABCBD1A3B61C000225CEC /* Debug */ = { 433 | isa = XCBuildConfiguration; 434 | buildSettings = { 435 | BUNDLE_LOADER = "$(TEST_HOST)"; 436 | FRAMEWORK_SEARCH_PATHS = ( 437 | "$(SDKROOT)/Developer/Library/Frameworks", 438 | "$(inherited)", 439 | ); 440 | GCC_PREPROCESSOR_DEFINITIONS = ( 441 | "DEBUG=1", 442 | "$(inherited)", 443 | ); 444 | INFOPLIST_FILE = VoltPanelTests/Info.plist; 445 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 447 | PRODUCT_NAME = "$(TARGET_NAME)"; 448 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VoltPanel.app/VoltPanel"; 449 | }; 450 | name = Debug; 451 | }; 452 | D1DABCBE1A3B61C000225CEC /* Release */ = { 453 | isa = XCBuildConfiguration; 454 | buildSettings = { 455 | BUNDLE_LOADER = "$(TEST_HOST)"; 456 | FRAMEWORK_SEARCH_PATHS = ( 457 | "$(SDKROOT)/Developer/Library/Frameworks", 458 | "$(inherited)", 459 | ); 460 | INFOPLIST_FILE = VoltPanelTests/Info.plist; 461 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VoltPanel.app/VoltPanel"; 465 | }; 466 | name = Release; 467 | }; 468 | /* End XCBuildConfiguration section */ 469 | 470 | /* Begin XCConfigurationList section */ 471 | D1DABC931A3B61C000225CEC /* Build configuration list for PBXProject "VoltPanel" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | D1DABCB71A3B61C000225CEC /* Debug */, 475 | D1DABCB81A3B61C000225CEC /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | D1DABCB91A3B61C000225CEC /* Build configuration list for PBXNativeTarget "VoltPanel" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | D1DABCBA1A3B61C000225CEC /* Debug */, 484 | D1DABCBB1A3B61C000225CEC /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | D1DABCBC1A3B61C000225CEC /* Build configuration list for PBXNativeTarget "VoltPanelTests" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | D1DABCBD1A3B61C000225CEC /* Debug */, 493 | D1DABCBE1A3B61C000225CEC /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | /* End XCConfigurationList section */ 499 | }; 500 | rootObject = D1DABC901A3B61C000225CEC /* Project object */; 501 | } 502 | -------------------------------------------------------------------------------- /VoltPanel/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 193 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | --------------------------------------------------------------------------------