Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kellyroach/upgrade to xcode941 #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.0
7 changes: 0 additions & 7 deletions JYLegendView.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@
@property (nonatomic, copy) NSArray *titles;
@property (nonatomic, strong) NSMutableArray *colors;

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
#define JY_TEXT_SIZE(text, font) [text length] > 0 ? [text sizeWithAttributes : @{ NSFontAttributeName : font }] : CGSizeZero;
#define JY_DRAW_TEXT_AT_POINT(text, point, font) [text drawAtPoint : point withAttributes : @{ NSFontAttributeName:font }];
#define JY_DRAW_TEXT_IN_RECT(text, rect, font) [text drawInRect : rect withAttributes : @{ NSFontAttributeName:font }];
#else
#define JY_TEXT_SIZE(text, font) [text length] > 0 ? [text sizeWithFont : font] : CGSizeZero;
#define JY_DRAW_TEXT_AT_POINT(text, point, font) [text drawAtPoint : point withFont : font];
#define JY_DRAW_TEXT_IN_RECT(text, rect, font) [text drawInRect : rect withFont : font];

#endif

@end
41 changes: 15 additions & 26 deletions JYRadarChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
- (void)setDefaultValues {
self.backgroundColor = [UIColor whiteColor];
_maxValue = 100.0;
_centerPoint = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
_r = MIN(self.frame.size.width / 2 - PADDING, self.frame.size.height / 2 - PADDING);
_steps = 1;
_drawPoints = NO;
_pointsDiameter = 8;
Expand Down Expand Up @@ -129,6 +127,8 @@ - (void)setDataSeries:(NSMutableArray *)dataSeries {
}

- (void)layoutSubviews {
_centerPoint = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
_r = MIN(self.frame.size.width / 2 - PADDING, self.frame.size.height / 2 - PADDING);
[self.legendView sizeToFit];
CGRect r = self.legendView.frame;
r.origin.x = self.frame.size.width - self.legendView.frame.size.width - LEGEND_PADDING;
Expand All @@ -139,7 +139,7 @@ - (void)layoutSubviews {

- (void)drawRect:(CGRect)rect {
NSArray *colors = [self.legendView.colors copy];
CGFloat radPerV = M_PI * 2 / _numOfV;
CGFloat radPerV;

if (_clockwise) {
radPerV = - (M_PI * 2 / _numOfV);
Expand All @@ -165,29 +165,18 @@ - (void)drawRect:(CGRect)rect {
CGFloat yOffset = pointOnEdge.y >= _centerPoint.y ? height / 2.0 + padding : -height / 2.0 - padding;
CGPoint legendCenter = CGPointMake(pointOnEdge.x + xOffset, pointOnEdge.y + yOffset);

if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) {
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setLineBreakMode:NSLineBreakByClipping];
[paragraphStyle setAlignment:NSTextAlignmentCenter];

NSDictionary *attributes = @{ NSFontAttributeName: self.scaleFont,
NSParagraphStyleAttributeName: paragraphStyle };

[attributeName drawInRect:CGRectMake(legendCenter.x - width / 2.0,
legendCenter.y - height / 2.0,
width,
height)
withAttributes:attributes];
}
else {
[attributeName drawInRect:CGRectMake(legendCenter.x - width / 2.0,
legendCenter.y - height / 2.0,
width,
height)
withFont:self.scaleFont
lineBreakMode:NSLineBreakByClipping
alignment:NSTextAlignmentCenter];
}
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setLineBreakMode:NSLineBreakByClipping];
[paragraphStyle setAlignment:NSTextAlignmentCenter];

NSDictionary *attributes = @{ NSFontAttributeName: self.scaleFont,
NSParagraphStyleAttributeName: paragraphStyle };

[attributeName drawInRect:CGRectMake(legendCenter.x - width / 2.0,
legendCenter.y - height / 2.0,
width,
height)
withAttributes:attributes];
}

//draw background fill color
Expand Down
439 changes: 158 additions & 281 deletions JYRadarChartDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
158 changes: 158 additions & 0 deletions JYRadarChartDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"images" : [
{
"filename" : "Icon-40.png",
"size" : "40x40",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "60x60",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "Icon-72.png",
"size" : "72x72",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "72x72",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-76.png",
"size" : "76x76",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "76x76",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-Small-50.png",
"size" : "50x50",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "50x50",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "Icon-Small.png",
"size" : "29x29",
"idiom" : "iphone",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "Icon.png",
"size" : "57x57",
"idiom" : "iphone",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "57x57",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "60x60",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "[email protected]",
"size" : "40x40",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "Icon-Small.png",
"size" : "29x29",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "29x29",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "83.5x83.5",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "iphone",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "iphone",
"scale" : "3x"
},
{
"filename" : "NotificationIcon~ipad.png",
"size" : "20x20",
"idiom" : "ipad",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"size" : "20x20",
"idiom" : "ipad",
"scale" : "2x"
},
{
"filename" : "ios-marketing.png",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"scale" : "1x"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions JYRadarChartDemo/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
46 changes: 46 additions & 0 deletions JYRadarChartDemo/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchImage.png" translatesAutoresizingMaskIntoConstraints="NO" id="oSb-4E-yK5">
<rect key="frame" x="0.0" y="146" width="375" height="375"/>
<constraints>
<constraint firstAttribute="width" secondItem="oSb-4E-yK5" secondAttribute="height" multiplier="1:1" id="4eI-ts-urf"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="oSb-4E-yK5" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="3kF-uO-mbF"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="oSb-4E-yK5" secondAttribute="trailing" id="Lrn-xk-lkY"/>
<constraint firstItem="oSb-4E-yK5" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="wAF-zC-wVX"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage.png" width="347" height="347"/>
</resources>
</document>
52 changes: 52 additions & 0 deletions JYRadarChartDemo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Rgv-rN-aPB" customClass="JYRadarChart">
<rect key="frame" x="0.0" y="20" width="375" height="323"/>
<color key="backgroundColor" red="0.83741801979999997" green="0.83743780850000005" blue="0.83742713930000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d5w-Ri-SGf" customClass="JYRadarChart">
<rect key="frame" x="0.0" y="344" width="375" height="323"/>
<color key="backgroundColor" red="0.66422420739999999" green="0.66424006219999998" blue="0.66423153879999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="Rgv-rN-aPB" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="37c-Qf-BUw"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="d5w-Ri-SGf" secondAttribute="trailing" id="CAc-4p-aA8"/>
<constraint firstItem="Rgv-rN-aPB" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="Coj-Dk-uKG"/>
<constraint firstItem="d5w-Ri-SGf" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="lRB-4V-Jab"/>
<constraint firstItem="d5w-Ri-SGf" firstAttribute="height" secondItem="Rgv-rN-aPB" secondAttribute="height" id="pue-He-Yzl"/>
<constraint firstItem="d5w-Ri-SGf" firstAttribute="top" secondItem="Rgv-rN-aPB" secondAttribute="bottom" constant="1" id="rhC-fy-ULv"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="d5w-Ri-SGf" secondAttribute="bottom" id="rlo-WQ-cCs"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="Rgv-rN-aPB" secondAttribute="trailing" id="sLO-gb-E2H"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="radar1" destination="Rgv-rN-aPB" id="ZP5-iy-3Yk"/>
<outlet property="radar2" destination="d5w-Ri-SGf" id="tZ6-3R-3lR"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
26 changes: 0 additions & 26 deletions JYRadarChartDemo/Base.lproj/Main_iPad.storyboard

This file was deleted.

Loading