Skip to content

Commit

Permalink
added number text field for double
Browse files Browse the repository at this point in the history
  • Loading branch information
lukman-foreflight committed Jan 8, 2016
1 parent 11cd77d commit 4565c54
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 91 deletions.
76 changes: 35 additions & 41 deletions samples/Simpletodo/SimpletodoFinal.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,39 @@
26CEF5FA14EC418A00BEC0BF /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CEF5F914EC418A00BEC0BF /* MobileCoreServices.framework */; };
26CEF5FC14EC419100BEC0BF /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CEF5FB14EC419100BEC0BF /* SystemConfiguration.framework */; };
26CEF5FE14EC41AD00BEC0BF /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26CEF5FD14EC41AD00BEC0BF /* libz.dylib */; };
46B787EA16B70429001AA908 /* libSimperium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 46B787E716B70402001AA908 /* libSimperium.a */; };
46CC658F16B09C7700D5DC22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 46CC658E16B09C7700D5DC22 /* Default-568h@2x.png */; };
BDD13B571C3EF5FD00397952 /* libSimperium.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BD286B6B1C3EF2D60085B0C0 /* libSimperium.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
2457B1931798E134008266B3 /* PBXContainerItemProxy */ = {
BD286B6A1C3EF2D60085B0C0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46B787DD16B70402001AA908 /* Simperium.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 264CD8FA135DFD7A00C51BAD;
remoteInfo = Simperium;
};
46B787E616B70402001AA908 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46B787DD16B70402001AA908 /* Simperium.xcodeproj */;
containerPortal = BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 264CD8FB135DFD7A00C51BAD;
remoteInfo = Simperium;
};
46B787E816B70402001AA908 /* PBXContainerItemProxy */ = {
BD286B6C1C3EF2D60085B0C0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46B787DD16B70402001AA908 /* Simperium.xcodeproj */;
containerPortal = BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 264CD908135DFD7A00C51BAD;
remoteInfo = SimperiumTests;
remoteInfo = IntegrationTests;
};
B5D907191A2E72C600B64A4F /* PBXContainerItemProxy */ = {
BD286B6E1C3EF2D60085B0C0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 46B787DD16B70402001AA908 /* Simperium.xcodeproj */;
containerPortal = BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = B5E8D33A1831237500AE2C5A;
remoteInfo = UnitTests;
};
BDD7CB791C3EF43B00EB0452 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 264CD8FA135DFD7A00C51BAD;
remoteInfo = Simperium;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -92,16 +92,16 @@
26CEF5F914EC418A00BEC0BF /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
26CEF5FB14EC419100BEC0BF /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
26CEF5FD14EC41AD00BEC0BF /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
46B787DD16B70402001AA908 /* Simperium.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Simperium.xcodeproj; path = ../../Simperium.xcodeproj; sourceTree = "<group>"; };
46CC658E16B09C7700D5DC22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Simperium.xcodeproj; path = ../../Simperium.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
26156AC414EC3D4C003332BA /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
46B787EA16B70429001AA908 /* libSimperium.a in Frameworks */,
BDD13B571C3EF5FD00397952 /* libSimperium.a in Frameworks */,
266F06E515E60C3F00308C5D /* libicucore.dylib in Frameworks */,
266F06E215E60C3700308C5D /* Security.framework in Frameworks */,
26CEF5FE14EC41AD00BEC0BF /* libz.dylib in Frameworks */,
Expand All @@ -121,7 +121,7 @@
26156ABC14EC3D4C003332BA = {
isa = PBXGroup;
children = (
46B787DD16B70402001AA908 /* Simperium.xcodeproj */,
BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */,
26C93A7214F86D1800BE99F5 /* icon.png */,
26C93A7314F86D1800BE99F5 /* icon@2x.png */,
46CC658E16B09C7700D5DC22 /* Default-568h@2x.png */,
Expand Down Expand Up @@ -187,12 +187,12 @@
name = "Supporting Files";
sourceTree = "<group>";
};
46B787DE16B70402001AA908 /* Products */ = {
BD286B641C3EF2D60085B0C0 /* Products */ = {
isa = PBXGroup;
children = (
46B787E716B70402001AA908 /* libSimperium.a */,
46B787E916B70402001AA908 /* IntegrationTests.xctest */,
B5D9071A1A2E72C600B64A4F /* UnitTests.xctest */,
BD286B6B1C3EF2D60085B0C0 /* libSimperium.a */,
BD286B6D1C3EF2D60085B0C0 /* IntegrationTests.xctest */,
BD286B6F1C3EF2D60085B0C0 /* UnitTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -211,7 +211,7 @@
buildRules = (
);
dependencies = (
2457B1941798E134008266B3 /* PBXTargetDependency */,
BDD7CB7A1C3EF43B00EB0452 /* PBXTargetDependency */,
);
name = SimpletodoFinal;
productName = Simpletodo;
Expand All @@ -238,8 +238,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = 46B787DE16B70402001AA908 /* Products */;
ProjectRef = 46B787DD16B70402001AA908 /* Simperium.xcodeproj */;
ProductGroup = BD286B641C3EF2D60085B0C0 /* Products */;
ProjectRef = BD286B631C3EF2D60085B0C0 /* Simperium.xcodeproj */;
},
);
projectRoot = "";
Expand All @@ -250,25 +250,25 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
46B787E716B70402001AA908 /* libSimperium.a */ = {
BD286B6B1C3EF2D60085B0C0 /* libSimperium.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libSimperium.a;
remoteRef = 46B787E616B70402001AA908 /* PBXContainerItemProxy */;
remoteRef = BD286B6A1C3EF2D60085B0C0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
46B787E916B70402001AA908 /* IntegrationTests.xctest */ = {
BD286B6D1C3EF2D60085B0C0 /* IntegrationTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = IntegrationTests.xctest;
remoteRef = 46B787E816B70402001AA908 /* PBXContainerItemProxy */;
remoteRef = BD286B6C1C3EF2D60085B0C0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B5D9071A1A2E72C600B64A4F /* UnitTests.xctest */ = {
BD286B6F1C3EF2D60085B0C0 /* UnitTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = UnitTests.xctest;
remoteRef = B5D907191A2E72C600B64A4F /* PBXContainerItemProxy */;
remoteRef = BD286B6E1C3EF2D60085B0C0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
Expand Down Expand Up @@ -306,10 +306,10 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
2457B1941798E134008266B3 /* PBXTargetDependency */ = {
BDD7CB7A1C3EF43B00EB0452 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = Simperium;
targetProxy = 2457B1931798E134008266B3 /* PBXContainerItemProxy */;
targetProxy = BDD7CB791C3EF43B00EB0452 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

Expand Down Expand Up @@ -414,10 +414,6 @@
26156AF114EC3D4C003332BA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../..\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SimpletodoFinal/SimpletodoFinal-Prefix.pch";
INFOPLIST_FILE = "SimpletodoFinal/SimpletodoFinal-Info.plist";
Expand All @@ -426,17 +422,14 @@
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = SimpletodoFinal;
PUBLIC_HEADERS_FOLDER_PATH = "";
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
26156AF214EC3D4C003332BA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../..\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "SimpletodoFinal/SimpletodoFinal-Prefix.pch";
INFOPLIST_FILE = "SimpletodoFinal/SimpletodoFinal-Info.plist";
Expand All @@ -445,6 +438,7 @@
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = SimpletodoFinal;
PUBLIC_HEADERS_FOLDER_PATH = "";
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
13 changes: 12 additions & 1 deletion samples/Simpletodo/SimpletodoFinal/SPDetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#import "SPDetailViewController.h"
#import "Todo.h"

@interface SPDetailViewController ()
@interface SPDetailViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *numberField;
@property (strong, nonatomic) UIPopoverController *masterPopoverController;
- (void)configureView;
@end
Expand Down Expand Up @@ -43,6 +44,10 @@ - (void)configureView
if (self.detailItem) {
self.textField.text = [self.detailItem title];
}

if (self.detailItem.num) {
self.numberField.text = [self.detailItem.num description];
}
}

- (void)didReceiveMemoryWarning
Expand All @@ -58,6 +63,7 @@ - (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
self.numberField.delegate = self;
}

- (void)viewDidUnload
Expand All @@ -83,6 +89,11 @@ - (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.detailItem.title = self.textField.text;
if ([self.numberField.text length] == 0) {
self.detailItem.num = nil;
}else{
self.detailItem.num = @([self.numberField.text doubleValue]);
}
}

- (void)viewDidDisappear:(BOOL)animated
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="6254" systemVersion="14B17" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<model userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="9525" systemVersion="15C50" minimumToolsVersion="Automatic">
<entity name="Todo" representedClassName="Todo" syncable="YES">
<attribute name="done" optional="YES" attributeType="Boolean" syncable="YES"/>
<attribute name="ghostData" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="num" optional="YES" attributeType="Double" defaultValueString="0.0" syncable="YES"/>
<attribute name="order" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
<attribute name="simperiumKey" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
</entity>
<elements>
<element name="Todo" positionX="180" positionY="297" width="128" height="118"/>
<element name="Todo" positionX="180" positionY="297" width="128" height="135"/>
</elements>
</model>
1 change: 1 addition & 0 deletions samples/Simpletodo/SimpletodoFinal/Todo.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSNumber * order;
@property (nonatomic, retain) NSNumber * done;
@property (nonatomic, retain) NSNumber * num;

@end
1 change: 1 addition & 0 deletions samples/Simpletodo/SimpletodoFinal/Todo.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ @implementation Todo
@dynamic title;
@dynamic order;
@dynamic done;
@dynamic num;

@end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="5">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand All @@ -20,7 +20,7 @@
</objects>
<point key="canvasLocation" x="448" y="-630"/>
</scene>
<!--Detail View Controller - Detail-->
<!--Detail-->
<scene sceneID="16">
<objects>
<viewController title="Detail" id="4" customClass="SPDetailViewController" sceneMemberID="viewController">
Expand All @@ -29,7 +29,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" text="Detail view content goes here" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" id="27">
<rect key="frame" x="20" y="372.5" width="663" height="21"/>
<rect key="frame" x="20" y="373" width="663" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" size="system"/>
Expand All @@ -38,7 +38,6 @@
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" title="Detail" id="53"/>
Expand All @@ -63,15 +62,14 @@
</objects>
<point key="canvasLocation" x="-687" y="-630"/>
</scene>
<!--Master View Controller - Master-->
<!--Master-->
<scene sceneID="24">
<objects>
<tableViewController title="Master" clearsSelectionOnViewWillAppear="NO" id="19" customClass="SPMasterViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="20">
<rect key="frame" x="0.0" y="0.0" width="320" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="svd-JR-vYX" style="IBUITableViewCellStyleDefault" id="ZSw-0O-9Pw">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
Expand All @@ -81,7 +79,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="svd-JR-vYX">
<rect key="frame" x="10" y="0.0" width="300" height="43"/>
<rect key="frame" x="15" y="0.0" width="290" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
Expand Down Expand Up @@ -121,9 +119,4 @@
<point key="canvasLocation" x="-366" y="248"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
</document>
Loading

0 comments on commit 4565c54

Please sign in to comment.