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

Bronze Custom View realizado #4

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
Binary file added .DS_Store
Binary file not shown.
Empty file modified CustomView.xcodeproj/project.pbxproj
100644 → 100755
Empty file.
Empty file.
Empty file.
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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>CustomView.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Empty file.
Empty file.
Empty file modified CustomView/AppDelegate.swift
100644 → 100755
Empty file.
Empty file modified CustomView/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file modified CustomView/Assets.xcassets/cicle.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CustomView/Assets.xcassets/cicle.imageset/cicle-1.pdf
100644 → 100755
Empty file.
Empty file modified CustomView/Assets.xcassets/cicleSelected.imageset/Contents.json
100644 → 100755
Empty file.
Empty file.
Empty file modified CustomView/Assets.xcassets/line.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified CustomView/Assets.xcassets/line.imageset/line-1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CustomView/Assets.xcassets/lineSelected.imageset/Contents.json
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified CustomView/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
62 changes: 59 additions & 3 deletions CustomView/Base.lproj/Main.storyboard
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,60 @@
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Y0j-bi-2ZE" customClass="ProgressCircleView" customModule="CustomView" customModuleProvider="target">
<rect key="frame" x="0.0" y="8" width="414" height="192"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6FM-9y-fxE" customClass="ProgressCircleView" customModule="CustomView" customModuleProvider="target">
<rect key="frame" x="49" y="24" width="316" height="145"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nbz-u0-Izo" customClass="ProgressCircleView" customModule="CustomView" customModuleProvider="target">
<rect key="frame" x="53" y="24" width="211" height="97"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="progressColor">
<color key="value" red="1" green="0.2527923882" blue="1" alpha="0.48747859589999998" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="progressValue">
<real key="value" value="0.25"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="targetValue">
<real key="value" value="0.75"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="circleWidth">
<real key="value" value="18"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="circleColor">
<color key="value" red="0.92143100499999997" green="0.92145264149999995" blue="0.92144101860000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="targetColor">
<color key="value" red="0.66422420739999999" green="0.66424006219999998" blue="0.66423153879999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="progressColor">
<color key="value" red="1" green="0.2527923882" blue="1" alpha="0.48747859589999998" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="progressValue">
<real key="value" value="0.25"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="targetValue">
<real key="value" value="0.75"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="circleWidth">
<real key="value" value="18"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="circleColor">
<color key="value" red="0.92143100499999997" green="0.92145264149999995" blue="0.92144101860000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="targetColor">
<color key="value" red="0.66422420739999999" green="0.66424006219999998" blue="0.66423153879999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="progressColor">
Expand All @@ -67,7 +121,7 @@
<real key="value" value="0.75"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="circleWidth">
<real key="value" value="30"/>
<real key="value" value="18"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="circleColor">
<color key="value" red="0.92143100499999997" green="0.92145264149999995" blue="0.92144101860000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -205,15 +259,17 @@
</tableView>
<tabBarItem key="tabBarItem" title="Circle" image="cicle" selectedImage="cicleSelected" id="gtV-i6-qP3"/>
<connections>
<outlet property="progressCircleView" destination="Y0j-bi-2ZE" id="RfR-EA-jIc"/>
<outlet property="progressCircleView" destination="Y0j-bi-2ZE" id="9Zx-Vs-xKl"/>
<outlet property="progressCircleView2" destination="6FM-9y-fxE" id="ICS-vR-PNt"/>
<outlet property="progressCircleView3" destination="nbz-u0-Izo" id="f8N-2J-wCI"/>
<outlet property="progressSlider" destination="LnG-Y8-C5N" id="F4D-Sf-vHY"/>
<outlet property="targetSlider" destination="g78-nB-pd6" id="B2x-1b-VAU"/>
<outlet property="widthSlider" destination="Q8n-NL-f4d" id="DmN-qb-ZFR"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="f7H-Sn-JKP" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="848" y="143"/>
<point key="canvasLocation" x="847.82608695652175" y="142.63392857142856"/>
</scene>
<!--Bar-->
<scene sceneID="5Hn-u6-Q9Z">
Expand Down
Empty file modified CustomView/Controllers/ProgressBarViewController.swift
100644 → 100755
Empty file.
17 changes: 17 additions & 0 deletions CustomView/Controllers/ProgressCircleViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import UIKit
class ProgressCircleViewController: UITableViewController {

@IBOutlet weak var progressCircleView: ProgressCircleView?
@IBOutlet weak var progressCircleView2: ProgressCircleView?
@IBOutlet weak var progressCircleView3: ProgressCircleView?

@IBOutlet weak var widthSlider: UISlider!
@IBOutlet weak var progressSlider: UISlider!
@IBOutlet weak var targetSlider: UISlider!
Expand All @@ -21,6 +24,14 @@ class ProgressCircleViewController: UITableViewController {
self.progressCircleView?.circleWidth = CGFloat(self.widthSlider.value)
self.progressCircleView?.progressValue = CGFloat(self.progressSlider.value)
self.progressCircleView?.targetValue = CGFloat(self.targetSlider.value)

self.progressCircleView2?.circleWidth = CGFloat(self.widthSlider.value)
self.progressCircleView2?.progressValue = CGFloat(self.progressSlider.value)
self.progressCircleView2?.targetValue = CGFloat(self.targetSlider.value)

self.progressCircleView3?.circleWidth = CGFloat(self.widthSlider.value)
self.progressCircleView3?.progressValue = CGFloat(self.progressSlider.value)
self.progressCircleView3?.targetValue = CGFloat(self.targetSlider.value)
}

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
Expand All @@ -31,14 +42,20 @@ class ProgressCircleViewController: UITableViewController {

@IBAction func widthChange(_ sender: Any) {
self.progressCircleView?.circleWidth = CGFloat(self.widthSlider.value)
self.progressCircleView2?.circleWidth = CGFloat(self.widthSlider.value)
self.progressCircleView3?.circleWidth = CGFloat(self.widthSlider.value)
}

@IBAction func progessChange(_ sender: Any) {
self.progressCircleView?.progressValue = CGFloat(self.progressSlider.value)
self.progressCircleView2?.progressValue = CGFloat(self.progressSlider.value)
self.progressCircleView3?.progressValue = CGFloat(self.progressSlider.value)
}

@IBAction func targetChange(_ sender: Any) {
self.progressCircleView?.targetValue = CGFloat(self.targetSlider.value)
self.progressCircleView2?.targetValue = CGFloat(self.targetSlider.value)
self.progressCircleView3?.targetValue = CGFloat(self.targetSlider.value)
}
}

Empty file modified CustomView/Info.plist
100644 → 100755
Empty file.
Empty file modified CustomView/Views/ProgressBarView.swift
100644 → 100755
Empty file.
Empty file modified CustomView/Views/ProgressCircleView.swift
100644 → 100755
Empty file.