![](https://img-blog.csdnimg.cn/20210413133843697.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
ios
ios 基础
less more
少则多,简则精
展开
-
UIImageView图片的两种加载方式
版权声明:本文为延成原创文章,转载请标明出处第一种方式:imageName:就算指向它的指针被销毁,该资源也不会被从内存中干掉放到Assets.xcassets的图片,默认就有缓存图片经常被使用第二种方式:imageWithContentsOfFile:指向它的指针被销毁,该资源会被从内从中干掉放到项目中的图片不带有缓存不经常用,大批量的图片...原创 2020-01-15 15:17:44 · 757 阅读 · 0 评论 -
UIWindow
版权声明:本文为Mr.release原创文章,转载请标明出处UIWindow是一种特殊的UIView,通常在一个app中只会有一个UIWindowiOS程序启动完毕后,创建的第一个视图控件就是UIWindow,接着创建控制器的view,最后将控制器的view添加到UIWindow上,于是控制器的view就显示在屏幕上了#import <UIKit/UIKit.h>@i...原创 2019-11-07 11:29:36 · 188 阅读 · 0 评论 -
ViewController
版权声明:本文为延成原创文章,转载请标明出处#import "ViewController.h"#import "ViewController2.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; ...原创 2019-11-07 15:53:40 · 589 阅读 · 0 评论 -
UITableView
版权声明:本文为延成原创文章,转载请标明出处ViewController.h#import "ViewController.h"#import "TestTableViewCell.h"#import "UILableViewController.h"#import "UIButtonViewController.h"#import "UIViewViewController....原创 2019-11-08 15:48:58 · 82 阅读 · 0 评论 -
照片墙
版权声明:本文为延成原创文章,转载请标明出处VCImageShow.m#import "VCImageShow.h"#import "VCImage.h"@interface VCImageShow (){ UIScrollView* _sv;}@end@implementation VCImageShow- (void)viewDidLoad { ...原创 2019-11-14 14:00:11 · 485 阅读 · 0 评论 -
NSUserDefaults
版权声明:本文为延成原创文章,转载请标明出处 NSUserDefaults* ud = [NSUserDefaults standardUserDefaults]; if (btn.tag == 101) { [ud setObject:@"Xiaoming" forKey:@"Name"]; [ud setBool:YES forKey:@"isNa...原创 2019-11-14 15:33:29 · 160 阅读 · 0 评论 -
plist文件存储及字典转模型
版权声明:本文为延成原创文章,转载请标明出处#import "YCDictionaryToModel.h"#import "YCPerson.h"@interface YCDictionaryToModel ()@property(nonatomic,strong)NSArray* ceshiArray;@property(nonatomic,strong)NSArray* dataArr;@end@implementation YCDictionaryToModel/** .原创 2020-07-11 10:31:55 · 217 阅读 · 0 评论 -
界面传值的方式
iOS传值的方式属性传值(正向传值)方法传值(正向传值)代理传值block属性传值(反向传值)block方法传值(反向传值)KVO(反向传值)KVC(正向传值)通知notification单例模式方式UserDefault或者文件方式代码示例图: 代码详情VCPassByValue.h#import <UIKit/UIKit.h>N...原创 2019-11-16 10:36:32 · 191 阅读 · 0 评论 -
JSON数据解析
版权声明:本文为延成原创文章,转载请标明出处-(void)parseJson{ //获取文件路径 NSString* path = [[NSBundle mainBundle]pathForResource:@"data" ofType:@"json"]; //返回二进制文件的格式数据 NSData* dataJson = [NSData dataWithCo...原创 2019-11-16 15:50:38 · 160 阅读 · 0 评论 -
NSURLSession/NSURLConnection(已过时)网络连接
版权声明:本文为延成原创文章,转载请标明出处#import "VCNSURLConnect.h"@interface VCNSURLConnect ()<NSURLConnectionDelegate,NSURLConnectionDataDelegate>{ NSURLConnection* _connect; NSMutableData* _data;...原创 2019-11-18 10:36:42 · 255 阅读 · 0 评论 -
NSThread多线程
版权声明:本文为延成原创文章,转载请标明出处#import "VCNSThread.h"@interface VCNSThread (){ NSArray* _titleArray; NSInteger* _counter; NSLock* _lock;}@end@implementation VCNSThread- (void)viewDidLoa...原创 2019-11-18 13:53:13 · 123 阅读 · 0 评论 -
NSOperation任务队列
版权声明:本文为延成原创文章,转载请标明出处#import "VCNSOperation.h"@interface VCNSOperation (){ NSArray* _titleArray; NSOperationQueue* _queue; }@end@implementation VCNSOperation- (void)viewDidLoa...原创 2019-11-18 14:34:24 · 137 阅读 · 0 评论 -
AFNetwork网络请求
版权声明:本文为延成原创文章,转载请标明出处#import "VCAFNetwork.h"#import <AFNetworking.h>@interface VCAFNetwork (){ NSArray* _titleArray; NSOperationQueue* _queue; AFHTTPSessionManager* manager;...原创 2019-11-18 16:00:35 · 592 阅读 · 0 评论 -
音频播放AVFoundation
版权声明:本文为延成原创文章,转载请标明出处#import "VCMusicPlayer.h"#import <AVFoundation/AVFoundation.h>@interface VCMusicPlayer ()<AVAudioPlayerDelegate>{ NSArray* _titleArray; UIProgressView*...原创 2019-11-19 10:25:35 · 375 阅读 · 0 评论 -
视频播放AVPlayerViewController
版权声明:本文为延成原创文章,转载请标明出处#import "VCVideoPlayer.h"#import <AVKit/AVKit.h>@interface VCVideoPlayer (){ AVPlayerViewController* _playController;}@end@implementation VCVideoPlayer- (...原创 2019-11-19 11:06:58 · 1883 阅读 · 0 评论 -
Animation动画
版权声明:本文为延成原创文章,转载请标明出处#import "VCAnimation.h"@interface VCAnimation (){ NSArray* _titleArray; UIImageView* _imageView;}@end@implementation VCAnimation- (void)viewDidLoad { [sup...原创 2019-11-19 14:39:01 · 15614 阅读 · 0 评论 -
UINavigationController导航控制器
版权声明:本文为延成原创文章,转载请标明出处AppDelegate.m#import "AppDelegate.h"#import "ViewController.h"@interface AppDelegate()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)applicati...原创 2019-11-08 15:55:14 · 169 阅读 · 0 评论 -
navigationController导航控制器动画
版权声明:本文为延成原创文章,转载请标明出处CATransition* _anim = [CATransition animation]; [_anim setDuration:1]; //动画的过渡方式 //kCATransitionPush 平移 //kCATransitionFade 渐变 //kCATransitionReveal 揭示(平移)...原创 2019-11-19 15:22:01 · 200 阅读 · 0 评论 -
UITabBarController分栏控制器
版权声明:本文为延成原创文章,转载请标明出处AppDelegate.m#import "AppDelegate.h"#import "ViewController.h"#import "HomeViewController.h"#import "PersonalViewController.h"@interface AppDelegate()<UITabBarContr...原创 2019-11-13 15:20:43 · 190 阅读 · 0 评论 -
UILabel
版权声明:本文为延成原创文章,转载请标明出处-(void)createUILable{ UILabel *cLable=[[UILabel alloc]init]; cLable.text=@"Hello World,my name is yancheng,my age 28"; cLable.textColor=[UIColor blackCol...原创 2019-11-07 14:54:56 · 110 阅读 · 0 评论 -
UIButton
版权声明:本文为延成原创文章,转载请标明出处 UIButton *cButton=[UIButton buttonWithType:UIButtonTypeRoundedRect]; cButton.frame=CGRectMake(100, 100, 100, 50); cButton.backgroundColor=[UIColor greenColor];...原创 2019-11-07 14:06:07 · 78 阅读 · 0 评论 -
UIImageView
版权声明:本文为延成原创文章,转载请标明出处//方式一:// UIImageView *imageView = [[UIImageView alloc]init];// imageView.image = [UIImage imageNamed:@"heart1"];////// imageView.frame = CGRectMake(0, 0, 300, 150);// imageView.frame = (CGRect){{0,0},{300,150}};原创 2020-07-10 10:51:09 · 215 阅读 · 0 评论 -
UIView
版权声明:本文为延成原创文章,转载请标明出处-(void)createUIView{ UIView *cView=[[UIView alloc]init]; cView.frame=CGRectMake(100, 100, 100, 200); cView.backgroundColor=[UIColor magentaColor]; cV...原创 2019-11-07 15:20:09 · 123 阅读 · 0 评论 -
NSTimer
版权声明:本文为延成原创文章,转载请标明出处-(void)initView{ UIButton * btn01 = [[UIButton alloc]initWithFrame:CGRectMake(150, 30, 120, 100)]; [btn01 setTitle:@"启动定时器" forState:UIControlStateNormal]; [b...原创 2019-11-08 17:11:53 · 133 阅读 · 0 评论 -
UISwitch
版权声明:本文为延成原创文章,转载请标明出处@interface UISwitchViewController (){ UISwitch* _cSwitch;}@end-(void)createUISwitch{ _cSwitch = [[UISwitch alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];...原创 2019-11-08 17:41:29 · 1136 阅读 · 0 评论 -
UISlide和UIProgressView
版权声明:本文为延成原创文章,转载请标明出处@interface UISlide_ProgressViewController (){ UISlider* _slide; UIProgressView* _progressView;}-(void)initView{ _slide = [[UISlider alloc]initWithFrame:CGRectMa...原创 2019-11-08 18:08:28 · 229 阅读 · 0 评论 -
UIStepper和UISegmentedControl
版权声明:本文为延成原创文章,转载请标明出处@interface UIStepper_UISegmentedControlViewController (){ UIStepper* _stepper; UISegmentedControl* _segmentControl;}-(void)initView{ _stepper = [[UIStepper all...原创 2019-11-08 18:33:00 · 193 阅读 · 0 评论 -
UIAlertController
版权声明:本文为延成原创文章,转载请标明出处#import "UIAlertViewController.h"@interface UIAlertViewController ()<UIAlertViewDelegate>{ UIButton* _alertBtn; UIAlertController* _alertController; UIA...原创 2019-11-11 11:34:01 · 630 阅读 · 0 评论 -
UITextField
版权声明:本文为延成原创文章,转载请标明出处#import "UITextFieldViewController.h"@interface UITextFieldViewController ()<UITextFieldDelegate>{ UITextField* _userName; UITextField* _password;}@end@i...原创 2019-11-11 13:59:22 · 159 阅读 · 1 评论 -
UIScrollView
版权声明:本文为延成原创文章,转载请标明出处#import "UIScrollViewViewController.h"@interface UIScrollViewViewController ()<UIScrollViewDelegate>{ UIScrollView* _sv;}@end@implementation UIScrollViewView...原创 2019-11-11 17:28:00 · 149 阅读 · 1 评论 -
UIGesture
版权声明:本文为延成原创文章,转载请标明出处#import "UIGestureViewController.h"@interface UIGestureViewController ()<UIGestureRecognizerDelegate>{ UIImageView* _imageView; CGPoint _lastPoint; UIPinc...原创 2019-11-12 16:41:23 · 125 阅读 · 0 评论 -
UITouch
版权声明:本文为延成原创文章,转载请标明出处-(void)initView{ _imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"guide_1"]]; _imageView.frame = CGRectMake(100, 100, 200, 340); [self.view add...原创 2019-11-12 15:24:46 · 109 阅读 · 0 评论 -
手动布局子视图
版权声明:本文为延成原创文章,转载请标明出处ManualLayoutViewController.m#import "ManualLayoutViewController.h"#import "SuperView.h"@interface ManualLayoutViewController ()@end@implementation ManualLayoutViewCo...原创 2019-11-13 09:55:17 · 139 阅读 · 0 评论 -
自动布局子视图
#import "AutoLayoutViewController.h"@interface AutoLayoutViewController (){ UIView* _superView; UILabel* _label01; UILabel* _label02; UILabel* _label03; UILabel* _label04; UI...原创 2019-11-13 10:46:16 · 92 阅读 · 0 评论 -
UiPickerView
版权声明:本文为延成原创文章,转载请标明出处#import "UiPickerViewController.h"@interface UiPickerViewController ()<UIPickerViewDelegate,UIPickerViewDataSource>@end@implementation UiPickerViewController- (v...原创 2019-11-14 14:58:50 · 510 阅读 · 0 评论 -
UICollectionView
版权声明:本文为延成原创文章,转载请标明出处VCUICollectionView#import "VCUICollectionView.h"#import "CollectionViewCell.h"@interface VCUICollectionView ()<UICollectionViewDelegate,UICollectionViewDataSource>...原创 2019-11-22 17:50:01 · 216 阅读 · 0 评论 -
WebView
版权声明:本文为延成原创文章,转载请标明出处#import "WebViewController.h"@interface WebViewController ()<UIWebViewDelegate>@end@implementation WebViewController- (void)viewDidLoad { [super viewDidLoad]...原创 2019-11-23 11:18:27 · 143 阅读 · 0 评论