Code Monkey home page Code Monkey logo

displayswitcher's Introduction

Display Switcher

CocoaPods Compatible Platform License Yalantis

We designed a UI that allows users to switch between list and grid views on the fly and choose the most convenient display type. List view usually provides more details about each user or contact. Grid view allows more users or contacts to appear on the screen at the same time.

We created design mockups for both list and grid views using Sketch. As soon as the mockups were ready, we used Principle to create a smooth transition between the two display types. Note that the hamburger menu changes its appearance depending on which view is activated:

Preview

Requirements

  • iOS 10.0+
  • Xcode 11
  • Swift 5

Installing

use_frameworks!
pod ‘DisplaySwitcher’, '~> 2.0
github "Yalantis/DisplaySwitcher" "master"

Use Cases

You can use our Contact Display Switch for:

  • Social networking apps
  • Dating apps
  • Email clients
  • Any other app that features list of friends or contacts

Our DisplaySwitcher component isn't limited to friends and contacts lists. It can work with any other content too.

Usage

At first, import DisplaySwitcher:

import DisplaySwitcher

Then create two layouts (list mode and grid mode):

private lazy var listLayout = DisplaySwitchLayout(staticCellHeight: listLayoutStaticCellHeight, nextLayoutStaticCellHeight: gridLayoutStaticCellHeight, layoutState: .list)

private lazy var gridLayout = DisplaySwitchLayout(staticCellHeight: gridLayoutStaticCellHeight, nextLayoutStaticCellHeight: listLayoutStaticCellHeight, layoutState: .grid)

Set current layout:

private var layoutState: LayoutState = .list
collectionView.collectionViewLayout = listLayout

Then override two UICollectionViewDataSource methods:

func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    // count of items
}

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    // configure your custom cell
}

Also override one UICollectionViewDelegate method (for custom layout transition):

func collectionView(collectionView: UICollectionView, transitionLayoutForOldLayout fromLayout: UICollectionViewLayout, newLayout toLayout: UICollectionViewLayout) -> UICollectionViewTransitionLayout {
    let customTransitionLayout = TransitionLayout(currentLayout: fromLayout, nextLayout: toLayout)
    return customTransitionLayout
}

And in the end necessary create transition and start it (you can simply change animation duration for transition layout and for rotation button):

let transitionManager: TransitionManager
if layoutState == .list {
    layoutState = .grid
    transitionManager = TransitionManager(duration: animationDuration, collectionView: collectionView!, destinationLayout: gridLayout, layoutState: layoutState)
} else {
    layoutState = .list
    transitionManager = TransitionManager(duration: animationDuration, collectionView: collectionView!, destinationLayout: listLayout, layoutState: layoutState)
}
transitionManager.startInteractiveTransition()
rotationButton.selected = layoutState == .list
rotationButton.animationDuration = animationDuration

Under the hood

We use five classes to implement our DisplaySwitcher:

BaseLayout

In the BaseLayout class, we use methods for building list and grid layouts. But what’s most interesting here is the сontentOffset calculation that should be defined after the transition to a new layout.

First, save the сontentOffset of the layout you are switching from:

 override func prepareForTransitionFromLayout(oldLayout: UICollectionViewLayout) {
       previousContentOffset = NSValue(CGPoint:collectionView!.contentOffset)  
       return super.prepareForTransitionFromLayout(oldLayout)

   }

Then, calculate the сontentOffset for the new layout in the targetContentOffsetForProposedContentOffset method:

override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint) -> CGPoint {
       let previousContentOffsetPoint = previousContentOffset?.CGPointValue()
       let superContentOffset = super.targetContentOffsetForProposedContentOffset(proposedContentOffset)
       if let previousContentOffsetPoint = previousContentOffsetPoint {
           if previousContentOffsetPoint.y == 0 {
               return previousContentOffsetPoint
           }
           if layoutState == CollectionViewLayoutState.ListLayoutState {
               let offsetY = ceil(previousContentOffsetPoint.y + (staticCellHeight * previousContentOffsetPoint.y / nextLayoutStaticCellHeight) + cellPadding)
               return CGPoint(x: superContentOffset.x, y: offsetY)
           } else {
               let realOffsetY = ceil((previousContentOffsetPoint.y / nextLayoutStaticCellHeight * staticCellHeight / CGFloat(numberOfColumns)) - cellPadding)
               let offsetY = floor(realOffsetY / staticCellHeight) * staticCellHeight + cellPadding
return CGPoint(x: superContentOffset.x, y: offsetY)
           }
       }
       return superContentOffset
   }

And then clear value of variable in method finalizeLayoutTransition:

override func finalizeLayoutTransition() {
       previousContentOffset = nil
       super.finalizeLayoutTransition()
   }

BaseLayoutAttributes

In the BaseLayoutAttributes class, a few custom attributes are added:

var transitionProgress: CGFloat = 0.0
   var nextLayoutCellFrame = CGRectZero
   var layoutState: CollectionViewLayoutState = .ListLayoutState

transitionProgress is the current value of the animation transition that varies between 0 and 1. It’s needed for calculating constraints in the cell.

nextLayoutCellFrame is a property that returns the frame of the layout you switch to. It’s also used for the cell layout configuration during the process of transition.

layoutState is the current state of the layout.

TransitionLayout

The TransitionLayout class overrides two UICollectionViewLayout methods:

layoutAttributesForElementsInRect and
layoutAttributesForItemAtIndexPath, where we set properties values for the class BaseLayoutAttributes.

TransitionManager

The TransitionManager class uses the UICollectionView’sstartInteractiveTransitionToCollectionViewLayout method, where you point the layout it must switch to:

func startInteractiveTransition() {
       UIApplication.sharedApplication().beginIgnoringInteractionEvents()
       transitionLayout = collectionView.startInteractiveTransitionToCollectionViewLayout(destinationLayout, completion: { success, finish in
           if success && finish {
               self.collectionView.reloadData()
               UIApplication.sharedApplication().endIgnoringInteractionEvents()
           }
       }) as! TransitionLayout
       transitionLayout.layoutState = layoutState
       createUpdaterAndStart()
   }

CADisplayLink class

This class is used to control animation duration. This class helps calculate the animation progress depending on the animation duration preset:

private func createUpdaterAndStart() {
       start = CACurrentMediaTime()
       updater = CADisplayLink(target: self, selector: Selector("updateTransitionProgress"))
       updater.frameInterval = 1
       updater.addToRunLoop(NSRunLoop.currentRunLoop(), forMode: NSRunLoopCommonModes)
   }

dynamic func updateTransitionProgress() {
       var progress = (updater.timestamp - start) / duration
       progress = min(1, progress)
       progress = max(0, progress)
       transitionLayout.transitionProgress = CGFloat(progress)

       transitionLayout.invalidateLayout()
       if progress == finishTransitionValue {
           collectionView.finishInteractiveTransition()
           updater.invalidate()
       }
   }

That’s it! Use our DisplaySwitcher in any way you like! Check it out on Dribbble.

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

License

The MIT License (MIT)

Copyright © 2017 Yalantis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

displayswitcher's People

Contributors

aelines avatar drinkius avatar maryom avatar mrcompoteee avatar naeemshaikh90 avatar olgaios avatar pedkomaksim avatar pravdaevgen avatar rnkyr avatar roman-scherbakov avatar romanscherbakov avatar serejahh avatar sofiarozhinaadditional avatar vodolazkyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

displayswitcher's Issues

an error happened while carthage update

please help me

while i carthage update , an error happened as below

Dependency "DisplaySwitcher" has no shared framework schemes

while i pod install, another error happened

[!] Unable to find a specification for DisplaySwitcher (~> 1.0)

how to customize it to switch betweem list amd card view mood

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

i want to switch between list and card view mood not grid

How should it look like?

like this
https://dribbble.com/shots/4839248-Card-View-Mode

Your Environment

  • Version of the component: insert here
  • Swift version: swift 4.1

I'm getting some errors. Is it possible you make a video tutorial?

Report

The more information you provide, the faster we can help you.

⚠️ Select what you want - a feature request or report a bug. Please remove the section you aren't interested in.

A feature request

What do you want to add?

Please describe what you want to add to the component.

How should it look like?

Please add images.

Report a bug

What did you do?

Please replace this with what you did.

What did you expect to happen?

Please replace this with what you expected to happen.

What happened instead?

Please replace this with what happened instead.

Your Environment

  • Version of the component: insert here
  • Swift version: insert here
  • iOS version: insert here
  • Device: insert here
  • Xcode version: insert here
  • If you use Cocoapods: run pod env | pbcopy and insert here
  • If you use Carthage: run carthage version | pbcopy and insert here

Project that demonstrates the bug

Please add a link to a project we can download that reproduces the bug.

Manual Installation

Hi, it's possible use DisplaySwitcher without pod o carthage but with a manual Installation?

thank you

Do not connect the dependence

[!] Unable to satisfy the following requirements:

  • DisplaySwitcher (~> 1.0) required by Podfile

None of your spec sources contain a spec satisfying the dependency: DisplaySwitcher (~> 1.0).

You have either:

  • out-of-date source repos which you can update with pod repo update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, pod repo update does not happen on pod install by default.

Carthage compatibility.

Please add carthage compatibility. Or if it is fine by you, I'll add it and upload it to my repo and link your readme. Thanks.

Crash

Could not cast value of type 'UICollectionViewTransitionLayout' (0x10b5dbb08) to 'DisplaySwitcher.TransitionLayout' (0x1087e88f8).

In this function

open func startInteractiveTransition() {
UIApplication.shared.beginIgnoringInteractionEvents()
transitionLayout = collectionView.startInteractiveTransition(to: destinationLayout) { success, finish in
if success && finish {
self.collectionView.reloadData()
UIApplication.shared.endIgnoringInteractionEvents()
}
} as! TransitionLayout

transitionLayout.layoutState = layoutState
createUpdaterAndStart()
}

Custom contentInset breaks the layout

Report

Settings a custom contentInset on the collection view breaks the layout after changing the layout several times

Report a bug

What did you do?

Update the example code with the following:

    @IBOutlet fileprivate weak var collectionView: UICollectionView! {
        didSet {
            collectionView.contentInset = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4)
        }
    }

What did you expect to happen?

Set the custom contentInset on the collection view and display cells normally

What happened instead?

The custom contentInset seems to be used but the layout is broken, there is a huge empty space before the first cell appear and the layout animation flickers.

Your Environment

  • Version of the component: a02d5a1
  • Swift version: 4.1
  • iOS version: 11.2.6
  • Device: Simulator iPhone X / iPhone 6Plus
  • Xcode version: 9.3
  • If you use Carthage: 0.29.0

Project that demonstrates the bug

Simply updating your example project with the code previously provided on the UICollectionView outlet.

Display names on iPhone 6\7 plus

It doesn't show full name on iPhone 6\7 plus:

simulator screen shot 13 sep 2016 13 30 15

As you can see the name (Lamberts) is cropped, but on other iPhone everything is ok

Update podspec file

It seems that your podspec file is setting version to be 1.0.1 while current version with Swift 4 support is 1.1

Can you update it?

Changing TransitionLayout issue

Report a bug

Hi,

Followed the useage guide in a simple project with a button to switch the layout. But trying to switch layout outputs the following error in the TransitionManager class:

Could not cast value of type 'UICollectionViewTransitionLayout' (0x1775b1c) to 'DisplaySwitcher.TransitionLayout' (0xbff60).

screen shot 2016-11-26 at 16 16 02

Have I missed something?

Thanks.

Btw - I tried setting the initial layout as the grid but the first view was still a list. Is that expected behaviour??

Xcode 8.1/swift 3

constraint errors when changing layout

report a bug

When testing the demo I sometimes get a contraint error when changing layout:


2017-01-23 02:15:58.926309 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x61800008c170 H:|-(10)-[UILabel:0x7fe945b1ded0'Marry Kennedy']   (active, names: '|':UIView:0x7fe945b1dd30 )>",
    "<NSLayoutConstraint:0x61800008b270 H:[UILabel:0x7fe945b1ded0'Marry Kennedy']-(11)-|   (active, names: '|':UIView:0x7fe945b1dd30 )>",
    "<NSLayoutConstraint:0x61800008b6d0 UIImageView:0x7fe945b1e160.width == 1   (active)>",
    "<NSLayoutConstraint:0x61800008c3f0 UIImageView:0x7fe945b1e160.width == UIView:0x7fe945b1dd30.width   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x61800008b270 H:[UILabel:0x7fe945b1ded0'Marry Kennedy']-(11)-|   (active, names: '|':UIView:0x7fe945b1dd30 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Hi 0
Hi 0
Hi 0
Hi 0
Hi 0
2017-01-23 02:16:17.912348 DisplaySwitcher_Example[8893:1432862] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/Kevin/Library/Developer/CoreSimulator/Devices/28151775-0F99-4CC1-9CF3-3060CC67F995/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-01-23 02:16:17.912974 DisplaySwitcher_Example[8893:1432862] [MC] Reading from private effective user settings.
2017-01-23 02:16:31.670696 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x608000084e70 H:|-(10)-[UILabel:0x7fe942437b70'Leo Nicholson']   (active, names: '|':UIView:0x7fe9424379d0 )>",
    "<NSLayoutConstraint:0x60800008acd0 H:[UILabel:0x7fe942437b70'Leo Nicholson']-(11)-|   (active, names: '|':UIView:0x7fe9424379d0 )>",
    "<NSLayoutConstraint:0x608000094730 UIImageView:0x7fe942437e00.width == 3   (active)>",
    "<NSLayoutConstraint:0x608000092a20 UIImageView:0x7fe942437e00.width == UIView:0x7fe9424379d0.width   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60800008acd0 H:[UILabel:0x7fe942437b70'Leo Nicholson']-(11)-|   (active, names: '|':UIView:0x7fe9424379d0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2017-01-23 02:16:38.154543 DisplaySwitcher_Example[8893:1432862] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x61800008ff50 H:|-(10)-[UILabel:0x7fe942700440'Monica Lamberts']   (active, names: '|':UIView:0x7fe942702c80 )>",
    "<NSLayoutConstraint:0x618000088390 H:[UILabel:0x7fe942700440'Monica Lamberts']-(11)-|   (active, names: '|':UIView:0x7fe942702c80 )>",
    "<NSLayoutConstraint:0x618000082710 UIImageView:0x7fe9427013f0.width == 3   (active)>",
    "<NSLayoutConstraint:0x618000084060 UIImageView:0x7fe9427013f0.width == UIView:0x7fe942702c80.width   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x618000088390 H:[UILabel:0x7fe942700440'Monica Lamberts']-(11)-|   (active, names: '|':UIView:0x7fe942702c80 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

I am running Xcode 8.2.1
Simulator: Iphone 5s ios 10.2

Cocoapods update

Could you please update cocoapods trunk? the latest release there 1.0.1.

Thank you!

didSelectItemAtIndexPath issue

Hi,

Thanks for your amazing repo.

I have two issues:

  1. I need to implement didSelectItemAtIndexPath so I added it to UserViewController as follow:
func collectionView(collectionView: UICollectionView,
                        didSelectItemAtIndexPath indexPath: NSIndexPath) {
        print("Hi \(indexPath.row)")
    } 

But it doesn't work! Why?

2 . There is a warning:
plain style unsupported in a navigation item.

To solve it just change Bar Button Item Style to Bordered as shown in the attached image.
screen shot 2016-08-07 at 7 18 42 pm

`pod install` on the example project doesn't work

$ pod --version
1.1.0.beta.1

$ pod install

[!] Invalid `Podfile` file: [!] Unsupported options `{:exclusive=>true}` for target `DisplaySwitcher_Example`..

 #  from /Users/aaron/Downloads/DisplaySwitcher-master/Example/Podfile:4
 #  -------------------------------------------
 #  
 >  target 'DisplaySwitcher_Example', :exclusive => true do
 #    pod 'DisplaySwitcher', :path => '../'
 #  -------------------------------------------

First animation broken when starting using a .grid layout

Report

The first layout transition is broken if the first layout configuration is .grid

Report a bug

What did you do?

Update the example project with the following:

    fileprivate var layoutState: LayoutState = .grid

    fileprivate func setupCollectionView() {
        collectionView.collectionViewLayout = gridLayout
        // ...
    }

What did you expect to happen?

Proper animation for the layout transition

What happened instead?

The first animation is not smooth and flickers

Your Environment

  • Version of the component: a02d5a1
  • Swift version: 4.1
  • iOS version: 11.2.6
  • Device: Simulator iPhone X / iPhone 6Plus
  • Xcode version: 9.3
  • If you use Carthage: 0.29.0

Project that demonstrates the bug

Simply updating your example project with the code previously provided:

  1. Update initial layout in the setupCollectionView method for a gridLayout.
  2. Update the initial layoutState to .grid

Using in Objective-C

When I use in Objective-C
I cannot setup a TransitionManager.

Build Error:
Use of undeclared identifier 'TransitionManager'

Support for Rotation

I want to transition from List to Grid Layout when rotation from portrait to landscape.
How to achieve it ?

Question about adding container view in bar button item

Hi. Could you please help me. I saw that in your example project there is a container view inside bar button. I tried to do the same in my project using storyboard, but couldn't. Now I just copied it from your example project and set up. How could you add container view with buttons inside bar button?

customize cellPadding

Hi,

Sorry for posting here, this is not really an issue.

I'd like to know if it's possible to set my own cell padding in the object BaseLayout.
I want a very thin space between cells in grid mode.

Kind regards,

Installing with Cocoapods

Hello,

I've tried to use Cocoapods to install this library however it doesn't seem to be updated to the latest version.

I've tried to get latest version from github but either I've used wrong syntax or it should've been updated on Cocoapods.

Main issue is that I can't get the swift 4 version.

Using in Objective-C project.

When using DisplaySwitcher in an Objective-C project the init method on DisplaySwitchLayout is public init(staticCellHeight: CGFloat, nextLayoutStaticCellHeight: CGFloat, layoutState: LayoutState) is not available to Obj-C code. The only init method is initWithCoder.

Using Xcode version 8.0 (8A218a) and macOS 10.12. iOS deployment target 10.0.

Swift 3 ready?

It seems there is a problem with this lib and swift 3 perhaps?...

*** Building scheme "DisplaySwitcher" in DisplaySwitcher.xcworkspace
/usr/bin/xcrun xcodebuild -workspace /Users/Shared/xna/frontend/apps/ios/xxxx/Carthage/Checkouts/DisplaySwitcher/Example/DisplaySwitcher.xcworkspace -scheme DisplaySwitcher -configuration DEBUG -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build2016-09-23 17:29:39.238 xcodebuild[30695:20532020] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
Build settings from command line:
    BITCODE_GENERATION_MODE = bitcode
    CARTHAGE = YES
    CODE_SIGN_IDENTITY =
    CODE_SIGNING_REQUIRED = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos10.0

=== CLEAN TARGET DisplaySwitcher OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** CLEAN FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
=== BUILD TARGET DisplaySwitcher OF PROJECT Pods WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

** BUILD FAILED **


The following build commands failed:
    Check dependencies
(1 failure)
A shell task (/usr/bin/xcrun xcodebuild -workspace /Users/Shared/xna/frontend/apps/ios/xxCarthage/Checkouts/DisplaySwitcher/Example/DisplaySwitcher.xcworkspace -scheme DisplaySwitcher -configuration DEBUG -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
2016-09-23 17:29:39.238 xcodebuild[30695:20532020] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs


** CLEAN FAILED **

transition content offset issues

report a bug

when i set GridLayoutCountOfColumns = 2,the transition content offset is not correct
untitled

I am running Xcode 9.1
Simulator: Iphone X ios 11.1

No longer compatible with Carthage?

Since the update to Swift 3 the project is missing the Carthage compatible header in the README.md. Is it simply missing or is the project no longer compatible? Thanks.

Stretchy Header

I used stretchy Header FlowLayout
after import DisplaySwitcher my Header doesn't seem anymore?

import UIKit

class STCollectionViewFlowLayout: UICollectionViewFlowLayout {

override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
    return true
}

override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
    
    let layoutAttributes = super.layoutAttributesForElements(in: rect)       
    
    layoutAttributes?.forEach({ (attributes) in
        if attributes.representedElementKind == UICollectionView.elementKindSectionHeader {
            guard let collectionView = collectionView else {
                return
            }

            let contentOffsetY = collectionView.contentOffset.y
            
            if contentOffsetY > 0 {
                return
            }
            let width = collectionView.frame.width
            let height: CGFloat = attributes.frame.height - contentOffsetY
            attributes.frame = CGRect(x: 0, y: contentOffsetY, width: width, height: height)

        }
    })
    return layoutAttributes
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.