Repository: BourneWeng/MagicMove Branch: master Commit: 61243fb35f32 Files: 22 Total size: 56.8 KB Directory structure: gitextract_f2gnqyp2/ ├── MagicMove/ │ ├── AppDelegate.swift │ ├── Base.lproj/ │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── DetailViewController.swift │ ├── Images.xcassets/ │ │ ├── 001.imageset/ │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ └── avatar.imageset/ │ │ └── Contents.json │ ├── Info.plist │ ├── MMCollectionViewCell.swift │ ├── MagicMovePopTransion.swift │ ├── MagicMoveTransion.swift │ └── ViewController.swift ├── MagicMove.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata/ │ │ │ └── MagicMove.xccheckout │ │ └── xcuserdata/ │ │ └── BourneWeng.xcuserdatad/ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata/ │ └── BourneWeng.xcuserdatad/ │ ├── xcdebugger/ │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes/ │ ├── MagicMove.xcscheme │ └── xcschememanagement.plist ├── MagicMoveTests/ │ ├── Info.plist │ └── MagicMoveTests.swift └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: MagicMove/AppDelegate.swift ================================================ // // AppDelegate.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } func applicationDidEnterBackground(application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } ================================================ FILE: MagicMove/Base.lproj/LaunchScreen.xib ================================================ ================================================ FILE: MagicMove/Base.lproj/Main.storyboard ================================================ Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. ================================================ FILE: MagicMove/DetailViewController.swift ================================================ // // DetailViewController.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class DetailViewController: UIViewController, UINavigationControllerDelegate { @IBOutlet weak var avatarImageView: UIImageView! var image: UIImage! private var percentDrivenTransition: UIPercentDrivenInteractiveTransition? override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.navigationController?.delegate = self //手势监听器 let edgePan = UIScreenEdgePanGestureRecognizer(target: self, action: Selector("edgePanGesture:")) edgePan.edges = UIRectEdge.Left self.view.addGestureRecognizer(edgePan) } func edgePanGesture(edgePan: UIScreenEdgePanGestureRecognizer) { let progress = edgePan.translationInView(self.view).x / self.view.bounds.width if edgePan.state == UIGestureRecognizerState.Began { self.percentDrivenTransition = UIPercentDrivenInteractiveTransition() self.navigationController?.popViewControllerAnimated(true) } else if edgePan.state == UIGestureRecognizerState.Changed { self.percentDrivenTransition?.updateInteractiveTransition(progress) } else if edgePan.state == UIGestureRecognizerState.Cancelled || edgePan.state == UIGestureRecognizerState.Ended { if progress > 0.5 { self.percentDrivenTransition?.finishInteractiveTransition() } else { self.percentDrivenTransition?.cancelInteractiveTransition() } self.percentDrivenTransition = nil } } func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { if operation == UINavigationControllerOperation.Pop { return MagicMovePopTransion() } else { return nil } } func navigationController(navigationController: UINavigationController, interactionControllerForAnimationController animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { if animationController is MagicMovePopTransion { return self.percentDrivenTransition } else { return nil } } } ================================================ FILE: MagicMove/Images.xcassets/001.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x", "filename" : "001.png" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: MagicMove/Images.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: MagicMove/Images.xcassets/avatar.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x", "filename" : "avatar.JPG" }, { "idiom" : "universal", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: MagicMove/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier tk.bourne.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: MagicMove/MMCollectionViewCell.swift ================================================ // // MMCollectionViewCell.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class MMCollectionViewCell: UICollectionViewCell { @IBOutlet weak var imageView: UIImageView! @IBOutlet weak var textLabel: UILabel! } ================================================ FILE: MagicMove/MagicMovePopTransion.swift ================================================ // // MagicMovePopTransion.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class MagicMovePopTransion: NSObject, UIViewControllerAnimatedTransitioning { func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval { return 0.5 } func animateTransition(transitionContext: UIViewControllerContextTransitioning) { let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as! DetailViewController let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as! ViewController let container = transitionContext.containerView() let snapshotView = fromVC.avatarImageView.snapshotViewAfterScreenUpdates(false) snapshotView.frame = container.convertRect(fromVC.avatarImageView.frame, fromView: fromVC.view) fromVC.avatarImageView.hidden = true toVC.view.frame = transitionContext.finalFrameForViewController(toVC) toVC.selectedCell.imageView.hidden = true container.insertSubview(toVC.view, belowSubview: fromVC.view) container.addSubview(snapshotView) UIView.animateWithDuration(transitionDuration(transitionContext), delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in snapshotView.frame = container.convertRect(toVC.selectedCell.imageView.frame, fromView: toVC.selectedCell) fromVC.view.alpha = 0 }) { (finish: Bool) -> Void in toVC.selectedCell.imageView.hidden = false snapshotView.removeFromSuperview() fromVC.avatarImageView.hidden = false transitionContext.completeTransition(!transitionContext.transitionWasCancelled()) } } } ================================================ FILE: MagicMove/MagicMoveTransion.swift ================================================ // // MagicMoveTransion.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class MagicMoveTransion: NSObject, UIViewControllerAnimatedTransitioning { func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval { return 0.5 } func animateTransition(transitionContext: UIViewControllerContextTransitioning) { //1.获取动画的源控制器和目标控制器 let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey) as! ViewController let toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) as! DetailViewController let container = transitionContext.containerView() //2.创建一个 Cell 中 imageView 的截图,并把 imageView 隐藏,造成使用户以为移动的就是 imageView 的假象 let snapshotView = fromVC.selectedCell.imageView.snapshotViewAfterScreenUpdates(false) snapshotView.frame = container.convertRect(fromVC.selectedCell.imageView.frame, fromView: fromVC.selectedCell) fromVC.selectedCell.imageView.hidden = true //3.设置目标控制器的位置,并把透明度设为0,在后面的动画中慢慢显示出来变为1 toVC.view.frame = transitionContext.finalFrameForViewController(toVC) toVC.view.alpha = 0 //4.都添加到 container 中。注意顺序不能错了 container.addSubview(toVC.view) container.addSubview(snapshotView) //5.执行动画 /* 这时avatarImageView.frame的值只是跟在IB中一样的, 如果换成屏幕尺寸不同的模拟器运行时avatarImageView会先移动到IB中的frame,动画结束后才会突然变成正确的frame。 所以需要在动画执行前执行一次toVC.avatarImageView.layoutIfNeeded() update一次frame */ toVC.avatarImageView.layoutIfNeeded() UIView.animateWithDuration(transitionDuration(transitionContext), delay: 0, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in snapshotView.frame = toVC.avatarImageView.frame toVC.view.alpha = 1 }) { (finish: Bool) -> Void in fromVC.selectedCell.imageView.hidden = false toVC.avatarImageView.image = toVC.image snapshotView.removeFromSuperview() //一定要记得动画完成后执行此方法,让系统管理 navigation transitionContext.completeTransition(true) } } } ================================================ FILE: MagicMove/ViewController.swift ================================================ // // ViewController.swift // MagicMove // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit class ViewController: UICollectionViewController, UINavigationControllerDelegate { var selectedCell: MMCollectionViewCell! override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.navigationController?.delegate = self } func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { if operation == UINavigationControllerOperation.Push { return MagicMoveTransion() } else { return nil } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "detail" { let detailVC = segue.destinationViewController as! DetailViewController detailVC.image = self.selectedCell.imageView.image } } override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 10 } override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cardCell", forIndexPath: indexPath) as! MMCollectionViewCell return cell } override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { self.selectedCell = collectionView.cellForItemAtIndexPath(indexPath) as! MMCollectionViewCell self.performSegueWithIdentifier("detail", sender: nil) } } ================================================ FILE: MagicMove.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ A8FF09AB1B5372E300BD2C74 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09AA1B5372E300BD2C74 /* AppDelegate.swift */; }; A8FF09AD1B5372E300BD2C74 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09AC1B5372E300BD2C74 /* ViewController.swift */; }; A8FF09B01B5372E300BD2C74 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A8FF09AE1B5372E300BD2C74 /* Main.storyboard */; }; A8FF09B21B5372E300BD2C74 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A8FF09B11B5372E300BD2C74 /* Images.xcassets */; }; A8FF09B51B5372E300BD2C74 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = A8FF09B31B5372E300BD2C74 /* LaunchScreen.xib */; }; A8FF09C11B5372E400BD2C74 /* MagicMoveTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09C01B5372E400BD2C74 /* MagicMoveTests.swift */; }; A8FF09CB1B538CB600BD2C74 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09CA1B538CB600BD2C74 /* DetailViewController.swift */; }; A8FF09CD1B5391F900BD2C74 /* MagicMoveTransion.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09CC1B5391F900BD2C74 /* MagicMoveTransion.swift */; }; A8FF09CF1B5399AD00BD2C74 /* MMCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09CE1B5399AD00BD2C74 /* MMCollectionViewCell.swift */; }; A8FF09D11B53A1AC00BD2C74 /* MagicMovePopTransion.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8FF09D01B53A1AC00BD2C74 /* MagicMovePopTransion.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ A8FF09BB1B5372E400BD2C74 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A8FF099D1B5372E300BD2C74 /* Project object */; proxyType = 1; remoteGlobalIDString = A8FF09A41B5372E300BD2C74; remoteInfo = MagicMove; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ A8FF09A51B5372E300BD2C74 /* MagicMove.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MagicMove.app; sourceTree = BUILT_PRODUCTS_DIR; }; A8FF09A91B5372E300BD2C74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8FF09AA1B5372E300BD2C74 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; A8FF09AC1B5372E300BD2C74 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; A8FF09AF1B5372E300BD2C74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; A8FF09B11B5372E300BD2C74 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; A8FF09B41B5372E300BD2C74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; A8FF09BA1B5372E400BD2C74 /* MagicMoveTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MagicMoveTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A8FF09BF1B5372E400BD2C74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8FF09C01B5372E400BD2C74 /* MagicMoveTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MagicMoveTests.swift; sourceTree = ""; }; A8FF09CA1B538CB600BD2C74 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; A8FF09CC1B5391F900BD2C74 /* MagicMoveTransion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MagicMoveTransion.swift; sourceTree = ""; }; A8FF09CE1B5399AD00BD2C74 /* MMCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MMCollectionViewCell.swift; sourceTree = ""; }; A8FF09D01B53A1AC00BD2C74 /* MagicMovePopTransion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MagicMovePopTransion.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ A8FF09A21B5372E300BD2C74 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; A8FF09B71B5372E400BD2C74 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ A8FF099C1B5372E300BD2C74 = { isa = PBXGroup; children = ( A8FF09A71B5372E300BD2C74 /* MagicMove */, A8FF09BD1B5372E400BD2C74 /* MagicMoveTests */, A8FF09A61B5372E300BD2C74 /* Products */, ); sourceTree = ""; }; A8FF09A61B5372E300BD2C74 /* Products */ = { isa = PBXGroup; children = ( A8FF09A51B5372E300BD2C74 /* MagicMove.app */, A8FF09BA1B5372E400BD2C74 /* MagicMoveTests.xctest */, ); name = Products; sourceTree = ""; }; A8FF09A71B5372E300BD2C74 /* MagicMove */ = { isa = PBXGroup; children = ( A8FF09AA1B5372E300BD2C74 /* AppDelegate.swift */, A8FF09AC1B5372E300BD2C74 /* ViewController.swift */, A8FF09CE1B5399AD00BD2C74 /* MMCollectionViewCell.swift */, A8FF09CA1B538CB600BD2C74 /* DetailViewController.swift */, A8FF09CC1B5391F900BD2C74 /* MagicMoveTransion.swift */, A8FF09D01B53A1AC00BD2C74 /* MagicMovePopTransion.swift */, A8FF09AE1B5372E300BD2C74 /* Main.storyboard */, A8FF09B11B5372E300BD2C74 /* Images.xcassets */, A8FF09B31B5372E300BD2C74 /* LaunchScreen.xib */, A8FF09A81B5372E300BD2C74 /* Supporting Files */, ); path = MagicMove; sourceTree = ""; }; A8FF09A81B5372E300BD2C74 /* Supporting Files */ = { isa = PBXGroup; children = ( A8FF09A91B5372E300BD2C74 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; A8FF09BD1B5372E400BD2C74 /* MagicMoveTests */ = { isa = PBXGroup; children = ( A8FF09C01B5372E400BD2C74 /* MagicMoveTests.swift */, A8FF09BE1B5372E400BD2C74 /* Supporting Files */, ); path = MagicMoveTests; sourceTree = ""; }; A8FF09BE1B5372E400BD2C74 /* Supporting Files */ = { isa = PBXGroup; children = ( A8FF09BF1B5372E400BD2C74 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ A8FF09A41B5372E300BD2C74 /* MagicMove */ = { isa = PBXNativeTarget; buildConfigurationList = A8FF09C41B5372E400BD2C74 /* Build configuration list for PBXNativeTarget "MagicMove" */; buildPhases = ( A8FF09A11B5372E300BD2C74 /* Sources */, A8FF09A21B5372E300BD2C74 /* Frameworks */, A8FF09A31B5372E300BD2C74 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = MagicMove; productName = MagicMove; productReference = A8FF09A51B5372E300BD2C74 /* MagicMove.app */; productType = "com.apple.product-type.application"; }; A8FF09B91B5372E400BD2C74 /* MagicMoveTests */ = { isa = PBXNativeTarget; buildConfigurationList = A8FF09C71B5372E400BD2C74 /* Build configuration list for PBXNativeTarget "MagicMoveTests" */; buildPhases = ( A8FF09B61B5372E400BD2C74 /* Sources */, A8FF09B71B5372E400BD2C74 /* Frameworks */, A8FF09B81B5372E400BD2C74 /* Resources */, ); buildRules = ( ); dependencies = ( A8FF09BC1B5372E400BD2C74 /* PBXTargetDependency */, ); name = MagicMoveTests; productName = MagicMoveTests; productReference = A8FF09BA1B5372E400BD2C74 /* MagicMoveTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ A8FF099D1B5372E300BD2C74 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0640; ORGANIZATIONNAME = Bourne; TargetAttributes = { A8FF09A41B5372E300BD2C74 = { CreatedOnToolsVersion = 6.4; }; A8FF09B91B5372E400BD2C74 = { CreatedOnToolsVersion = 6.4; TestTargetID = A8FF09A41B5372E300BD2C74; }; }; }; buildConfigurationList = A8FF09A01B5372E300BD2C74 /* Build configuration list for PBXProject "MagicMove" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = A8FF099C1B5372E300BD2C74; productRefGroup = A8FF09A61B5372E300BD2C74 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( A8FF09A41B5372E300BD2C74 /* MagicMove */, A8FF09B91B5372E400BD2C74 /* MagicMoveTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ A8FF09A31B5372E300BD2C74 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( A8FF09B01B5372E300BD2C74 /* Main.storyboard in Resources */, A8FF09B51B5372E300BD2C74 /* LaunchScreen.xib in Resources */, A8FF09B21B5372E300BD2C74 /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; A8FF09B81B5372E400BD2C74 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ A8FF09A11B5372E300BD2C74 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( A8FF09D11B53A1AC00BD2C74 /* MagicMovePopTransion.swift in Sources */, A8FF09CD1B5391F900BD2C74 /* MagicMoveTransion.swift in Sources */, A8FF09CB1B538CB600BD2C74 /* DetailViewController.swift in Sources */, A8FF09AD1B5372E300BD2C74 /* ViewController.swift in Sources */, A8FF09AB1B5372E300BD2C74 /* AppDelegate.swift in Sources */, A8FF09CF1B5399AD00BD2C74 /* MMCollectionViewCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; A8FF09B61B5372E400BD2C74 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( A8FF09C11B5372E400BD2C74 /* MagicMoveTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ A8FF09BC1B5372E400BD2C74 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A8FF09A41B5372E300BD2C74 /* MagicMove */; targetProxy = A8FF09BB1B5372E400BD2C74 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ A8FF09AE1B5372E300BD2C74 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( A8FF09AF1B5372E300BD2C74 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; A8FF09B31B5372E300BD2C74 /* LaunchScreen.xib */ = { isa = PBXVariantGroup; children = ( A8FF09B41B5372E300BD2C74 /* Base */, ); name = LaunchScreen.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ A8FF09C21B5372E400BD2C74 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.4; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; A8FF09C31B5372E400BD2C74 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.4; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; name = Release; }; A8FF09C51B5372E400BD2C74 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MagicMove/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; A8FF09C61B5372E400BD2C74 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MagicMove/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; A8FF09C81B5372E400BD2C74 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = MagicMoveTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MagicMove.app/MagicMove"; }; name = Debug; }; A8FF09C91B5372E400BD2C74 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); INFOPLIST_FILE = MagicMoveTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MagicMove.app/MagicMove"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ A8FF09A01B5372E300BD2C74 /* Build configuration list for PBXProject "MagicMove" */ = { isa = XCConfigurationList; buildConfigurations = ( A8FF09C21B5372E400BD2C74 /* Debug */, A8FF09C31B5372E400BD2C74 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; A8FF09C41B5372E400BD2C74 /* Build configuration list for PBXNativeTarget "MagicMove" */ = { isa = XCConfigurationList; buildConfigurations = ( A8FF09C51B5372E400BD2C74 /* Debug */, A8FF09C61B5372E400BD2C74 /* Release */, ); defaultConfigurationIsVisible = 0; }; A8FF09C71B5372E400BD2C74 /* Build configuration list for PBXNativeTarget "MagicMoveTests" */ = { isa = XCConfigurationList; buildConfigurations = ( A8FF09C81B5372E400BD2C74 /* Debug */, A8FF09C91B5372E400BD2C74 /* Release */, ); defaultConfigurationIsVisible = 0; }; /* End XCConfigurationList section */ }; rootObject = A8FF099D1B5372E300BD2C74 /* Project object */; } ================================================ FILE: MagicMove.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: MagicMove.xcodeproj/project.xcworkspace/xcshareddata/MagicMove.xccheckout ================================================ IDESourceControlProjectFavoriteDictionaryKey IDESourceControlProjectIdentifier F5CB760D-0578-4DA8-942A-2452A8DAEFAE IDESourceControlProjectName MagicMove IDESourceControlProjectOriginsDictionary B055F872B1A4A19B55EE359B71B2B43F04C3DC7C https://github.com/BourneWeng/MagicMove.git IDESourceControlProjectPath MagicMove.xcodeproj IDESourceControlProjectRelativeInstallPathDictionary B055F872B1A4A19B55EE359B71B2B43F04C3DC7C ../.. IDESourceControlProjectURL https://github.com/BourneWeng/MagicMove.git IDESourceControlProjectVersion 111 IDESourceControlProjectWCCIdentifier B055F872B1A4A19B55EE359B71B2B43F04C3DC7C IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey B055F872B1A4A19B55EE359B71B2B43F04C3DC7C IDESourceControlWCCName MagicMove ================================================ FILE: MagicMove.xcodeproj/xcuserdata/BourneWeng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist ================================================ ================================================ FILE: MagicMove.xcodeproj/xcuserdata/BourneWeng.xcuserdatad/xcschemes/MagicMove.xcscheme ================================================ ================================================ FILE: MagicMove.xcodeproj/xcuserdata/BourneWeng.xcuserdatad/xcschemes/xcschememanagement.plist ================================================ SchemeUserState MagicMove.xcscheme orderHint 0 SuppressBuildableAutocreation A8FF09A41B5372E300BD2C74 primary A8FF09B91B5372E400BD2C74 primary ================================================ FILE: MagicMoveTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier tk.bourne.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: MagicMoveTests/MagicMoveTests.swift ================================================ // // MagicMoveTests.swift // MagicMoveTests // // Created by BourneWeng on 15/7/13. // Copyright (c) 2015年 Bourne. All rights reserved. // import UIKit import XCTest class MagicMoveTests: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } func testPerformanceExample() { // This is an example of a performance test case. self.measureBlock() { // Put the code you want to measure the time of here. } } } ================================================ FILE: README.md ================================================ ###一个自定义转场动画示例,效果如下: 详细实现请看这里:[关于自定义转场动画,我都告诉你](http://www.jianshu.com/p/38cd35968864) ![](MagicMove.gif)