Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
will-tm committed Oct 25, 2015
1 parent f5c37d9 commit bb86e1a
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 47 deletions.
39 changes: 34 additions & 5 deletions Example/WMGaugeView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
3E788DD61BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E788DD51BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.m */; };
3E788DDF1BDCF58300F78D6A /* WMGaugeViewStyle3D.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E788DDE1BDCF58300F78D6A /* WMGaugeViewStyle3D.m */; };
3E788DE21BDCFE7F00F78D6A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E788DE01BDCFE7F00F78D6A /* LaunchScreen.storyboard */; };
BE18403519197AE8002ACE81 /* WMGaugeView.m in Sources */ = {isa = PBXBuildFile; fileRef = BE18403419197AE8002ACE81 /* WMGaugeView.m */; };
BEE4441D189846A9002B489A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEE4441C189846A9002B489A /* Foundation.framework */; };
BEE4441F189846A9002B489A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEE4441E189846A9002B489A /* CoreGraphics.framework */; };
Expand Down Expand Up @@ -35,6 +38,12 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
3E788DD41BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMGaugeViewStyleFlatThin.h; sourceTree = "<group>"; };
3E788DD51BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMGaugeViewStyleFlatThin.m; sourceTree = "<group>"; };
3E788DD71BDCEB0200F78D6A /* WMGaugeViewStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMGaugeViewStyle.h; sourceTree = "<group>"; };
3E788DDD1BDCF58300F78D6A /* WMGaugeViewStyle3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMGaugeViewStyle3D.h; sourceTree = "<group>"; };
3E788DDE1BDCF58300F78D6A /* WMGaugeViewStyle3D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMGaugeViewStyle3D.m; sourceTree = "<group>"; };
3E788DE11BDCFE7F00F78D6A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
BE18403319197AE8002ACE81 /* WMGaugeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMGaugeView.h; sourceTree = "<group>"; };
BE18403419197AE8002ACE81 /* WMGaugeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMGaugeView.m; sourceTree = "<group>"; };
BEE44419189846A9002B489A /* WMGaugeView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WMGaugeView.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -87,6 +96,11 @@
children = (
BE18403319197AE8002ACE81 /* WMGaugeView.h */,
BE18403419197AE8002ACE81 /* WMGaugeView.m */,
3E788DD71BDCEB0200F78D6A /* WMGaugeViewStyle.h */,
3E788DD41BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.h */,
3E788DD51BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.m */,
3E788DDD1BDCF58300F78D6A /* WMGaugeViewStyle3D.h */,
3E788DDE1BDCF58300F78D6A /* WMGaugeViewStyle3D.m */,
);
name = WMGaugeView;
path = ../../WMGaugeView;
Expand Down Expand Up @@ -129,6 +143,7 @@
BEE4442B189846A9002B489A /* AppDelegate.h */,
BEE4442C189846A9002B489A /* AppDelegate.m */,
BEE4442E189846A9002B489A /* Main.storyboard */,
3E788DE01BDCFE7F00F78D6A /* LaunchScreen.storyboard */,
BEE44431189846A9002B489A /* ViewController.h */,
BEE44432189846A9002B489A /* ViewController.m */,
BEE44434189846A9002B489A /* Images.xcassets */,
Expand Down Expand Up @@ -210,7 +225,7 @@
BEE44411189846A9002B489A /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0710;
ORGANIZATIONNAME = "Will™";
TargetAttributes = {
BEE44439189846A9002B489A = {
Expand Down Expand Up @@ -243,6 +258,7 @@
buildActionMask = 2147483647;
files = (
BEE44435189846A9002B489A /* Images.xcassets in Resources */,
3E788DE21BDCFE7F00F78D6A /* LaunchScreen.storyboard in Resources */,
BEE44427189846A9002B489A /* InfoPlist.strings in Resources */,
BEE44430189846A9002B489A /* Main.storyboard in Resources */,
);
Expand All @@ -266,7 +282,9 @@
BE18403519197AE8002ACE81 /* WMGaugeView.m in Sources */,
BEE44433189846A9002B489A /* ViewController.m in Sources */,
BEE4442D189846A9002B489A /* AppDelegate.m in Sources */,
3E788DDF1BDCF58300F78D6A /* WMGaugeViewStyle3D.m in Sources */,
BEE44429189846A9002B489A /* main.m in Sources */,
3E788DD61BDCEAC500F78D6A /* WMGaugeViewStyleFlatThin.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -289,6 +307,14 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
3E788DE01BDCFE7F00F78D6A /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
3E788DE11BDCFE7F00F78D6A /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
BEE44425189846A9002B489A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -334,6 +360,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -348,7 +375,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -380,7 +407,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -390,10 +417,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "WMGaugeView/WMGaugeView-Prefix.pch";
INFOPLIST_FILE = "WMGaugeView/WMGaugeView-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.will-tm.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -403,10 +430,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "WMGaugeView/WMGaugeView-Prefix.pch";
INFOPLIST_FILE = "WMGaugeView/WMGaugeView-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.will-tm.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -428,6 +455,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "WMGaugeViewTests/WMGaugeViewTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.will-tm.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand All @@ -446,6 +474,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "WMGaugeView/WMGaugeView-Prefix.pch";
INFOPLIST_FILE = "WMGaugeViewTests/WMGaugeViewTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.will-tm.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
Expand Down
28 changes: 28 additions & 0 deletions Example/WMGaugeView/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
34 changes: 23 additions & 11 deletions Example/WMGaugeView/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5037.2" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -16,18 +18,33 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="clP-EX-e2b" customClass="WMGaugeView">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="clP-EX-e2b" customClass="WMGaugeView">
<rect key="frame" x="25" y="20" width="270" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="clP-EX-e2b" secondAttribute="height" multiplier="1:1" id="3zl-XW-CSP"/>
</constraints>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4ct-Ov-IxY" customClass="WMGaugeView">
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4ct-Ov-IxY" customClass="WMGaugeView">
<rect key="frame" x="25" y="295" width="270" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" secondItem="4ct-Ov-IxY" secondAttribute="height" multiplier="1:1" id="86H-b5-Bc2"/>
</constraints>
</view>
</subviews>
<animations/>
<color key="backgroundColor" red="0.93333333333333335" green="0.93333333333333335" blue="0.93333333333333335" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="4ct-Ov-IxY" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="25" id="DSJ-eR-Tld"/>
<constraint firstAttribute="trailing" secondItem="4ct-Ov-IxY" secondAttribute="trailing" constant="25" id="NRU-cY-ifF"/>
<constraint firstAttribute="trailing" secondItem="clP-EX-e2b" secondAttribute="trailing" constant="25" id="Sw6-GQ-Dw6"/>
<constraint firstItem="clP-EX-e2b" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" constant="20" id="dVy-Np-pJg"/>
<constraint firstItem="clP-EX-e2b" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="25" id="i26-Tj-NoR"/>
<constraint firstItem="4ct-Ov-IxY" firstAttribute="top" secondItem="clP-EX-e2b" secondAttribute="bottom" constant="5" id="w31-4c-lvj"/>
</constraints>
</view>
<connections>
<outlet property="gaugeView" destination="clP-EX-e2b" id="wKV-bm-JaQ"/>
Expand All @@ -38,9 +55,4 @@
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
Expand Down
6 changes: 6 additions & 0 deletions Example/WMGaugeView/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

This file was deleted.

8 changes: 2 additions & 6 deletions Example/WMGaugeView/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (void)viewDidLoad
{
[super viewDidLoad];

_gaugeView.style = [WMGaugeViewStyle3D new];
_gaugeView.maxValue = 240.0;
_gaugeView.showRangeLabels = YES;
_gaugeView.rangeValues = @[ @50, @90, @130, @240.0 ];
Expand All @@ -37,24 +38,19 @@ - (void)viewDidLoad
_gaugeView.rangeLabelsWidth = 0.04;
_gaugeView.rangeLabelsFont = [UIFont fontWithName:@"Helvetica" size:0.04];

_gaugeView2.style = [WMGaugeViewStyleFlatThin new];
_gaugeView2.maxValue = 100.0;
_gaugeView2.scaleDivisions = 10;
_gaugeView2.scaleSubdivisions = 5;
_gaugeView2.scaleStartAngle = 30;
_gaugeView2.scaleEndAngle = 280;
_gaugeView2.innerBackgroundStyle = WMGaugeViewInnerBackgroundStyleFlat;
_gaugeView2.showScaleShadow = NO;
_gaugeView2.scaleFont = [UIFont fontWithName:@"AvenirNext-UltraLight" size:0.065];
_gaugeView2.scalesubdivisionsAligment = WMGaugeViewSubdivisionsAlignmentCenter;
_gaugeView2.scaleSubdivisionsWidth = 0.002;
_gaugeView2.scaleSubdivisionsLength = 0.04;
_gaugeView2.scaleDivisionsWidth = 0.007;
_gaugeView2.scaleDivisionsLength = 0.07;
_gaugeView2.needleStyle = WMGaugeViewNeedleStyleFlatThin;
_gaugeView2.needleWidth = 0.012;
_gaugeView2.needleHeight = 0.4;
_gaugeView2.needleScrewStyle = WMGaugeViewNeedleScrewStylePlain;
_gaugeView2.needleScrewRadius = 0.05;

[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
Expand Down
4 changes: 3 additions & 1 deletion Example/WMGaugeView/WMGaugeView-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.will-tm.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -24,6 +24,8 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
Expand Down
2 changes: 1 addition & 1 deletion Example/WMGaugeViewTests/WMGaugeViewTests-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.will-tm.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
Expand Down

0 comments on commit bb86e1a

Please sign in to comment.