Skip to content

Commit

Permalink
Remove prefix and getrid warnning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambas Mac Air committed Aug 19, 2015
1 parent e728ed7 commit c1c8924
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 61 deletions.
22 changes: 8 additions & 14 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
F5217F5A1A89F25500A3D0ED /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F5217F591A89F25500A3D0ED /* Images.xcassets */; };
F5217F5D1A89F25500A3D0ED /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5217F5B1A89F25500A3D0ED /* LaunchScreen.xib */; };
F5217F691A89F25500A3D0ED /* DemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5217F681A89F25500A3D0ED /* DemoTests.swift */; };
F595E47E1B1E064F00DC7CC0 /* ExpandableViewTransition.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F595E47D1B1E064F00DC7CC0 /* ExpandableViewTransition.framework */; };
F5CD1F691A8A029200F6C1C4 /* MovieCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F671A8A029200F6C1C4 /* MovieCell.swift */; };
F5CD1F6A1A8A029200F6C1C4 /* MovieCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5CD1F681A8A029200F6C1C4 /* MovieCell.xib */; };
F5CD1F7E1A8A18D400F6C1C4 /* MovieDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F7D1A8A18D400F6C1C4 /* MovieDetail.swift */; };
Expand Down Expand Up @@ -54,7 +53,6 @@
F5217F621A89F25500A3D0ED /* DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F5217F671A89F25500A3D0ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F5217F681A89F25500A3D0ED /* DemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTests.swift; sourceTree = "<group>"; };
F595E47D1B1E064F00DC7CC0 /* ExpandableViewTransition.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExpandableViewTransition.framework; path = "../build/Debug-iphoneos/ExpandableViewTransition.framework"; sourceTree = "<group>"; };
F5CD1F671A8A029200F6C1C4 /* MovieCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MovieCell.swift; sourceTree = "<group>"; };
F5CD1F681A8A029200F6C1C4 /* MovieCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MovieCell.xib; sourceTree = "<group>"; };
F5CD1F7D1A8A18D400F6C1C4 /* MovieDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MovieDetail.swift; sourceTree = "<group>"; };
Expand All @@ -66,7 +64,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F595E47E1B1E064F00DC7CC0 /* ExpandableViewTransition.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -83,7 +80,6 @@
F5217F441A89F25500A3D0ED = {
isa = PBXGroup;
children = (
F595E47D1B1E064F00DC7CC0 /* ExpandableViewTransition.framework */,
F5217F4F1A89F25500A3D0ED /* Demo */,
F5217F651A89F25500A3D0ED /* DemoTests */,
F5217F4E1A89F25500A3D0ED /* Products */,
Expand Down Expand Up @@ -372,13 +368,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/ExpanableViewTransition-dbppedtocxzbwgdzxhbqzaqbauud/Build/Products/Debug-iphoneos",
"/Users/ambaschobsanti/Desktop/AM/ExpandableTransition/build/Debug-iphoneos",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Demo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -387,13 +382,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/ExpanableViewTransition-dbppedtocxzbwgdzxhbqzaqbauud/Build/Products/Debug-iphoneos",
"/Users/ambaschobsanti/Desktop/AM/ExpandableTransition/build/Debug-iphoneos",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Demo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion Demo/Demo/MovieCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MovieCell: UICollectionViewCell {
}
}

extension MovieCell: CESnapShotViewProtocol {
extension MovieCell: SnapShotViewProtocol {

func snapShotForTransition() -> UIView {
let snapShotCell = UINib(nibName: MovieNibName, bundle: nil).instantiateWithOwner(self, options: nil).first as! MovieCell
Expand Down
2 changes: 1 addition & 1 deletion Demo/Demo/MovieDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MovieDetail: UITableViewController {
}
}

extension MovieDetail: CEDestinationViewControllerProtocol {
extension MovieDetail: DestinationViewControllerProtocol {

func snapShotWillTransition(snapShot: UIView) {
println("will transition")
Expand Down
6 changes: 3 additions & 3 deletions Demo/Demo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ExpandableViewTransition

class ViewController: UICollectionViewController {

let holder = CENavigationControllerDelegate(isHideExpandedView: false)
let holder = NavigationControllerDelegate(isHideExpandedView: false)
var indexPathSelected: NSIndexPath?

override func viewDidLoad() {
Expand Down Expand Up @@ -58,13 +58,13 @@ extension ViewController: UICollectionViewDelegate {
}
}

extension ViewController: CEBaseViewControllerProtocol {
extension ViewController: BaseViewControllerProtocol {

func transitionCollectionView() -> UICollectionView {
return self.collectionView!
}

func viewToExpand() -> CESnapShotViewProtocol {
func viewToExpand() -> SnapShotViewProtocol {
var cell = self.collectionView?.cellForItemAtIndexPath(self.indexPathSelected!) as! MovieCell

return cell
Expand Down
32 changes: 16 additions & 16 deletions ExpandableViewTransition.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
F5217F2C1A89F14000A3D0ED /* ExpandableViewTransition.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5217F201A89F14000A3D0ED /* ExpandableViewTransition.framework */; };
F5217F331A89F14000A3D0ED /* ExpandableViewTransitionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5217F321A89F14000A3D0ED /* ExpandableViewTransitionTests.swift */; };
F5CD1F701A8A0A1100F6C1C4 /* ExpandableViewTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CD1F6F1A8A0A1100F6C1C4 /* ExpandableViewTransition.h */; settings = {ATTRIBUTES = (Public, ); }; };
F5CD1F791A8A11C900F6C1C4 /* CENavigationControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F751A8A11C900F6C1C4 /* CENavigationControllerDelegate.swift */; };
F5CD1F7A1A8A11C900F6C1C4 /* CETransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F761A8A11C900F6C1C4 /* CETransition.swift */; };
F5CD1F7B1A8A11C900F6C1C4 /* CETransitionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F771A8A11C900F6C1C4 /* CETransitionProtocol.swift */; };
F5F28FDA1A8B53D2000DA3DA /* UIView+CEExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5F28FD91A8B53D2000DA3DA /* UIView+CEExtension.swift */; };
F5CD1F791A8A11C900F6C1C4 /* NavigationControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F751A8A11C900F6C1C4 /* NavigationControllerDelegate.swift */; };
F5CD1F7A1A8A11C900F6C1C4 /* Transition.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F761A8A11C900F6C1C4 /* Transition.swift */; };
F5CD1F7B1A8A11C900F6C1C4 /* TransitionProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CD1F771A8A11C900F6C1C4 /* TransitionProtocol.swift */; };
F5F28FDA1A8B53D2000DA3DA /* UIView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5F28FD91A8B53D2000DA3DA /* UIView+Extension.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -33,10 +33,10 @@
F5217F311A89F14000A3D0ED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F5217F321A89F14000A3D0ED /* ExpandableViewTransitionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpandableViewTransitionTests.swift; sourceTree = "<group>"; };
F5CD1F6F1A8A0A1100F6C1C4 /* ExpandableViewTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpandableViewTransition.h; sourceTree = "<group>"; };
F5CD1F751A8A11C900F6C1C4 /* CENavigationControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CENavigationControllerDelegate.swift; sourceTree = "<group>"; };
F5CD1F761A8A11C900F6C1C4 /* CETransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CETransition.swift; sourceTree = "<group>"; };
F5CD1F771A8A11C900F6C1C4 /* CETransitionProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CETransitionProtocol.swift; sourceTree = "<group>"; };
F5F28FD91A8B53D2000DA3DA /* UIView+CEExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+CEExtension.swift"; sourceTree = "<group>"; };
F5CD1F751A8A11C900F6C1C4 /* NavigationControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationControllerDelegate.swift; sourceTree = "<group>"; };
F5CD1F761A8A11C900F6C1C4 /* Transition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Transition.swift; sourceTree = "<group>"; };
F5CD1F771A8A11C900F6C1C4 /* TransitionProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionProtocol.swift; sourceTree = "<group>"; };
F5F28FD91A8B53D2000DA3DA /* UIView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extension.swift"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -79,10 +79,10 @@
F5217F221A89F14000A3D0ED /* ExpandableViewTransition */ = {
isa = PBXGroup;
children = (
F5F28FD91A8B53D2000DA3DA /* UIView+CEExtension.swift */,
F5CD1F751A8A11C900F6C1C4 /* CENavigationControllerDelegate.swift */,
F5CD1F761A8A11C900F6C1C4 /* CETransition.swift */,
F5CD1F771A8A11C900F6C1C4 /* CETransitionProtocol.swift */,
F5F28FD91A8B53D2000DA3DA /* UIView+Extension.swift */,
F5CD1F751A8A11C900F6C1C4 /* NavigationControllerDelegate.swift */,
F5CD1F761A8A11C900F6C1C4 /* Transition.swift */,
F5CD1F771A8A11C900F6C1C4 /* TransitionProtocol.swift */,
F5CD1F6F1A8A0A1100F6C1C4 /* ExpandableViewTransition.h */,
F5217F231A89F14000A3D0ED /* Supporting Files */,
);
Expand Down Expand Up @@ -221,10 +221,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F5CD1F7B1A8A11C900F6C1C4 /* CETransitionProtocol.swift in Sources */,
F5F28FDA1A8B53D2000DA3DA /* UIView+CEExtension.swift in Sources */,
F5CD1F7A1A8A11C900F6C1C4 /* CETransition.swift in Sources */,
F5CD1F791A8A11C900F6C1C4 /* CENavigationControllerDelegate.swift in Sources */,
F5CD1F7B1A8A11C900F6C1C4 /* TransitionProtocol.swift in Sources */,
F5F28FDA1A8B53D2000DA3DA /* UIView+Extension.swift in Sources */,
F5CD1F7A1A8A11C900F6C1C4 /* Transition.swift in Sources */,
F5CD1F791A8A11C900F6C1C4 /* NavigationControllerDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 0 additions & 2 deletions ExpandableViewTransition/ExpandableViewTransition.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
//

#import <UIKit/UIKit.h>

FOUNDATION_EXPORT double ExpandableViewTransition;
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// CENavigationControllerDelegate.swift
// NavigationControllerDelegate.swift
// Taskworld
//
// Created by Ambas Chobsanti on 2/3/15.
// Copyright (c) 2015 Taskworld. All rights reserved.
// Copyright (c) 2015 Ambas. All rights reserved.
//

import UIKit

public class CENavigationControllerDelegate: NSObject, UINavigationControllerDelegate {
public class NavigationControllerDelegate: NSObject, UINavigationControllerDelegate {
let isHideExpandedView: Bool

public init(isHideExpandedView: Bool) {
Expand All @@ -17,7 +17,7 @@ public class CENavigationControllerDelegate: NSObject, UINavigationControllerDel
}

public func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
let transition = CETransition(isHideExpandedView: self.isHideExpandedView, isPresenting: operation == .Pop)
let transition = Transition(isHideExpandedView: self.isHideExpandedView, isPresenting: operation == .Pop)

return transition
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// CETransition.swift
// Transition.swift
// Taskworld
//
// Created by Ambas Chobsanti on 2/3/15.
// Copyright (c) 2015 Taskworld. All rights reserved.
// Copyright (c) 2015 Ambas. All rights reserved.
//

import UIKit
Expand All @@ -17,7 +17,7 @@ let navigationHeight : CGFloat = 44.0
let statubarHeight : CGFloat = 20.0
let navigationHeaderAndStatusbarHeight : CGFloat = navigationHeight + statubarHeight

public class CETransition: NSObject, UIViewControllerAnimatedTransitioning {
public class Transition: NSObject, UIViewControllerAnimatedTransitioning {

let isPresenting: Bool
let isHideExpandedView: Bool
Expand Down Expand Up @@ -49,13 +49,13 @@ public class CETransition: NSObject, UIViewControllerAnimatedTransitioning {
public func expandCard(fromViewController: UIViewController, toViewController: UIViewController, containerView: UIView, completion:() -> ()) {
toViewController.view.hidden = true
containerView.addSubview(toViewController.view)
let viewToExpand = (fromViewController as! CEBaseViewControllerProtocol).viewToExpand()
let viewToExpand = (fromViewController as! BaseViewControllerProtocol).viewToExpand()
let snapShot = viewToExpand.snapShotForTransition()
containerView.insertSubview(snapShot, belowSubview: toViewController.view)
let leftUpperPoint = (viewToExpand as! UIView).convertPoint(CGPointZero, toView: nil)
snapShot.origin(leftUpperPoint)

(toViewController as? CEDestinationViewControllerProtocol)?.snapShotWillTransition?(snapShot)
(toViewController as? DestinationViewControllerProtocol)?.snapShotWillTransition?(snapShot)

UIView.expandAnimation(leftUpperPoint, snapShot: snapShot, fromViewController: fromViewController, toViewController: toViewController, completion: {
if self.isHideExpandedView {
Expand All @@ -68,15 +68,15 @@ public class CETransition: NSObject, UIViewControllerAnimatedTransitioning {
public func hideCard(fromViewController: UIViewController, toViewController: UIViewController, containerView: UIView, completion:() -> ()) {
let toView = toViewController.view
containerView.addSubview(toView)
let viewToExpand = (toViewController as! CEBaseViewControllerProtocol).viewToExpand()
let viewToExpand = (toViewController as! BaseViewControllerProtocol).viewToExpand()
(viewToExpand as! UIView).hidden = true
let leftUpperPoint = (viewToExpand as! UIView).convertPoint(CGPointZero, toView: nil)
let offsetY = fromViewController.navigationController!.navigationBarHidden ? 0.0 : navigationHeaderAndStatusbarHeight
let snapShot = viewToExpand.snapShotForTransition()
snapShot.origin(CGPoint(x: 0, y: offsetY))
snapShot.frame.size.height = screenHeight
containerView.addSubview(snapShot)
(fromViewController as? CEDestinationViewControllerProtocol)?.snapShotWillFold?(snapShot)
(fromViewController as? DestinationViewControllerProtocol)?.snapShotWillFold?(snapShot)

UIView.foldAnimation(leftUpperPoint, snapShot: snapShot, fromViewController: fromViewController, viewToExpand: viewToExpand, completion: {
completion()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
//
// CETransitionProtocol.swift
// TransitionProtocol.swift
// Taskworld
//
// Created by Ambas Chobsanti on 2/3/15.
// Copyright (c) 2015 Taskworld. All rights reserved.
// Copyright (c) 2015 Ambas. All rights reserved.
//

import UIKit

@objc public protocol CEBaseViewControllerProtocol {
@objc public protocol BaseViewControllerProtocol {

func transitionCollectionView() -> UICollectionView

func viewToExpand() -> CESnapShotViewProtocol
func viewToExpand() -> SnapShotViewProtocol
}

@objc public protocol CEDestinationViewControllerProtocol {
@objc public protocol DestinationViewControllerProtocol {

optional func snapShotWillTransition(snapShot: UIView)

Expand All @@ -30,7 +30,7 @@ import UIKit
optional func snapShotDidFold(snapShot: UIView)
}

@objc public protocol CESnapShotViewProtocol {
@objc public protocol SnapShotViewProtocol {

func snapShotForTransition() -> UIView
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// UIView+CEExtension.swift
// UIView+Extension.swift
// ExpandableViewTransition
//
// Created by Ambas Chobsanti on 2/11/15.
// Copyright (c) 2015 Taskworld. All rights reserved.
// Copyright (c) 2015 Ambas. All rights reserved.
//

extension UIView {
Expand All @@ -16,23 +16,23 @@ extension UIView {
UIView.animateWithDuration(0.4, delay: 0.0, usingSpringWithDamping: 0.65, initialSpringVelocity: 0, options: UIViewAnimationOptions.CurveEaseIn, animations: {
let offsetY = fromViewController.navigationController!.navigationBarHidden ? 0.0 : navigationHeaderAndStatusbarHeight
snapShot.frame = CGRectMake(0, offsetY, screenWidth, screenHeight)
(toViewController as? CEDestinationViewControllerProtocol)?.snapShotTransitioning?(snapShot)
(toViewController as? DestinationViewControllerProtocol)?.snapShotTransitioning?(snapShot)
}, completion: {finished in
if finished {
(toViewController as? CEDestinationViewControllerProtocol)?.snapShotDidTransition?(snapShot)
(toViewController as? DestinationViewControllerProtocol)?.snapShotDidTransition?(snapShot)
toViewController.view.hidden = false
completion()
}
})
}

class func foldAnimation(leftUpperPoint: CGPoint, snapShot: UIView, fromViewController: UIViewController, viewToExpand: CESnapShotViewProtocol, completion:() -> ()) {
class func foldAnimation(leftUpperPoint: CGPoint, snapShot: UIView, fromViewController: UIViewController, viewToExpand: SnapShotViewProtocol, completion:() -> ()) {
UIView.animateWithDuration(0.25, animations: {
snapShot.frame = CGRectMake(leftUpperPoint.x, leftUpperPoint.y, (viewToExpand as! UIView).frame.width, (viewToExpand as! UIView).frame.height)
(fromViewController as? CEDestinationViewControllerProtocol)?.snapShotFoldind?(snapShot)
(fromViewController as? DestinationViewControllerProtocol)?.snapShotFoldind?(snapShot)
}, completion:{finished in
if finished {
(fromViewController as? CEDestinationViewControllerProtocol)?.snapShotDidFold?(snapShot)
(fromViewController as? DestinationViewControllerProtocol)?.snapShotDidFold?(snapShot)
(viewToExpand as! UIView).hidden = false
snapShot.removeFromSuperview()
completion()
Expand Down

0 comments on commit c1c8924

Please sign in to comment.