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

Fixed layout issues. #3

Open
wants to merge 1 commit 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
86 changes: 78 additions & 8 deletions TWRProgressViewDemo/ProgressView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
155E750D187E048E00AFCD05 /* ProgressViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 155E750C187E048E00AFCD05 /* ProgressViewTests.m */; };
155E7518187E049800AFCD05 /* TWRProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 155E7517187E049800AFCD05 /* TWRProgressView.m */; };
155E751A187E278700AFCD05 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 155E7519187E278700AFCD05 /* QuartzCore.framework */; };
64A0073F1AC03842005C067C /* TWRExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 64A0073E1AC03842005C067C /* TWRExampleView.m */; };
64A007461AC03884005C067C /* TWRExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 64A007451AC03884005C067C /* TWRExampleViewController.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -58,6 +60,10 @@
155E7516187E049800AFCD05 /* TWRProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWRProgressView.h; sourceTree = "<group>"; };
155E7517187E049800AFCD05 /* TWRProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWRProgressView.m; sourceTree = "<group>"; };
155E7519187E278700AFCD05 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
64A0073D1AC03842005C067C /* TWRExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWRExampleView.h; sourceTree = "<group>"; };
64A0073E1AC03842005C067C /* TWRExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWRExampleView.m; sourceTree = "<group>"; };
64A007441AC03884005C067C /* TWRExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWRExampleViewController.h; sourceTree = "<group>"; };
64A007451AC03884005C067C /* TWRExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWRExampleViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -119,14 +125,9 @@
155E74E7187E048E00AFCD05 /* ProgressView */ = {
isa = PBXGroup;
children = (
155E74F0187E048E00AFCD05 /* TWRAppDelegate.h */,
155E74F1187E048E00AFCD05 /* TWRAppDelegate.m */,
155E74F3187E048E00AFCD05 /* Main.storyboard */,
155E74F6187E048E00AFCD05 /* TWRViewController.h */,
155E74F7187E048E00AFCD05 /* TWRViewController.m */,
155E7516187E049800AFCD05 /* TWRProgressView.h */,
155E7517187E049800AFCD05 /* TWRProgressView.m */,
155E74F9187E048E00AFCD05 /* Images.xcassets */,
64A0073B1AC0369F005C067C /* ProgressView */,
64A0073A1AC03681005C067C /* Example */,
64A0073C1AC036AD005C067C /* Resources */,
155E74E8187E048E00AFCD05 /* Supporting Files */,
);
path = ProgressView;
Expand Down Expand Up @@ -161,6 +162,71 @@
name = "Supporting Files";
sourceTree = "<group>";
};
64A0073A1AC03681005C067C /* Example */ = {
isa = PBXGroup;
children = (
155E74F0187E048E00AFCD05 /* TWRAppDelegate.h */,
155E74F1187E048E00AFCD05 /* TWRAppDelegate.m */,
155E74F3187E048E00AFCD05 /* Main.storyboard */,
64A007411AC0384C005C067C /* Controllers */,
);
name = Example;
sourceTree = "<group>";
};
64A0073B1AC0369F005C067C /* ProgressView */ = {
isa = PBXGroup;
children = (
155E7516187E049800AFCD05 /* TWRProgressView.h */,
155E7517187E049800AFCD05 /* TWRProgressView.m */,
);
name = ProgressView;
sourceTree = "<group>";
};
64A0073C1AC036AD005C067C /* Resources */ = {
isa = PBXGroup;
children = (
155E74F9187E048E00AFCD05 /* Images.xcassets */,
);
name = Resources;
sourceTree = "<group>";
};
64A007401AC03846005C067C /* Views */ = {
isa = PBXGroup;
children = (
64A0073D1AC03842005C067C /* TWRExampleView.h */,
64A0073E1AC03842005C067C /* TWRExampleView.m */,
);
name = Views;
sourceTree = "<group>";
};
64A007411AC0384C005C067C /* Controllers */ = {
isa = PBXGroup;
children = (
64A007431AC0385F005C067C /* StoryboardViewController */,
64A007421AC03852005C067C /* CodeViewController */,
);
name = Controllers;
sourceTree = "<group>";
};
64A007421AC03852005C067C /* CodeViewController */ = {
isa = PBXGroup;
children = (
64A007401AC03846005C067C /* Views */,
64A007441AC03884005C067C /* TWRExampleViewController.h */,
64A007451AC03884005C067C /* TWRExampleViewController.m */,
);
name = CodeViewController;
sourceTree = "<group>";
};
64A007431AC0385F005C067C /* StoryboardViewController */ = {
isa = PBXGroup;
children = (
155E74F6187E048E00AFCD05 /* TWRViewController.h */,
155E74F7187E048E00AFCD05 /* TWRViewController.m */,
);
name = StoryboardViewController;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -260,6 +326,8 @@
buildActionMask = 2147483647;
files = (
155E74F8187E048E00AFCD05 /* TWRViewController.m in Sources */,
64A007461AC03884005C067C /* TWRExampleViewController.m in Sources */,
64A0073F1AC03842005C067C /* TWRExampleView.m in Sources */,
155E7518187E049800AFCD05 /* TWRProgressView.m in Sources */,
155E74F2187E048E00AFCD05 /* TWRAppDelegate.m in Sources */,
155E74EE187E048E00AFCD05 /* main.m in Sources */,
Expand Down Expand Up @@ -471,6 +539,7 @@
155E7512187E048E00AFCD05 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
155E7513187E048E00AFCD05 /* Build configuration list for PBXNativeTarget "ProgressViewTests" */ = {
isa = XCConfigurationList;
Expand All @@ -479,6 +548,7 @@
155E7515187E048E00AFCD05 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
70 changes: 45 additions & 25 deletions TWRProgressViewDemo/ProgressView/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" 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="6751" systemVersion="14C1514" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="TWRViewController" sceneMemberID="viewController">
<viewController storyboardIdentifier="TWRMainStoryboard" id="vXZ-lx-hvc" customClass="TWRViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="c6k-DY-kze"/>
<viewControllerLayoutGuide type="bottom" id="Pbf-xd-nl4"/>
Expand All @@ -17,46 +18,65 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="416-YQ-gAc" customClass="TWRProgressView">
<rect key="frame" x="85" y="283" width="150" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<rect key="frame" x="85" y="227" width="150" height="150"/>
<color key="backgroundColor" white="0.75" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="HXp-vB-UEH"/>
<constraint firstAttribute="width" constant="150" id="vgX-xU-59B"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5lP-ah-ayZ">
<rect key="frame" x="126" y="457" width="69" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5lP-ah-ayZ">
<rect key="frame" x="126" y="385" width="69" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="MhE-3H-Mcm"/>
</constraints>
<state key="normal" title="Increment">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="increment:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="yQd-KH-aDz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VdE-2g-N3e">
<rect key="frame" x="123" y="500" width="75" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0tZ-j6-GZx" customClass="TWRProgressView">
<rect key="frame" x="85" y="28" width="150" height="150"/>
<color key="backgroundColor" white="0.75" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="150" id="ZfF-4M-iWA"/>
<constraint firstAttribute="width" constant="150" id="a0f-89-VEN"/>
</constraints>
</view>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="0rI-3F-Jug">
<rect key="frame" x="18" y="186" width="284" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="33" id="WtM-07-o7z"/>
<constraint firstAttribute="width" constant="280" id="mnj-Y2-R40"/>
</constraints>
</slider>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VdE-2g-N3e">
<rect key="frame" x="123" y="423" width="75" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="KH7-zb-Qx0"/>
</constraints>
<state key="normal" title="Decrement">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="decrement:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="cYX-rI-V0A"/>
</connections>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0tZ-j6-GZx" customClass="TWRProgressView">
<rect key="frame" x="85" y="55" width="150" height="150"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.75" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<slider opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="0rI-3F-Jug">
<rect key="frame" x="18" y="213" width="284" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</slider>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="416-YQ-gAc" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="85" id="9UZ-51-MXo"/>
<constraint firstAttribute="bottom" secondItem="416-YQ-gAc" secondAttribute="bottom" constant="135" id="SgL-gY-DuL"/>
<constraint firstAttribute="trailing" secondItem="416-YQ-gAc" secondAttribute="trailing" constant="85" id="X09-ai-G3L"/>
<constraint firstItem="416-YQ-gAc" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" constant="283" id="Z7r-Fw-u1n"/>
<constraint firstItem="VdE-2g-N3e" firstAttribute="top" secondItem="5lP-ah-ayZ" secondAttribute="bottom" constant="8" id="1C9-py-9TA"/>
<constraint firstItem="0tZ-j6-GZx" firstAttribute="top" secondItem="c6k-DY-kze" secondAttribute="bottom" constant="8" id="CJC-1J-5v0"/>
<constraint firstAttribute="centerX" secondItem="416-YQ-gAc" secondAttribute="centerX" id="Hmp-QJ-QpD"/>
<constraint firstAttribute="centerX" secondItem="0tZ-j6-GZx" secondAttribute="centerX" id="KFq-va-Dsy"/>
<constraint firstAttribute="centerX" secondItem="VdE-2g-N3e" secondAttribute="centerX" id="OAO-cm-n2m"/>
<constraint firstItem="5lP-ah-ayZ" firstAttribute="top" secondItem="416-YQ-gAc" secondAttribute="bottom" constant="8" id="Obd-c1-CLa"/>
<constraint firstItem="0rI-3F-Jug" firstAttribute="top" secondItem="0tZ-j6-GZx" secondAttribute="bottom" constant="8" id="XPz-F9-7Yo"/>
<constraint firstAttribute="centerX" secondItem="5lP-ah-ayZ" secondAttribute="centerX" id="XWT-9P-38o"/>
<constraint firstItem="416-YQ-gAc" firstAttribute="top" secondItem="0rI-3F-Jug" secondAttribute="bottom" constant="8" id="ijM-FS-Pcq"/>
<constraint firstAttribute="centerX" secondItem="0rI-3F-Jug" secondAttribute="centerX" id="lRn-Vn-swe"/>
</constraints>
</view>
<connections>
Expand All @@ -75,4 +95,4 @@
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
Expand Down
3 changes: 1 addition & 2 deletions TWRProgressViewDemo/ProgressView/ProgressView-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand All @@ -35,6 +33,7 @@
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
20 changes: 17 additions & 3 deletions TWRProgressViewDemo/ProgressView/TWRAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@
//

#import "TWRAppDelegate.h"
#import "TWRExampleViewController.h"

@implementation TWRAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// create the window
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window setBackgroundColor:[UIColor whiteColor]];
[self.window makeKeyAndVisible];

// set root controllers
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *storyboardViewController = [storyboard instantiateViewControllerWithIdentifier:@"TWRMainStoryboard"];
UIViewController *codeViewController = [[TWRExampleViewController alloc] init];

UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:@[storyboardViewController, codeViewController]];
[self.window setRootViewController:tabBarController];

// finish launching
return YES;
}

Expand Down
16 changes: 16 additions & 0 deletions TWRProgressViewDemo/ProgressView/TWRExampleView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// TWRExampleView.h
// ProgressView
//
// Created by Natalia Osiecka on 23.3.2015.
// Copyright (c) 2015 Touchware. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TWRProgressView.h"

@interface TWRExampleView : UIView

@property (nonatomic, readonly) TWRProgressView *progressView;

@end
Loading