Skip to content

Commit

Permalink
Prepared UI
Browse files Browse the repository at this point in the history
jernejstrasner committed Nov 4, 2013
1 parent 472a792 commit f00bb63
Showing 6 changed files with 104 additions and 7 deletions.
14 changes: 14 additions & 0 deletions SmoothGradient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
B8688515182757B50004B837 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B86884F7182757B40004B837 /* UIKit.framework */; };
B868851D182757B50004B837 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B868851B182757B50004B837 /* InfoPlist.strings */; };
B868851F182757B50004B837 /* SmoothGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B868851E182757B50004B837 /* SmoothGradientTests.m */; };
B868852A182757DF0004B837 /* JSTGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = B8688529182757DF0004B837 /* JSTGradientView.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -53,6 +54,8 @@
B868851A182757B50004B837 /* SmoothGradientTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SmoothGradientTests-Info.plist"; sourceTree = "<group>"; };
B868851C182757B50004B837 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B868851E182757B50004B837 /* SmoothGradientTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SmoothGradientTests.m; sourceTree = "<group>"; };
B8688528182757DF0004B837 /* JSTGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTGradientView.h; sourceTree = "<group>"; };
B8688529182757DF0004B837 /* JSTGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JSTGradientView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -117,6 +120,7 @@
B8688505182757B40004B837 /* Main.storyboard */,
B8688508182757B40004B837 /* JSTViewController.h */,
B8688509182757B40004B837 /* JSTViewController.m */,
B868852B182757E40004B837 /* Views */,
B868850B182757B40004B837 /* Images.xcassets */,
B86884FA182757B40004B837 /* Supporting Files */,
);
@@ -152,6 +156,15 @@
name = "Supporting Files";
sourceTree = "<group>";
};
B868852B182757E40004B837 /* Views */ = {
isa = PBXGroup;
children = (
B8688528182757DF0004B837 /* JSTGradientView.h */,
B8688529182757DF0004B837 /* JSTGradientView.m */,
);
name = Views;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
@@ -252,6 +265,7 @@
files = (
B868850A182757B40004B837 /* JSTViewController.m in Sources */,
B8688504182757B40004B837 /* JSTAppDelegate.m in Sources */,
B868852A182757DF0004B837 /* JSTGradientView.m in Sources */,
B8688500182757B40004B837 /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
48 changes: 41 additions & 7 deletions SmoothGradient/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,21 +1,55 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="PT5-y6-YdV">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3746"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="ufC-wZ-h7g">
<!--Navigation Controller-->
<scene sceneID="J8g-tc-2B0">
<objects>
<viewController id="vXZ-lx-hvc" customClass="JSTViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<navigationController definesPresentationContext="YES" id="PT5-y6-YdV" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="wY5-TG-lJn">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="jAs-ix-hgd" kind="relationship" relationship="rootViewController" id="8gj-63-qYF"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="yXX-ox-IZ2" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-328" y="102"/>
</scene>
<!--View Controller-->
<scene sceneID="OSS-hs-tPx">
<objects>
<viewController id="jAs-ix-hgd" customClass="JSTViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Zn9-Wg-Duy"/>
<viewControllerLayoutGuide type="bottom" id="NUo-el-9Sz"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="d4d-5p-x2B" customClass="JSTGradientView">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<navigationItem key="navigationItem" id="39M-QE-wSc">
<nil key="title"/>
<segmentedControl key="titleView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" id="1W4-Ja-TMO">
<rect key="frame" x="96" y="7" width="128" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Normal"/>
<segment title="Smooth"/>
</segments>
<connections>
<action selector="switchMode:" destination="jAs-ix-hgd" eventType="valueChanged" id="1JC-EN-525"/>
</connections>
</segmentedControl>
</navigationItem>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="g7c-fJ-Nvs" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="87" y="102"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
15 changes: 15 additions & 0 deletions SmoothGradient/JSTGradientView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// JSTGradientView.h
// SmoothGradient
//
// Created by Jernej Strasner on 11/3/13.
// Copyright (c) 2013 Jernej Strasner. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface JSTGradientView : UIView

- (void)redrawSmooth:(BOOL)smooth;

@end
26 changes: 26 additions & 0 deletions SmoothGradient/JSTGradientView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// JSTGradientView.m
// SmoothGradient
//
// Created by Jernej Strasner on 11/3/13.
// Copyright (c) 2013 Jernej Strasner. All rights reserved.
//

#import "JSTGradientView.h"

@implementation JSTGradientView {
BOOL _smooth;
}

- (void)redrawSmooth:(BOOL)smooth
{
_smooth = smooth;
[self setNeedsDisplay];
}

- (void)drawRect:(CGRect)rect
{

}

@end
2 changes: 2 additions & 0 deletions SmoothGradient/JSTViewController.h
Original file line number Diff line number Diff line change
@@ -10,4 +10,6 @@

@interface JSTViewController : UIViewController

- (IBAction)switchMode:(UISegmentedControl *)sender;

@end
6 changes: 6 additions & 0 deletions SmoothGradient/JSTViewController.m
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
//

#import "JSTViewController.h"
#import "JSTGradientView.h"

@interface JSTViewController ()

@@ -26,4 +27,9 @@ - (void)didReceiveMemoryWarning
// Dispose of any resources that can be recreated.
}

- (IBAction)switchMode:(UISegmentedControl *)sender
{
[(JSTGradientView *)self.view redrawSmooth:sender.selectedSegmentIndex];
}

@end

0 comments on commit f00bb63

Please sign in to comment.