Code Monkey home page Code Monkey logo

displayswitcher's Issues

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

Using in Objective-C

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

Build Error:
Use of undeclared identifier 'TransitionManager'

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

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 **

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

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

Manual Installation

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

thank you

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?

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.

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.

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

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,

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)

Support for Rotation

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

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

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

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.

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.

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?

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.

Cocoapods update

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

Thank you!

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()
}

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
}

}

`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 => '../'
 #  -------------------------------------------

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.

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.