Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamazz committed Jul 28, 2015
1 parent e233e4d commit c97609a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 33 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
osx_image: xcode6.4
language: swift
before_install:
- export LANG=en_US.UTF-8
- gem install cocoapods xcpretty --no-ri --no-rdoc --no-ri --no-rdoc
script: rake test
4 changes: 2 additions & 2 deletions Gulps WatchKit Extension/InterfaceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InterfaceController: WKInterfaceController {
self.reloadAndUpdateUI()
}

let entry = EntryHandler().currentEntry() as Entry
let entry = EntryHandler.sharedHandler.currentEntry() as Entry
previousPercentage = entry.percentage
progressImage.setImageNamed("activity-")
}
Expand Down Expand Up @@ -50,7 +50,7 @@ class InterfaceController: WKInterfaceController {
private extension InterfaceController {

func reloadAndUpdateUI() {
let entry = EntryHandler().currentEntry() as Entry
let entry = EntryHandler.sharedHandler.currentEntry() as Entry
var delta = Int(entry.percentage - previousPercentage)
if (delta < 0) {
// animate in reverse using negative duration
Expand Down
6 changes: 3 additions & 3 deletions Gulps/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UIKit
import RealmSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

Expand All @@ -9,8 +9,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

setupAppearance()

Settings.registerDefaults()
EntryHandler.sharedHandler.realm = Realm(inMemoryIdentifier: "gulps-spec")
Settings.registerDefaults()

let userDefaults = NSUserDefaults.groupUserDefaults()
if (!userDefaults.boolForKey(Settings.General.OnboardingShown.key())) {
loadOnboardingInterface()
Expand Down
24 changes: 12 additions & 12 deletions Gulps/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mQX-uO-zkr">
<rect key="frame" x="50" y="20" width="220" height="220"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="drop" translatesAutoresizingMaskIntoConstraints="NO" id="JPp-1k-zdE">
<imageView userInteractionEnabled="NO" alpha="0.0" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="drop" translatesAutoresizingMaskIntoConstraints="NO" id="JPp-1k-zdE">
<rect key="frame" x="0.0" y="0.0" width="220" height="220"/>
</imageView>
</subviews>
Expand Down Expand Up @@ -197,21 +197,21 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Way to go!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zyj-Gr-Ph8">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Way to go!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zyj-Gr-Ph8">
<rect key="frame" x="16" y="30" width="288" height="70"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="48"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q2X-D7-DBk">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q2X-D7-DBk">
<rect key="frame" x="16" y="120" width="288" height="66"/>
<string key="text">Good job keeping healthy!
By the way, we’d love some feedback! How do you feel about Gulps? </string>
<fontDescription key="fontDescription" name="Avenir-Book" family="Avenir" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uEc-xW-5dW">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uEc-xW-5dW">
<rect key="frame" x="110" y="221" width="100" height="100"/>
<state key="normal" image="smile">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
Expand All @@ -220,7 +220,7 @@ By the way, we’d love some feedback! How do you feel about Gulps? </string>
<segue destination="JON-j6-9hc" kind="push" id="jfd-S8-Q0D"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xa4-EW-hWa">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xa4-EW-hWa">
<rect key="frame" x="110" y="351" width="100" height="100"/>
<state key="normal" image="sad">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -262,13 +262,13 @@ By the way, we’d love some feedback! How do you feel about Gulps? </string>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Yay!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ee7-af-1yT">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Yay!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ee7-af-1yT">
<rect key="frame" x="16" y="40" width="288" height="70"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="48"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="How about rating Gulps on the AppStore? We always appreciate the feedback!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R9l-6a-fbg">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="How about rating Gulps on the AppStore? We always appreciate the feedback!" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R9l-6a-fbg">
<rect key="frame" x="16" y="160" width="288" height="66"/>
<fontDescription key="fontDescription" name="Avenir-Book" family="Avenir" pointSize="16"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down Expand Up @@ -498,31 +498,31 @@ By the way, we’d love some feedback! How do you feel about Gulps? </string>
<constraint firstAttribute="height" constant="300" id="38h-4O-5tL"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="0%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nja-Uo-jJw">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Nja-Uo-jJw">
<rect key="frame" x="16" y="338" width="288" height="35"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="24"/>
<color key="textColor" red="0.21960784310000001" green="0.49019607840000001" blue="0.81176470590000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Liters drank over" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4E2-NO-CiF">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Liters drank over" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4E2-NO-CiF">
<rect key="frame" x="16" y="133" width="288" height="25"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="17"/>
<color key="textColor" red="0.21960784310000001" green="0.49019607840000001" blue="0.81176470590000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="200" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="lon-Jb-3Cm" customClass="UICountingLabel">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="200" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="lon-Jb-3Cm" customClass="UICountingLabel">
<rect key="frame" x="16" y="40" width="288" height="93"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="64"/>
<color key="textColor" red="0.21960784310000001" green="0.49019607840000001" blue="0.81176470590000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="days" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jpZ-Ht-zcx">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="days" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jpZ-Ht-zcx">
<rect key="frame" x="16" y="263" width="288" height="25"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="17"/>
<color key="textColor" red="0.21960784310000001" green="0.49019607840000001" blue="0.81176470590000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="200" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="R2u-Oc-VLI" customClass="UICountingLabel">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="200" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="R2u-Oc-VLI" customClass="UICountingLabel">
<rect key="frame" x="16" y="170" width="288" height="93"/>
<fontDescription key="fontDescription" name="KaushanScript-Regular" family="Kaushan Script" pointSize="64"/>
<color key="textColor" red="0.21960784310000001" green="0.49019607840000001" blue="0.81176470590000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
6 changes: 2 additions & 4 deletions Gulps/ViewControllers/DrinkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class DrinkViewController: UIViewController, UIAlertViewDelegate, UIViewC
progressMeter!.backgroundColor = .clearColor()
progressMeter!.fillColor = .mainColor()
progressMeter!.fillAutoReverse = false
progressMeter!.fillDuration = 1.5
progressMeter!.fillRepeatCount = 0;
meterContainerView.insertSubview(progressMeter!, belowSubview: maskImage)
}
Expand All @@ -85,10 +86,7 @@ public class DrinkViewController: UIViewController, UIAlertViewDelegate, UIViewC
let percentage = EntryHandler.sharedHandler.currentPercentage()
percentageLabel.countFromCurrentValueTo(Float(round(percentage)))
var fillTo = CGFloat(percentage / 100.0)
if fillTo > 1 {
fillTo = 1.0
}
progressMeter?.fillTo(fillTo)
progressMeter?.fillTo(fillTo > 1 ? 1 : fillTo)
}

override public func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
Expand Down
12 changes: 1 addition & 11 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

def common_pods
# pod 'Realm', '~> 0.92'
pod 'AMWaveTransition', '~> 0.5'
pod 'AHKActionSheet', '~> 0.5'
pod 'pop', '~> 1.0'
pod 'AMPopTip', '~> 0.7'
pod 'UICountingLabel', '~> 1.2'
pod 'JTCalendar', git: 'https://github.com/andreamazz/JTCalendar', branch: 'develop'
pod 'BAFluidView', '~> 0.1.5'
pod 'BAFluidView', '~> 0.1.6'
pod 'BubbleTransition'
# pod 'BEMSimpleLineGraph'
end

target 'Gulps' do
Expand All @@ -25,14 +23,6 @@ target 'GulpsTests' do
pod 'Nimble-Snapshots'
end

# target 'GulpsToday' do
# pod 'Realm', '~> 0.92'
# end

# target 'Gulps WatchKit Extension' do
# pod 'Realm', '~> 0.92'
# end

inhibit_all_warnings!
use_frameworks!

4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
desc "Run the test suite"

task :test do
system "pod install"

build = "xcodebuild \
-workspace Gulps.xcworkspace \
-scheme Gulps \
-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.3'"
-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4'"
system "#{build} test | xcpretty --test --color"
end

Expand Down

0 comments on commit c97609a

Please sign in to comment.