This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Endpoint.swift | |
// | |
// Created by ben | |
// Copyright © 2017年 popochess. All rights reserved. | |
// | |
import UIKit | |
import Alamofire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableArray *list = [NSMutableArray array]; | |
[list addObject:[NSNumber numberWithDouble:7.92]]; | |
[list addObject:@{@"my_key":@"my_value"}]; | |
[list addObject:@"test string"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NSURLConnection sendAsynchronousRequest:request | |
queue:[NSOperationQueue mainQueue] | |
completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) | |
{ | |
//do something you want | |
} | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)goSecondView | |
{ | |
NavSecondController *secondView = [[NavSecondController alloc] initWithNibName:@"NavSecondController" bundle:nil]; | |
[secondView setTitle:@"Second View"]; | |
[self.navigationController pushViewController:secondView animated:YES]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
[button addTarget:self action:@selector(goSecondView) forControlEvents:UIControlEventTouchDown]; | |
[button setTitle:@"Second View" forState:UIControlStateNormal]; | |
button.frame = CGRectMake(110, 150, 100.0, 40.0); | |
[self.view addSubview:button]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a ViewController | |
NavRootViewController *navViewController = [[NavRootViewController alloc] initWithNibName:@"NavRootViewController" bundle: nil]; | |
//Use navRootViewController as its root Controller | |
UINavigationController *rootController = [[UINavigationController alloc] initWithRootViewController:navViewController]; | |
//set the navigation bar title | |
[navViewController setTitle:@"Root View"]; | |
self.window.rootViewController = rootController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a ViewController | |
NavRootViewController *navViewController = [[NavRootViewController alloc] initWithNibName:@"NavRootViewController" bundle: nil]; | |
//Use navRootViewController as its root Controller | |
UINavigationController *rootController = [[UINavigationController alloc] initWithRootViewController:navViewController]; | |
//set the navigation bar title | |
[navViewController setTitle:@"Root View"]; | |
self.window.rootViewController = rootController; |
NewerOlder