Skip to content

Commit 40ae1be

Browse files
committed
[enh] Updated example
1 parent c18636d commit 40ae1be

File tree

5 files changed

+55
-21
lines changed

5 files changed

+55
-21
lines changed
Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6724" systemVersion="14B25" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
3+
<device id="retina3_5" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
47
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6711"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
812
<!--View Controller-->
@@ -14,71 +18,94 @@
1418
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
1519
</layoutGuides>
1620
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
17-
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
21+
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
1822
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
1923
<subviews>
2024
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Decimal Number" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Swu-Pq-oFC">
2125
<rect key="frame" x="20" y="47" width="129" height="21"/>
26+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2227
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2328
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
2429
<nil key="highlightedColor"/>
2530
</label>
2631
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="abs-xH-haK" userLabel="decimal" customClass="MPNumericTextField">
2732
<rect key="frame" x="157" y="43" width="143" height="30"/>
28-
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="calibratedRGB"/>
29-
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
33+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
34+
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="sRGB"/>
35+
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3036
<fontDescription key="fontDescription" type="system" pointSize="14"/>
3137
<textInputTraits key="textInputTraits"/>
3238
</textField>
3339
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="jyy-iZ-aUU" userLabel="percentage" customClass="MPNumericTextField">
3440
<rect key="frame" x="157" y="81" width="143" height="30"/>
35-
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="calibratedRGB"/>
36-
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
41+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
42+
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="sRGB"/>
43+
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3744
<fontDescription key="fontDescription" type="system" pointSize="14"/>
3845
<textInputTraits key="textInputTraits"/>
3946
</textField>
4047
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Percentage" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KgL-Zc-enw">
4148
<rect key="frame" x="20" y="85" width="88" height="21"/>
49+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
4250
<fontDescription key="fontDescription" type="system" pointSize="17"/>
4351
<nil key="highlightedColor"/>
4452
</label>
4553
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Ae7-Et-n7x" userLabel="currency" customClass="MPNumericTextField">
4654
<rect key="frame" x="157" y="119" width="143" height="30"/>
47-
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="calibratedRGB"/>
48-
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
55+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
56+
<color key="backgroundColor" red="0.56970397947299167" green="0.69763851798495968" blue="1" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="sRGB"/>
57+
<color key="textColor" red="0.27734375" green="0.038952786492521346" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4958
<fontDescription key="fontDescription" type="system" pointSize="14"/>
5059
<textInputTraits key="textInputTraits"/>
5160
</textField>
5261
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Currency" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jZA-P9-YuG">
53-
<rect key="frame" x="20" y="123" width="70" height="21"/>
62+
<rect key="frame" x="20" y="123" width="129" height="21"/>
63+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
64+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
65+
<nil key="highlightedColor"/>
66+
</label>
67+
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="TNM-7c-VIr" userLabel="currency" customClass="MPNumericTextField">
68+
<rect key="frame" x="157" y="157" width="143" height="30"/>
69+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
70+
<color key="backgroundColor" red="0.56970397949999996" green="0.69763851799999999" blue="1" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="sRGB"/>
71+
<color key="textColor" red="0.27734375" green="0.038952786490000002" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
72+
<fontDescription key="fontDescription" type="system" pointSize="14"/>
73+
<textInputTraits key="textInputTraits"/>
74+
</textField>
75+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Custom curr." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AtK-yo-1wG">
76+
<rect key="frame" x="20" y="161" width="129" height="21"/>
77+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
5478
<fontDescription key="fontDescription" type="system" pointSize="17"/>
5579
<nil key="highlightedColor"/>
5680
</label>
5781
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SRW-9U-U0M">
58-
<rect key="frame" x="20" y="183" width="280" height="30"/>
82+
<rect key="frame" x="20" y="195" width="280" height="30"/>
83+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
5984
<state key="normal" title="Get values">
60-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
85+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
6186
</state>
6287
<connections>
6388
<action selector="getValues:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="faH-dO-zXm"/>
6489
</connections>
6590
</button>
6691
</subviews>
67-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
92+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
6893
</view>
6994
<connections>
7095
<outlet property="currencyField" destination="Ae7-Et-n7x" id="xuU-A1-U3t"/>
96+
<outlet property="customCurrencyField" destination="TNM-7c-VIr" id="TRt-hA-lEo"/>
7197
<outlet property="decimalField" destination="abs-xH-haK" id="gXU-Ne-cAN"/>
7298
<outlet property="percentageField" destination="jyy-iZ-aUU" id="9ie-2f-bzk"/>
7399
</connections>
74100
</viewController>
75101
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
76102
</objects>
103+
<point key="canvasLocation" x="25.5" y="34.5"/>
77104
</scene>
78105
</scenes>
79106
<simulatedMetricsContainer key="defaultSimulatedMetrics">
80107
<simulatedStatusBarMetrics key="statusBar"/>
81108
<simulatedOrientationMetrics key="orientation"/>
82-
<simulatedScreenMetrics key="destination" type="retina4"/>
109+
<simulatedScreenMetrics key="destination"/>
83110
</simulatedMetricsContainer>
84111
</document>

Examples/BasicExample/BasicExample/MPAppDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BasicExample
44
//
55
// Created by Daniele Di Bernardo on 06/04/14.
6-
// Copyright (c) 2014 marzapower. All rights reserved.
6+
// Copyright (c) 2017 marzapower. All rights reserved.
77
//
88

99
#import <UIKit/UIKit.h>

Examples/BasicExample/BasicExample/MPAppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BasicExample
44
//
55
// Created by Daniele Di Bernardo on 06/04/14.
6-
// Copyright (c) 2014 marzapower. All rights reserved.
6+
// Copyright (c) 2017 marzapower. All rights reserved.
77
//
88

99
#import "MPAppDelegate.h"

Examples/BasicExample/BasicExample/MPViewController.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BasicExample
44
//
55
// Created by Daniele Di Bernardo on 06/04/14.
6-
// Copyright (c) 2014 marzapower. All rights reserved.
6+
// Copyright (c) 2017 marzapower. All rights reserved.
77
//
88

99
#import <UIKit/UIKit.h>
@@ -14,7 +14,8 @@
1414
@property(nonatomic, strong) IBOutlet MPNumericTextField *decimalField;
1515
@property(nonatomic, strong) IBOutlet MPNumericTextField *percentageField;
1616
@property(nonatomic, strong) IBOutlet MPNumericTextField *currencyField;
17+
@property(nonatomic, strong) IBOutlet MPNumericTextField *customCurrencyField;
1718

1819
- (IBAction)getValues:(id)sender;
1920

20-
@end
21+
@end

Examples/BasicExample/BasicExample/MPViewController.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BasicExample
44
//
55
// Created by Daniele Di Bernardo on 06/04/14.
6-
// Copyright (c) 2014 marzapower. All rights reserved.
6+
// Copyright (c) 2017 marzapower. All rights reserved.
77
//
88

99
#import "MPViewController.h"
@@ -22,19 +22,25 @@ - (void)viewDidLoad
2222
_decimalField.placeholderColor = placeholderColor;
2323
_percentageField.placeholderColor = placeholderColor;
2424
_currencyField.placeholderColor = placeholderColor;
25+
_customCurrencyField.placeholderColor = placeholderColor;
2526

2627
_decimalField.type = MPNumericTextFieldDecimal;
2728
_percentageField.type = MPNumericTextFieldPercentage;
2829
_currencyField.type = MPNumericTextFieldCurrency;
30+
_customCurrencyField.type = MPNumericTextFieldCurrency;
2931

3032
_decimalField.clearButtonMode = UITextFieldViewModeWhileEditing;
3133
_percentageField.clearButtonMode = UITextFieldViewModeWhileEditing;
3234
_currencyField.clearButtonMode = UITextFieldViewModeWhileEditing;
35+
_customCurrencyField.clearButtonMode = UITextFieldViewModeWhileEditing;
3336

34-
_currencyField.delegate = self;
37+
_customCurrencyField.currencyCode = @"JPY";
3538

3639
[_decimalField setNumericValue:@(10.2)];
3740
[_percentageField setNumericValue:@(5)];
41+
42+
_currencyField.delegate = self;
43+
_customCurrencyField.delegate = self;
3844
}
3945

4046
- (void)getValues:(id)sender {

0 commit comments

Comments
 (0)