Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sahara108 committed Jan 22, 2015
1 parent d3f9e20 commit e61ccd1
Show file tree
Hide file tree
Showing 482 changed files with 12,443 additions and 12,634 deletions.
119 changes: 118 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,118 @@
xcuserdata/
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.3
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2014 updates:
# - appended non-standard items DISABLED by default (uncomment if you use those tools)
# - removed the edit that an SO.com moderator made without bothering to ask me
# - researched CocoaPods .lock more carefully, thanks to Gokhan Celiker
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################

#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.DS_Store

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.Trashes

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

*.swp

#
# *.lock - this is used and abused by many editors for many different things.
# For the main ones I use (e.g. Eclipse), it should be excluded
# from source-control, but YMMV.
# (lock files are usually local-only file-synchronization on the local FS that should NOT go in git)
# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations!

*.lock


#
# profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?)
#profile


####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"

# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html

*.pbxuser

# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode1v3

# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode2v3

# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file

*.perspectivev3

# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


xcuserdata
*.xcworkspace

*.moved-aside

####
## Pods
Pods
Podfile.lock
15 changes: 12 additions & 3 deletions PocketForecast/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?
var cityDao: CityDao?
var rootViewController: RootViewController?
var cityDao: CityDao? {

didSet {
println("did set city dao")
}
}
var rootViewController: RootViewController? {
didSet {
println("did set root view controller ")
}
}

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

println("did finish launching ")
ICLoader.setImageName("cloud_icon.png")
ICLoader.setLabelFontName(UIFont.applicationFontOfSize(10).fontName)

Expand Down
22 changes: 20 additions & 2 deletions PocketForecast/Assembly/ApplicationAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,29 @@ public class ApplicationAssembly: TyphoonAssembly {
public dynamic func appDelegate() -> AnyObject {
return TyphoonDefinition.withClass(AppDelegate.self) {
(definition) in

definition.injectProperty("cityDao", with:self.coreComponents.cityDao())
definition.injectProperty("rootViewController", with:self.rootViewController())
}
}

public dynamic func customObj() -> AnyObject {
return TyphoonDefinition.withClass(Temperature.self) {
(definition) in
definition.useInitializer("initWithCelciusString:") {
(initializer) in
initializer.injectParameterWith("1000")
}

/* This code will work. But I need overwrite the init method of Temperature class.
definition.useInitializer("init") {
}
*/
}
}

public dynamic func customObj2() -> AnyObject {
return TyphoonDefinition.withClass(Temperature.self)
}


/*
Expand Down Expand Up @@ -69,7 +87,7 @@ public class ApplicationAssembly: TyphoonAssembly {

return TyphoonDefinition.withClass(CitiesListViewController.self) {
(definition) in

definition.scope = TyphoonScope.LazySingleton
definition.useInitializer("initWithCityDao:theme:") {
(initializer) in

Expand Down
2 changes: 1 addition & 1 deletion PocketForecast/Assembly/Configuration.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>service.url</key>
<string>NSURL(http://api.worldweatheronline.com/free/v2/weather.ashx)</string>
<key>api.key</key>
<string>$$YOUR_API_KEY_HERE$$</string>
<string>a8f0760738b991f9a6d295a4230ff</string>
<key>days.to.retrieve</key>
<string>NSNumber(5)</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion PocketForecast/Client/WeatherClientBasicImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation
public class WeatherClientBasicImpl: NSObject, WeatherClient {

var weatherReportDao: WeatherReportDao?
var serviceUrl: NSURL?
var serviceUrl: NSURL! = NSURL(string: "http://free.worldweatheronline.com")
var daysToRetrieve: NSNumber?

var apiKey: String? {
Expand Down
18 changes: 14 additions & 4 deletions PocketForecast/Model/Temperature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum TemperatureUnits : Int {
case Fahrenheit
}


@objc
public class Temperature : NSObject, NSCoding {

private var _temperatureInFahrenheit : NSDecimalNumber
Expand All @@ -31,7 +31,17 @@ public class Temperature : NSObject, NSCoding {
NSUserDefaults.standardUserDefaults().setInteger(units.rawValue, forKey: "pf.default.units")
}


override init() {
_temperatureInFahrenheit = NSDecimalNumber(string: "1000");

_shortFormatter = NSNumberFormatter()
_shortFormatter.minimumFractionDigits = 0;
_shortFormatter.maximumFractionDigits = 0;

_longFormatter = NSNumberFormatter()
_longFormatter.minimumFractionDigits = 0
_longFormatter.maximumFractionDigits = 1
}

public init(temperatureInFahrenheit : NSDecimalNumber) {
_temperatureInFahrenheit = temperatureInFahrenheit;
Expand All @@ -46,11 +56,11 @@ public class Temperature : NSObject, NSCoding {

}

public convenience init(fahrenheitString : String) {
public dynamic convenience init(fahrenheitString : String) {
self.init(temperatureInFahrenheit:NSDecimalNumber(string: fahrenheitString))
}

public convenience init(celciusString : String) {
public dynamic convenience init(celciusString : String) {
let fahrenheit = NSDecimalNumber(string: celciusString)
.decimalNumberByMultiplyingBy(9)
.decimalNumberByDividingBy(5)
Expand Down
13 changes: 11 additions & 2 deletions PocketForecast/UserInterface/RootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class RootViewController : UIViewController, PaperFoldViewDelegate {
private var mainContentViewContainer : UIView!
private var sideViewState : SideViewState!
private var assembly : ApplicationAssembly!
var customObj: NSObject?

private var paperFoldView : PaperFoldView {
get {
Expand All @@ -45,7 +46,6 @@ public class RootViewController : UIViewController, PaperFoldViewDelegate {

public init(mainContentViewController : UIViewController, assembly : ApplicationAssembly) {
super.init(nibName : nil, bundle : nil)

self.assembly = assembly
self.sideViewState = SideViewState.Hidden
self.pushViewController(mainContentViewController, replaceRoot: true)
Expand Down Expand Up @@ -89,10 +89,19 @@ public class RootViewController : UIViewController, PaperFoldViewDelegate {
}
}

func address<T: AnyObject>(o: T) -> Int {
return unsafeBitCast(o, Int.self)
}

public func showCitiesListController() {
//Test it here.
self.customObj = self.assembly.customObj() as? NSObject
let temp3 = self.assembly.customObj() as NSObject

if (self.sideViewState != SideViewState.Showing) {
self.sideViewState = SideViewState.Showing
self.citiesListController = UINavigationController(rootViewController: self.assembly.citiesListController() as UIViewController)
let cityVC : UIViewController = self.assembly.citiesListController() as UIViewController
self.citiesListController = UINavigationController(rootViewController: cityVC)

self.citiesListController!.view.frame = CGRectMake(0, 0, SIDE_CONTROLLER_WIDTH, self.mainContentViewContainer.frame.size.height)

Expand Down
23 changes: 14 additions & 9 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ PODS:
- CKUITools
- NGAParallaxMotion (1.1.0)
- NSURL+QueryDictionary (1.0.3)
- OCHamcrest (4.0.1)
- OCHamcrest (4.1.1)
- OCLogTemplate (1.0)
- OCMockito (1.3.1):
- OCMockito (1.4.0):
- OCHamcrest (~> 4.0)
- PaperFold (1.2)
- Typhoon (HEAD based on 2.3.2):
- Typhoon/no-arc
- Typhoon/no-arc (HEAD based on 2.3.2)
- Typhoon (HEAD based on 2.3.3):
- Typhoon/no-arc (= HEAD based on 2.3.3)
- Typhoon/no-arc (HEAD based on 2.3.3)

DEPENDENCIES:
- CKUITools
Expand All @@ -31,16 +31,21 @@ EXTERNAL SOURCES:
:git: https://github.com/jasperblues/PaperFold-for-iOS.git
:tag: 1.2-no-gesture-recognizers

CHECKOUT OPTIONS:
PaperFold:
:git: https://github.com/jasperblues/PaperFold-for-iOS.git
:tag: 1.2-no-gesture-recognizers

SPEC CHECKSUMS:
CKUITools: b7e352ba583531b8946f22319aef43ce5e258f33
Expecta: 112bcafa2304ee0f3c5e586505f24555a47b25d5
ICLoader: fc21a5ad5ca6467dc897638fec533ef1516b7bdc
NGAParallaxMotion: 62644b783178f75a234f458270f416afee89877c
NSURL+QueryDictionary: 1ad81be60c10e3f4d80c5c4beb7125de96aaec5e
OCHamcrest: b464725bbb48d0f1cd9c6f4ec3cb35fe0c4f2b94
OCHamcrest: af1c7c5ea345de69ea6c9c2958f65f3044e5c420
OCLogTemplate: 441259f3660762183dc412d6c30e68a6b6bd6adf
OCMockito: 57b8c4bb54ff3a4a14eb2174f9e57faf9f56efb6
OCMockito: 991936bb775cc4c27f063d38f5e17b9161fbd21c
PaperFold: 56c21be56fe6454fa99927b251396471d341c874
Typhoon: 9cd60aa73d729abc3478039a544fd7bb00a79f32
Typhoon: 4a4069a559bc0a033fba95611382a69ab194bec6

COCOAPODS: 0.34.4
COCOAPODS: 0.35.0

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Build/Typhoon/TyphoonComponentPostProcessor.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCBoolReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCCharReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCDoubleReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCFloatReturnGetter.h

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCIntReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCLongLongReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCLongReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCObjectReturnGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCReturnTypeHandlerChain.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCReturnValueGetter.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCSenTestFailureHandler.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCShortReturnGetter.h

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCUnsignedIntReturnGetter.h

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/HCXCTestFailureHandler.h

This file was deleted.

1 change: 0 additions & 1 deletion Pods/Headers/Public/OCHamcrest/NSInvocation+OCHamcrest.h

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e61ccd1

Please sign in to comment.