Skip to content
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
12 changes: 6 additions & 6 deletions TaskZero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
3624CCCD255A4ED200930DB3 /* FirstVC */ = {
3624CCCD255A4ED200930DB3 /* CollectionViewController */ = {
isa = PBXGroup;
children = (
369C40D625598B420026ACBB /* ViewController.swift */,
3662E0C32559947800561FE7 /* MainCollectionViewCell.swift */,
);
path = FirstVC;
path = CollectionViewController;
sourceTree = "<group>";
};
3624CCD9255A5A7E00930DB3 /* Storyboards */ = {
Expand All @@ -118,19 +118,19 @@
3624CCDA255A5A9B00930DB3 /* View Controllers */ = {
isa = PBXGroup;
children = (
3624CCCD255A4ED200930DB3 /* FirstVC */,
3624CCDB255A5AA500930DB3 /* SecondVC */,
3624CCCD255A4ED200930DB3 /* CollectionViewController */,
3624CCDB255A5AA500930DB3 /* DetailExpandedViewController */,
);
path = "View Controllers";
sourceTree = "<group>";
};
3624CCDB255A5AA500930DB3 /* SecondVC */ = {
3624CCDB255A5AA500930DB3 /* DetailExpandedViewController */ = {
isa = PBXGroup;
children = (
3662E0C925599C1A00561FE7 /* DetailExpandedVC.swift */,
3624CCD1255A552300930DB3 /* BlankDetailCollectionViewCell.swift */,
);
path = SecondVC;
path = DetailExpandedViewController;
sourceTree = "<group>";
};
369C40C625598B420026ACBB = {
Expand Down
2 changes: 0 additions & 2 deletions TaskZero/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.302",
"green" : "0.914",
"red" : "0.980"
"blue" : "1.000",
"green" : "0.515",
"red" : "0.845"
}
},
"idiom" : "universal"
Expand All @@ -23,9 +23,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.302",
"green" : "0.914",
"red" : "0.980"
"blue" : "1.000",
"green" : "0.515",
"red" : "0.845"
}
},
"idiom" : "universal"
Expand All @@ -34,5 +34,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
6 changes: 6 additions & 0 deletions TaskZero/Assets.xcassets/Placeholder Pictures/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
1 change: 0 additions & 1 deletion TaskZero/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?


func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
Expand Down
19 changes: 5 additions & 14 deletions TaskZero/Storyboards/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,9 @@
<collectionViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="lRv-UR-mDJ">
<rect key="frame" x="0.0" y="0.0" width="297" height="450"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wkT-7x-Gdr">
<rect key="frame" x="0.0" y="0.0" width="297" height="450"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</collectionViewCellContentView>
<size key="customSize" width="297" height="450"/>
<connections>
<outlet property="imageVieww" destination="wkT-7x-Gdr" id="klE-hg-D3F"/>
</connections>
</collectionViewCell>
</cells>
<collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" id="zH1-7y-TnG">
Expand Down Expand Up @@ -198,8 +189,8 @@
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wx1-FF-Osf">
<rect key="frame" x="324" y="790" width="45" height="45"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" name="YellowColor"/>
<color key="tintColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" name="LavenderColor"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" image="close"/>
</button>
</subviews>
Expand Down Expand Up @@ -433,12 +424,12 @@
<namedColor name="GreenColor">
<color red="0.51800000667572021" green="0.85100001096725464" blue="0.22699999809265137" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="LavenderColor">
<color red="0.84465640779999995" green="0.51457053419999998" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="OrangeColor">
<color red="0.9570000171661377" green="0.43500000238418579" blue="0.10999999940395355" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="YellowColor">
<color red="0.98000001907348633" green="0.91399997472763062" blue="0.30199998617172241" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class MainCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageVieww: UIImageView!
@IBOutlet weak var greenButton: UIButton!

//MARK:- Events

//MARK:- Tap animamtion on Cell
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
animate(isHighlighted: true)
Expand All @@ -28,6 +29,7 @@ class MainCollectionViewCell: UICollectionViewCell {
animate(isHighlighted: false)
}


//MARK:- Private functions
private func animate(isHighlighted: Bool, completion: ((Bool) -> Void)?=nil) {
let animationOptions: UIView.AnimationOptions = [.allowUserInteraction]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import Hero // To implement app store like transition animation

class ViewController: UIViewController,UICollectionViewDataSource,UICollectionViewDelegate {

var imgArr = ["one","two","three"]
var imgArr = ["one","two","three"] // images for collection view

@IBOutlet weak var bgView: UIView!


//MARK:- Setup CollectionView
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 3
}
Expand All @@ -35,14 +39,13 @@ class ViewController: UIViewController,UICollectionViewDataSource,UICollectionVi
let DetailExpandedVC = self.storyboard!.instantiateViewController(withIdentifier: "DetailExpandedVC") as! DetailExpandedVC
self.present(DetailExpandedVC, animated: true, completion: nil)
}
else {
print("Dead end.")
}
}


@IBOutlet weak var bgView: UIView!

override func viewDidLoad() {
super.viewDidLoad()
bgView.layer.cornerRadius = 15
// set default theme to light only
UIApplication.shared.windows.forEach { window in
window.overrideUserInterfaceStyle = .light
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import UIKit

class BlankDetailCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var imageVieww: UIImageView!
//MARK:- Events


//MARK:- Tap animamtion on Cell
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
animate(isHighlighted: true)
Expand All @@ -25,6 +26,7 @@ class BlankDetailCollectionViewCell: UICollectionViewCell {
animate(isHighlighted: false)
}


//MARK:- Private functions
private func animate(isHighlighted: Bool, completion: ((Bool) -> Void)?=nil) {
let animationOptions: UIView.AnimationOptions = [.allowUserInteraction]
Expand Down
Loading