d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Trying To Figure Out Swift / Objective C > Could Use Some Help (i'm A Rookie..)
Add Reply New Topic New Poll
Member
Posts: 1,337
Joined: Feb 7 2011
Gold: 0.85
Oct 26 2015 05:37am
I just read about classes etc...

What I'm trying to do for my very first project in Swift.. is to make a "textfield box" and if you type in 50 or more and puss a button, it will print on the screen: "you made it" and after congrats you and proceed to level 2 = a new page.


I know I'm not close at all.. but this is what I came up with so far... (I just started to learn by myself to program... so please bare that in mind... I know this is all shit to be honest..)

So this is what I could think of:
class Shots {

let hots: UInt8

init() {

}
if hots >= 50 {
print("you made it") // also thought if it prints you made it... somehow it should use the func.sayCongrats...
} else {
print("you failed")
}
func sayCongrats() {
print("YAY! level 2")
}
}


could anybody help me out with explaining what I'm doing wrong and what I need to add.. etc..
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll