Git Product home page Git Product logo

Comments (14)

jamieomatthews avatar jamieomatthews commented on July 17, 2024

It should be possible, I actually haven't tried a project, but I will tonight. Have you imported objc code into swift before? If not definitely take a look at the guide here. I don't foresee any problems.

from flatuikit.

ShayanMahdavi avatar ShayanMahdavi commented on July 17, 2024

Yeah I've been able to import objc code into my swift just not with the flatuikit. I get some strange architecture errors when trying to compile say let alertview: FUIAlertView = FUIAlertView()

from flatuikit.

ShayanMahdavi avatar ShayanMahdavi commented on July 17, 2024

Hi Jamie, I was wondering if you actually were able to get the kit working with swift or what results you found?

from flatuikit.

jamieomatthews avatar jamieomatthews commented on July 17, 2024

@ShayanMahdavi Just setup a test project for this. (Empty project)

First, made sure I had a bridging header

Then, added

#import "FlatUIKit.h"

to the header.

Then from swift:

let alertView : FUIAlertView = FUIAlertView()

compiles fine. Make sure your minimum target is > iOS6, as flatuikit only supports down to iOS6.

from flatuikit.

ShayanMahdavi avatar ShayanMahdavi commented on July 17, 2024

Ok yeah I guess it wasn't a swift compatibility issue. Turns out my podfile wasn't configured properly with my project and was the reason we were getting linking errors upon use with the FlatUIKit. I instead just installed the kit manually and that seemed to work as a fix for me.

@jamieomatthews Thanks for looking into the issue with me!

from flatuikit.

jamieomatthews avatar jamieomatthews commented on July 17, 2024

@ShayanMahdavi np

from flatuikit.

zono avatar zono commented on July 17, 2024

I can use FlatUIKit normally except for FUIAlertView. I got a build error below when I initialize FUIAlertView.

Code

FUIAlertView(title: "a", message: "a", delegate: self, cancelButtonTitle: "a", otherButtonTitles: "a")

I got build error

Extra argument 'otherButtonTitles' in call

Any help will be appreciated. I posted my question to stackoverflow

Thanks

from flatuikit.

jamieomatthews avatar jamieomatthews commented on July 17, 2024

Have you tried it like this? This is a bug with swift interacting with obj c I believe

let alert = FUIAlertView()
alert.title = "Title"
alert.message = "Message"
alert.addButtonWithTitle("Ok")
alert.show()

from flatuikit.

zono avatar zono commented on July 17, 2024

@ShayanMahdavi Hi. Thanks for your reply. Yes I have tried that but it did not work. A transparent view was appeared on my viewcontroller but the dialog was not appeared.

from flatuikit.

bardonadam avatar bardonadam commented on July 17, 2024

Any chance to resolve issue with not appearing FUIAlertView?

When I defined few properties like this:

alert.titleLabel.font = UIFont.boldFlatFontOfSize(16)
alert.messageLabel.textColor = .cloudsColor()
alert.messageLabel.font = .flatFontOfSize(14)
alert.backgroundOverlay.backgroundColor = .cloudsColor()
alert.alertContainer.backgroundColor = .midnightBlueColor()

each line gives error:
fatal error: unexpectedly found nil while unwrapping an Optional value

from flatuikit.

jamieomatthews avatar jamieomatthews commented on July 17, 2024

@bardonadam how is alert defined?

from flatuikit.

bardonadam avatar bardonadam commented on July 17, 2024

@jamieomatthews same way as you shown in your comment

from flatuikit.

jamieomatthews avatar jamieomatthews commented on July 17, 2024

@bardonadam that code above worked file for me. Must be something about accessing title labels, etc that is crashing. Feel free to open a seperate issue

from flatuikit.

sammygutierrez avatar sammygutierrez commented on July 17, 2024

@y-zono Did you ever figure out a solution to your problem? I'm having the same issue with FUIAlertView.

from flatuikit.

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.