Comments (11)
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.
Hi,
maybe you need to import GSKStretchyHeaderView
in your Swift file
from gskstretchyheaderview.
i already import GSKStretchyHeaderView and still have error
from gskstretchyheaderview.
@julioas09 is the library works with you now?
from gskstretchyheaderview.
I think you need to add a bridging header, because this component is written in Objective-C:
from gskstretchyheaderview.
@gskbyte great thanks for you
but the problem with me and @julioas09 (maybe) is we do not have view called GSKStretchyHeaderViewSubclass
from gskstretchyheaderview.
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:
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.
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.
from gskstretchyheaderview.
I have this same problem after doing the first install. Did anyone find an answer to this question?
from gskstretchyheaderview.
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)
- TableView does not show the header
- Scalable Text Example is incorrect for iOS 14
- GSKStretchyHeaderView fixZPositions prevents subviews in the same UIScrollView from setting differing zPositions
- HeaderView is hidden at first run of the tableView. HOT 2
- Blank headerView HOT 4
- Header Overlaps Statusbar in iOS10. HOT 4
- Adjust height Dynamically HOT 9
- Header view label HOT 1
- Navbar Button issues in iPhone X HOT 1
- GSKStretchyHeaderView in Swift 4.1 with storyboad. HOT 3
- Header always collapse when set ContentInset for TableView HOT 2
- GSKStretchyHeaderView issue with insert or delete rows. HOT 1
- Redraw issue when in inactive tab HOT 5
- Refresh Control? HOT 2
- Refresh control above header?
- GSKStretchyHeaderView overlaps tableView and has no height HOT 1
- GSKStretchyHeaderView - Xamarin iOS HOT 1
- Drop shadow issue
- TableView section grouped HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gskstretchyheaderview.