Permalink
Browse files

Initial batch of code.

  • Loading branch information...
0 parents commit 3b6d6f5e530270e916a0fe13c15846e27a1dde28 @kreeger committed Jun 23, 2014
@@ -0,0 +1,26 @@
+# 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/
@@ -0,0 +1,14 @@
+//
+// Mileage // FillupCell.swift
+// Copyright (c) 2014 Ben Kreeger. All rights reserved.
+//
+
+import UIKit
+
+let FillupCellReuseID = "FillupCell"
+
+class FillupCell: UICollectionViewCell {
+ init(coder aDecoder: NSCoder!) {
+ super.init(coder: aDecoder)
+ }
+}
@@ -0,0 +1,35 @@
+//
+// Mileage // AppDelegate.swift
+// Copyright (c) 2014 Ben Kreeger. All rights reserved.
+//
+
+import UIKit
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+ var window: UIWindow?
+
+ func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
+ self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
+
+ let fillupVC = FillupViewController()
+ let navVC = UINavigationController(rootViewController: fillupVC)
+
+ self.window!.rootViewController = navVC
+ self.window!.backgroundColor = UIColor.whiteColor()
+ self.window!.makeKeyAndVisible()
+ return true
+ }
+
+ func applicationWillResignActive(application: UIApplication) { }
+
+ func applicationDidEnterBackground(application: UIApplication) { }
+
+ func applicationWillEnterForeground(application: UIApplication) { }
+
+ func applicationDidBecomeActive(application: UIApplication) { }
+
+ func applicationWillTerminate(application: UIApplication) { }
+}
+
@@ -0,0 +1,17 @@
+//
+// Mileage // FillupDataSource.swift
+// Copyright (c) 2014 Ben Kreeger. All rights reserved.
+//
+
+import UIKit
+
+class FillupDataSource: NSObject, UICollectionViewDataSource {
+ func collectionView(collectionView: UICollectionView!, numberOfItemsInSection section: Int) -> Int {
+ return 1
+ }
+
+ func collectionView(collectionView: UICollectionView!, cellForItemAtIndexPath indexPath: NSIndexPath!) -> UICollectionViewCell! {
+ var cell = collectionView.dequeueReusableCellWithReuseIdentifier(FillupCellReuseID, forIndexPath: indexPath) as? FillupCell
+ return cell
+ }
+}
@@ -0,0 +1,62 @@
+//
+// FillupViewController.swift
+// Mileage
+//
+// Created by Ben Kreeger on 6/22/14.
+// Copyright (c) 2014 Ben Kreeger. All rights reserved.
+//
+
+import UIKit
+
+class FillupViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
+
+ @lazy var collectionView: UICollectionView! = {
+ var vc = UICollectionView(frame: self.view.frame, collectionViewLayout: self.flowLayout)
+ vc.delegate = self
+ vc.dataSource = self.dataSource
+ vc.registerClass(FillupCell.self, forCellWithReuseIdentifier: FillupCellReuseID)
+ return vc
+ }()
+
+ @lazy var flowLayout: UICollectionViewFlowLayout! = {
+ var layout = UICollectionViewFlowLayout()
+ return layout
+ }()
+
+ let dataSource: FillupDataSource
+
+ init() {
+ dataSource = FillupDataSource()
+ super.init(nibName: nil, bundle: nil)
+ }
+
+ override func loadView() {
+ self.view = UIView(frame: UIScreen.mainScreen().bounds)
+ self.view.addSubview(self.collectionView)
+ }
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ self.title = "Fillups"
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Dispose of any resources that can be recreated.
+ }
+
+ func collectionView(collectionView: UICollectionView!, layout collectionViewLayout: UICollectionViewLayout!, sizeForItemAtIndexPath indexPath: NSIndexPath!) -> CGSize {
+ return CGSize(width: collectionView.frame.size.width, height: 50)
+ }
+
+ /*
+ // #pragma mark - Navigation
+
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ override func prepareForSegue(segue: UIStoryboardSegue?, sender: AnyObject?) {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+}
Oops, something went wrong.

0 comments on commit 3b6d6f5

Please sign in to comment.