Giter Site home page Giter Site logo

Implementing in Swift about onboard HOT 16 CLOSED

mamaral avatar mamaral commented on July 24, 2024
Implementing in Swift

from onboard.

Comments (16)

inadeem avatar inadeem commented on July 24, 2024 2

@eeschimosu - Take a look at this:

https://github.com/seanicus/Onboard

from onboard.

mamaral avatar mamaral commented on July 24, 2024

Take a look at the demo project in objective-c, you should be able to just port that to swift pretty easily.

from onboard.

inadeem avatar inadeem commented on July 24, 2024

Thanks! Taking a look at them now.

Do I need to use CocoaPods? I see in the tutorial that I can just drag the source files, but does that apply to Swift as well?

from onboard.

mamaral avatar mamaral commented on July 24, 2024

There is currently not a swift version - but you can use either CocoaPods or manually copy the objective-c code into a swift project and you should be able to use it anyway.

from onboard.

inadeem avatar inadeem commented on July 24, 2024

Any tutorials on exactly what to copy into the Swift Project? There's just a lot of code in the demo. Reading through it, but having trouble implementing into my project.

from onboard.

mamaral avatar mamaral commented on July 24, 2024

4 files - OnboardingContentViewController and OnboardingViewController .h and .m files.

from onboard.

inadeem avatar inadeem commented on July 24, 2024

@mamaral I got that, but I'm having trouble with the: "Create individual pages by creating instances of OnboardingContentViewController" part.

I'm creating the instances in the appdelegate.swift file, similiar to what you did. But it won't let me. Also having trouble importing the header files into the appdelegate.swift.

from onboard.

mamaral avatar mamaral commented on July 24, 2024

I'm assuming it won't let you because you can't import the headers?

from onboard.

inadeem avatar inadeem commented on July 24, 2024

ok, so I got it working with my project in Swift!

How would I get it so that when the button is pressed, it takes the view to my Login Screen rather than a View that was made through code?

I basically want it to go to "LoginVC" , that I made in Storyboard, once the button is pressed

from onboard.

inadeem avatar inadeem commented on July 24, 2024

I'm currently using the following code:

//****
var nextView: LoginVC = self.storyboard?.instantiateViewControllerWithIdentifier("LoginVC") as! LoginVC
let appdelegate = UIApplication.sharedApplication().delegate as! AppDelegate
appdelegate.window!.rootViewController = nextView

//****
But I get an error stating :
"AppDelegate does not have a member named storyboard"

from onboard.

mamaral avatar mamaral commented on July 24, 2024

Sounds like your AppDelegate doesn't have a storyboard property... Also, assuming this code is in the AppDelegate, you shouldn't need let appdelegate = UIApplication.sharedApplication().delegate as! AppDelegate, you should be able to just use self.window!.rootViewController = nextView, no?

from onboard.

inadeem avatar inadeem commented on July 24, 2024

I added:

var storyboard : UIStoryboard?

and then did what you suggested.
Unfortunately, when I click the button to show the Login Page, I get a warning stating : "Thread1: EXC_Bad_Instruction (code = EXC_1386_INVOP, subcode =0x0) " that points to the :

"var nextView: LoginVC = self.storyboard?. instantiate...." line

from onboard.

mamaral avatar mamaral commented on July 24, 2024

I don't know what that storyboard var is supposed to be, but the issue appears to be there and not with Onboard. I haven't spent much time with Swift or storyboards to know what the issue might be.

from onboard.

inadeem avatar inadeem commented on July 24, 2024

Got it to work! Very smooth transitions. Love it.

Now time to figure out the NSdefaults so it shows up only once.

from onboard.

mamaral avatar mamaral commented on July 24, 2024

Cool!

from onboard.

eeschimosu avatar eeschimosu commented on July 24, 2024

Can you share how you got it to work?

from onboard.

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.