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

Custom Design #2

Open
velikanov opened this issue Dec 18, 2015 · 7 comments
Open

Custom Design #2

velikanov opened this issue Dec 18, 2015 · 7 comments

Comments

@velikanov
Copy link
Owner

Migrated Issue (yankodimitrov#25)

@kiokumicu commented on Oct 19

Hi!
I compile framework with Carthage, and add PasscodeLockView.xib, PasscodeSignButton.swift, PasscodeSignPlaceholderView.swift to project.
For PasscodeLockView.xib set owner PasscodeLockViewController class.
After compile passcode show normal, but after tap on number pad got error "PasscodeLock was compiled with optimization - stepping may behave oddly; variables may not be available."
What am i doing wrong ?

@guidelfrate commented on Oct 27

Same problem here! :/
Seems to be something related to the placeholders. I checked all connections and everything is fine.

@gblotter commented on Oct 27

I've been seeing similar weirdnesses and there actually is an open radar: https://openradar.appspot.com/23114017

@guidelfrate commented on Oct 27

@gblotter, really there is a problem with @IBInspectable and @IBDesignable. But I think I solved this copying PasscodeSignButton.swift and PasscodeSignPlaceholderView.swift to my project.

Now my XIB have correct buttons and placeholder, and I can change its properties in Interface Builder, but exactly how @kiokumicu said, I got the error when I tap on any number.

No errors are throw when I use the same XIB on Demo Project. What are we missing?

@guidelfrate commented on Oct 28

I found a temporary solution: using Carthage, I replaced the PasscodeLockView.xib found in /Carthage/Checkouts/SwiftPasscodeLock/PasscodeLock by my custom XIB. Then I compiled the framework again using carthage build. Remember to remove your custom XIB from your project, since it is embedded directly in the framework now.

As alternative, you can add a Run Script build phase that invokes Carthage like so:
/usr/local/bin/carthage build --platform "$PLATFORM_NAME" "$SRCROOT".

For now it works, but it should work as described out of box. I'm looking forward for a definitive solution. :)

@velikanov commented an hour ago

have anybody a working example of extending the PasscodeLockView.xib?
I just don't understand what I need to do to make this happen

@velikanov velikanov changed the title Custom Design #25 Custom Design Dec 18, 2015
@ziogaschr
Copy link
Collaborator

This is not hard, and once you have it working everything is easy. I don't have the time now for making an example but if you are able to share one with me, I will help you to make it happen.

@velikanov velikanov added this to the 1.0.5 milestone Dec 21, 2015
@kiokumicu
Copy link

Now I have another error with custom PasscodeLockView.xib when tap on on any number
fatal error: NSArray element failed to match the Swift Array Element type
Install from cocoapods and add PasscodeSignButton.swift, PasscodeSignPlaceholderView.swift files to project

@younanjo
Copy link

younanjo commented Mar 8, 2016

i tried this too @ziogaschr . it's not clear how custom design should work. copying the xib file and then you're on your own with all kinds of errors as @kiokumicu mentioned

  1. copy the xib file named PasscodeLockView.xib
  2. change the owner of xib file to PasscodeLockViewController
  3. connect view outlet to ?
    n) ...?

any idea on what the steps should be?

@younanjo
Copy link

To get custom design working ensure that:

All Buttons and Placeholders are given the Module of PasscodeLock in addition to ensuring the File Owner of your custom PasscodeLockView.xib is PasscodeLockView and module being PasscodeLock.

@kiokumicu
Copy link

Yeah, @younanjo was right, I set for all buttons module PasscodeLock and it's work )
Thx!

@antonigiske
Copy link

I love you, @younanjo. The README should be updated with this information. I've spent hours on this.

@ziogaschr
Copy link
Collaborator

I have added a custom .xib file in the demo app at PR #27. Please let me know if you think this is enough in order to close this issue

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

No branches or pull requests

5 participants