Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble importing into ObjectiveC project #45

Open
danielkramer opened this issue Oct 11, 2015 · 1 comment
Open

Trouble importing into ObjectiveC project #45

danielkramer opened this issue Oct 11, 2015 · 1 comment

Comments

@danielkramer
Copy link

This probably isn't a TZStackView issue, but my own ignorance on this one. I have an objective c project and am trying to import TZStackVew. I've read up on the Autogenerated header but it's never generated for me. Here's what I've done

Dragged the following to my project
TZSpacerView.swift
TZStackView.h
TZStackView.swift
TZStackViewAlignment.swift
TZStackViewDistribution.swift

My understanding is a header is auto generated allowing me to access these. I am able to compile with these in my project as long as I don't use them in any way. I'm not seeing any auto generated header.

After searching around the internet for help I go to build settings and under packaging look at "Product Module Name" and "Product Name", they are actually blank if I'm looking at the global project. If I click on my targets (I have 2, one for a free ver of my app and one for a paid) I see "Upwords" and "Upwords_Free" for the free one.

I've tried

import "Upwords-Swift.h"

or

import "Upwords_Free-Swift.h"

I also tried typing in an arbitrary name at the project level (not the targets) and no luck there either.

The headers are never found. I know this isn't really your issue.. but if you have a quick answer I'd appreciate it. I noticed I can build a framework from your project. I did try building one and dragging that in but didn't help either. My first toe dip into swift

Thanks for any pointers
Daniel

@danielkramer
Copy link
Author

Ok, think I spoke too soon. Checked my other target and it did work and found that my free target didn't include all the swift files in the "compile sources" section. I did get some errors though about some constraints not available in ios7 and had to wrap them like

if #available(iOS 8.0, *) {
                    stackViewConstraints.append(constraint(item: self, attribute: .BottomMargin, toItem: spacerViews[0]))
                } else {
                    // Fallback on earlier versions
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant