Skip to content

Commit

Permalink
not sure if it's okay
Browse files Browse the repository at this point in the history
  • Loading branch information
Еугений authored and Еугений committed Dec 14, 2015
1 parent e9490ee commit 7b89306
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 13 deletions.
9 changes: 9 additions & 0 deletions ZDT-DownloadVideo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
56B060A41AD97085008FE9FB /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0620;
ORGANIZATIONNAME = "Sztanyi Szabolcs";
TargetAttributes = {
Expand Down Expand Up @@ -352,19 +353,25 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = "ZDT-DownloadVideo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.test;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
56B060CD1AD97085008FE9FB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = "ZDT-DownloadVideo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.test;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
Expand Down Expand Up @@ -421,6 +428,7 @@
56B060CD1AD97085008FE9FB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
56B060CE1AD97085008FE9FB /* Build configuration list for PBXNativeTarget "ZDT-DownloadVideoTests" */ = {
isa = XCConfigurationList;
Expand All @@ -429,6 +437,7 @@
56B060D01AD97085008FE9FB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B060AB1AD97085008FE9FB"
BuildableName = "ZDT-DownloadVideo.app"
BlueprintName = "ZDT-DownloadVideo"
ReferencedContainer = "container:ZDT-DownloadVideo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B060C01AD97085008FE9FB"
BuildableName = "ZDT-DownloadVideoTests.xctest"
BlueprintName = "ZDT-DownloadVideoTests"
ReferencedContainer = "container:ZDT-DownloadVideo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B060AB1AD97085008FE9FB"
BuildableName = "ZDT-DownloadVideo.app"
BlueprintName = "ZDT-DownloadVideo"
ReferencedContainer = "container:ZDT-DownloadVideo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B060AB1AD97085008FE9FB"
BuildableName = "ZDT-DownloadVideo.app"
BlueprintName = "ZDT-DownloadVideo"
ReferencedContainer = "container:ZDT-DownloadVideo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "56B060AB1AD97085008FE9FB"
BuildableName = "ZDT-DownloadVideo.app"
BlueprintName = "ZDT-DownloadVideo"
ReferencedContainer = "container:ZDT-DownloadVideo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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>SchemeUserState</key>
<dict>
<key>ZDT-DownloadVideo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>56B060AB1AD97085008FE9FB</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>56B060C01AD97085008FE9FB</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
14 changes: 7 additions & 7 deletions ZDT-DownloadVideo/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14D131" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<scenes>
<!--View Controller-->
Expand All @@ -18,6 +19,7 @@
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JZZ-0v-mhd" customClass="DownloadButton" customModule="ZDT_DownloadVideo" customModuleProvider="target">
<rect key="frame" x="60" y="498" width="200" height="50"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="50" id="BAj-bN-9He"/>
<constraint firstAttribute="width" constant="200" id="wrK-Ns-uk1"/>
Expand All @@ -32,6 +34,7 @@
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KRs-ie-EPh" customClass="ProgressView" customModule="ZDT_DownloadVideo" customModuleProvider="target">
<rect key="frame" x="35" y="60" width="250" height="250"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="250" id="NM6-r3-Hug"/>
Expand All @@ -40,6 +43,7 @@
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Status label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="usA-35-OxI">
<rect key="frame" x="35" y="325" width="250" height="30"/>
<animations/>
<constraints>
<constraint firstAttribute="height" constant="30" id="GET-El-SgT"/>
</constraints>
Expand All @@ -48,6 +52,7 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="usA-35-OxI" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" constant="35" id="93J-ah-nwj"/>
Expand All @@ -72,9 +77,4 @@
<point key="canvasLocation" x="-861" y="334"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
2 changes: 1 addition & 1 deletion ZDT-DownloadVideo/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.Zappdesigntemplates.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
22 changes: 17 additions & 5 deletions ZDT-DownloadVideo/ProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ProgressView: UIView {
private var dashedLayer: CAShapeLayer = CAShapeLayer()

required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
super.init(coder: aDecoder)!
setupView()
}

Expand All @@ -41,7 +41,13 @@ class ProgressView: UIView {
progressLabel.textAlignment = .Center
progressLabel.text = "0 %"
progressLabel.font = UIFont(name: "HelveticaNeue-UltraLight", size: 40.0)
progressLabel.setTranslatesAutoresizingMaskIntoConstraints(false)

if #available(iOS 9, *) {
progressLabel.translatesAutoresizingMaskIntoConstraints = false
} else {
// progressLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
}

addSubview(progressLabel)
// add constraints
addConstraint(NSLayoutConstraint(item: self, attribute: .CenterX, relatedBy: .Equal, toItem: progressLabel, attribute: .CenterX, multiplier: 1.0, constant: 0.0))
Expand All @@ -53,7 +59,13 @@ class ProgressView: UIView {
sizeProgressLabel.textAlignment = .Center
sizeProgressLabel.text = "0.0 MB / 0.0 MB"
sizeProgressLabel.font = UIFont(name: "HelveticaNeue-Light", size: 10.0)
sizeProgressLabel.setTranslatesAutoresizingMaskIntoConstraints(false)

if #available(iOS 9, *) {
sizeProgressLabel.translatesAutoresizingMaskIntoConstraints = false
} else {
// sizeProgressLabel.setTranslatesAutoresizingMaskIntoConstraints(false)
}

addSubview(sizeProgressLabel)
// add constraints
addConstraint(NSLayoutConstraint(item: self, attribute: .CenterX, relatedBy: .Equal, toItem: sizeProgressLabel, attribute: .CenterX, multiplier: 1.0, constant: 0.0))
Expand All @@ -74,7 +86,7 @@ class ProgressView: UIView {
progressLayer.strokeEnd = 0.0
layer.addSublayer(progressLayer)

var dashedLayer = CAShapeLayer()
let dashedLayer = CAShapeLayer()
dashedLayer.strokeColor = UIColor(white: 1.0, alpha: 0.5).CGColor
dashedLayer.fillColor = nil
dashedLayer.lineDashPattern = [2, 4]
Expand Down Expand Up @@ -111,7 +123,7 @@ class ProgressView: UIView {
progressLayer.removeAllAnimations()
}

override func animationDidStop(anim: CAAnimation!, finished flag: Bool) {
override func animationDidStop(anim: CAAnimation, finished flag: Bool) {
hideProgressView()
}
}

0 comments on commit 7b89306

Please sign in to comment.