PIC18f4550 led blinking with push button

Hi. I am really new in PIC, i try to make a simple led blinking with push button. I use sk40c with PIC18f4550 and mikroC for PIC. Below is the code:
sbit LED1 at RA1_bit;
sbit sw1 at RB0_bit;
void main(){
TRISA1_bit = 0;
TRISB0_bit = 0xFF;
LED1 =0;
sw1 = 0;
while(1){
if (sw1==1)
{
LED1 = ~LED1;
Delay_ms(1000);
}
}}
i try to use push button on RB0, when RB0 is pushed, the led will start blinking, but it still cannot do what i want. can someone taught me what is wrong in my code?? Thanks in advance.
sbit LED1 at RA1_bit;
sbit sw1 at RB0_bit;
void main(){
TRISA1_bit = 0;
TRISB0_bit = 0xFF;
LED1 =0;
sw1 = 0;
while(1){
if (sw1==1)
{
LED1 = ~LED1;
Delay_ms(1000);
}
}}
i try to use push button on RB0, when RB0 is pushed, the led will start blinking, but it still cannot do what i want. can someone taught me what is wrong in my code?? Thanks in advance.