Skip to content

Commit

Permalink
added autolayout feature
Browse files Browse the repository at this point in the history
  • Loading branch information
aslanyanhaik committed May 31, 2017
1 parent 4a06d9c commit a99278c
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 11 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hqdefault.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "hqdefault-2.jpg",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions YouTube/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -874,14 +874,14 @@
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="TrendingCell" rowHeight="70" id="1iC-uN-9lf">
<rect key="frame" x="0.0" y="28" width="375" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" ambiguous="YES" tableViewCell="1iC-uN-9lf" id="hh4-Lu-bnZ">
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="1iC-uN-9lf" id="hh4-Lu-bnZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="gMi-1g-UGz">
<stackView opaque="NO" contentMode="scaleToFill" spacing="40" translatesAutoresizingMaskIntoConstraints="NO" id="gMi-1g-UGz">
<rect key="frame" x="14" y="11" width="347" height="32"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kaJ-mX-vFW">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kaJ-mX-vFW">
<rect key="frame" x="0.0" y="0.0" width="89" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="Fnz-yZ-Dqb"/>
Expand All @@ -891,7 +891,7 @@
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bNE-1j-rf9">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bNE-1j-rf9">
<rect key="frame" x="129" y="0.0" width="89" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="e9U-aD-zuh"/>
Expand All @@ -901,7 +901,7 @@
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" ambiguous="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eWM-gt-BjB">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eWM-gt-BjB">
<rect key="frame" x="258" y="0.0" width="89" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="Rbc-l6-WWa"/>
Expand Down
12 changes: 6 additions & 6 deletions YouTube/Model/Video.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class Video {

//MARK: Methods
class func fetchVideos(completion: @escaping (([Video]) -> Void)) {
let video1 = Video.init(title: "What Does Jared Kushner Believe?", channelName: "Nerdwriter1")
let video2 = Video.init(title: "Moore's Law Is Ending... So, What's Next?", channelName: "Seeker")
let video1 = Video.init(title: "What Does Jared Kushner Believe", channelName: "Nerdwriter1")
let video2 = Video.init(title: "Moore's Law Is Ending. So, What's Next", channelName: "Seeker")
let video3 = Video.init(title: "What Bill Gates is afraid of", channelName: "Vox")
let video4 = Video.init(title: "Why Can't America Have a Grown-Up Healthcare Conversation?", channelName: "vlogbrothers")
let video4 = Video.init(title: "Why Can't America Have a Grown-Up Healthcare Conversation", channelName: "vlogbrothers")
let video5 = Video.init(title: "A New History for Humanity – The Human Era", channelName: "Kurzgesagt – In a Nutshell")
let video6 = Video.init(title: "Neural Network that Changes Everything - Computerphile", channelName: "Computerphile")
let video7 = Video.init(title: "TensorFlow Basics - Deep Learning with Neural Networks p. 2", channelName: "sentdex")
Expand All @@ -65,10 +65,10 @@ class Video {
class func fetchVideo(completion: @escaping ((Video) -> Void)) {
let video = Video.init(title: "Big Buck Bunny", channelName: "Blender Foundation")
video.videoLink = URL.init(string: "http://sample-videos.com/video/mp4/360/big_buck_bunny_360p_10mb.mp4")!
let suggestedVideo1 = SuggestedVideo.init(title: "What Does Jared Kushner Believe?", channelName: "Nerdwriter1")
let suggestedVideo2 = SuggestedVideo.init(title: "Moore's Law Is Ending... So, What's Next?", channelName: "Seeker")
let suggestedVideo1 = SuggestedVideo.init(title: "What Does Jared Kushner Believe", channelName: "Nerdwriter1")
let suggestedVideo2 = SuggestedVideo.init(title: "Moore's Law Is Ending. So, What's Next", channelName: "Seeker")
let suggestedVideo3 = SuggestedVideo.init(title: "What Bill Gates is afraid of", channelName: "Vox")
let suggestedVideo4 = SuggestedVideo.init(title: "Why Can't America Have a Grown-Up Healthcare Conversation?", channelName: "vlogbrothers")
let suggestedVideo4 = SuggestedVideo.init(title: "Why Can't America Have a Grown-Up Healthcare Conversation", channelName: "vlogbrothers")
let suggestedVideo5 = SuggestedVideo.init(title: "TensorFlow Basics - Deep Learning with Neural Networks p. 2", channelName: "sentdex")
let items = [suggestedVideo1, suggestedVideo2, suggestedVideo3, suggestedVideo4, suggestedVideo5]
video.suggestedVideos = items
Expand Down

0 comments on commit a99278c

Please sign in to comment.