How to Design the Overlay Menu Above the Home Page

2019-09-20 17:29发布

How to Design the Overlay Instructions Above The View?

I HAD 6 buttons....For Each Button I have To show Overlay For That, Before i click on that Button

Suppose... 1) Click button is there...above the Click Button we need to show overlay for click on that button Like That...

**

[I Need Like This Overlay menu over the all Buttons][1]

[1]: http://i.stack.imgur.com/dIjRF.jpg

**

4条回答
你好瞎i
2楼-- · 2019-09-20 17:36

Use NSURLSession instead. NSURLConnection is deprecated.

NSString *stringURL = [NSString stringWithFormat:@"%@?term=%@", BASE_URL, _inputText.text];
NSURL *URL = [NSURL URLWithString:stringURL];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
        [request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionUploadTask *task = [session uploadTaskWithRequest:request fromData:yourData completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
                // Do your stuff here
            }];
查看更多
霸刀☆藐视天下
3楼-- · 2019-09-20 17:57

why not use alamofire---

                NSDictionary *parameters = @{
                  @"email":  @"myemail1@mailinator.com",
                  @"password": @"123456789",
                  @"accountnumber": @"LiM6N5gBBmqdlQBJGkqcP0h4OKwGbnzoWFcgTG3Z",
                  @"ifcscode": @"ABC"
                };


                NetworkHandler *networHandler = [NetworkHandler sharedInstance];
    [networHandler composeRequestWithMethod:@"http://example.com/enpoint.json"
                                    paramas: parameters
                               onComplition:^(BOOL success, NSDictionary *response){

                                   if (success) { //handle success response

                                       [self handleLoginResponse:response];
                                   }
                                   else{

                                       ProgressIndicator *pi = [ProgressIndicator sharedInstance];
                                       [pi hideProgressIndicator];
                                   }

                               }];

you can use postman to check your api

查看更多
▲ chillily
4楼-- · 2019-09-20 17:57

Send Parameter to web service using POST method

Below is code to POST data to web service using NSURLConnection.

-(void)postData
{
    NSString *content = [NSString stringWithFormat:@"email=%@&name=%@",textEmail.text,textName.text];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:@"your web service url"]];
    [request setHTTPMethod:@"POST"];
    [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]];
    [NSURLConnection connectionWithRequest:request delegate:self];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    dictJson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSLog(@"Dict Json :- %@",dictJson);   
}
查看更多
干净又极端
5楼-- · 2019-09-20 17:58

Pass this two variables of FirstViewController to SecondViewController and then try to put below code in place of your code.

Below is code to POST data using NSURLSession.

I hope this works for you.

-(void)postData
{
    NSString *content = [NSString stringWithFormat:@"Name=%@&Email=%@&A/CName=%@&A/CNumber=%@&IFSCCode=%@&TypeOfAccount=%@",name,email,acName,acNumber,ifscCode,typeOfAccount];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:@"your web service url"]];
    [request setHTTPMethod:@"POST"];
    [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSession *session = [NSURLSession sharedSession];
    [[session dataTaskWithURL:[NSURL URLWithString:londonWeatherUrl]
            completionHandler:^(NSData *data,
                          NSURLResponse *response,
                          NSError *error) {

            NSMutableDictionary *dictJson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
            NSLog(@"Dict Json :- %@",dictJson);   

    }] resume];
}
查看更多
登录 后发表回答