Giter Site home page Giter Site logo

Comments (11)

lmorit avatar lmorit commented on June 11, 2024 6

I think what you missed is that you have to create a new class that is a subclass of GSKStretchyHeaderView, in the example they called this custom class GSKStretchyHeaderViewSubclass.

Example:

use var stretchyHeader: HeaderView!

And write your custom class HeaderView.swift

import GSKStretchyHeaderView

class HeaderView: GSKStretchyHeaderView {
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        // you can change wether it expands at the top or as soon as you scroll down
        self.expansionMode = .immediate
        
        // You can change the minimum and maximum content heights
        self.minimumContentHeight = 64 // you can replace the navigation bar with a stretchy header view
        self.maximumContentHeight = 280
        
        // You can specify if the content expands when the table view bounces, and if it shrinks if contentView.height < maximumContentHeight. This is specially convenient if you use auto layout inside the stretchy header view
        self.contentShrinks = true
        self.contentExpands = false // useful if you want to display the refreshControl below the header view
        
        // You can specify wether the content view sticks to the top or the bottom of the header view if one of the previous properties is set to `false`
        // In this case, when the user bounces the scrollView, the content will keep its height and will stick to the bottom of the header view
        self.contentAnchor = .bottom
    }
    
}

from gskstretchyheaderview.

gskbyte avatar gskbyte commented on June 11, 2024

Hi,

maybe you need to import GSKStretchyHeaderView in your Swift file

from gskstretchyheaderview.

mohamedmontser avatar mohamedmontser commented on June 11, 2024

i already import GSKStretchyHeaderView and still have error

from gskstretchyheaderview.

mohamedmontser avatar mohamedmontser commented on June 11, 2024

@julioas09 is the library works with you now?

from gskstretchyheaderview.

gskbyte avatar gskbyte commented on June 11, 2024

I think you need to add a bridging header, because this component is written in Objective-C:

https://github.com/gskbyte/GSKStretchyHeaderView/blob/master/Example/GSKStretchyHeaderView/Example-Bridging-Header.h

from gskstretchyheaderview.

mohamedmontser avatar mohamedmontser commented on June 11, 2024

@gskbyte great thanks for you
but the problem with me and @julioas09 (maybe) is we do not have view called GSKStretchyHeaderViewSubclass

from gskstretchyheaderview.

julioas09 avatar julioas09 commented on June 11, 2024

Thanks. after adding those lines to the bridging header, that error goes away, however, when trying to build the project I get the following error:

screen shot 2018-03-07 at 22 28 17

I understand those are files included in the example, which are not added when installing the pod package. Which would be the right approach to be able to use the library properly in a swift project?

Thank you!

from gskstretchyheaderview.

gskbyte avatar gskbyte commented on June 11, 2024

Hi,

to be honest I can't really help as this depends on the configuration of your project. Have you tried with Carthage?

from gskstretchyheaderview.

mohamedmontser avatar mohamedmontser commented on June 11, 2024

from gskstretchyheaderview.

daver234 avatar daver234 commented on June 11, 2024

I have this same problem after doing the first install. Did anyone find an answer to this question?

from gskstretchyheaderview.

gskbyte avatar gskbyte commented on June 11, 2024

Hi, if you are importing this library in a Swift project, you just need to @import GSKStretchyHeaderView; in your bridging header. All other example files are obviously not needed, because they belong only to the example project.

from gskstretchyheaderview.

Related Issues (20)

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.