iOS随记

ios 10 访问设置问题

从ios8之api支持访问设置通过访问UIApplicationOpenSettingsURLString来跳转设置

 NSURL*url=[NSURL URLWithString:UIApplicationOpenSettingsURLString];
    if( [[UIApplication sharedApplication]canOpenURL:url] ) {
        [[UIApplication sharedApplication]openURL:url options:@{}completionHandler:^(BOOL success) {
            
        }];
    }
    

但是如果直接这样设置会闪退,原因是因为没有开启某项权限,只有开启权限后才能正常跳转所以需要自己稍作处理。

gitbook

https://git-scm.com/book/zh/v1/Git-基础-远程仓库的使用

删除tag

git tag -d

git push origin :refs/tags/

Masonry

Aspect retio

            make.width.equalTo(_drawView.mas_height).multipliedBy(width);

pod

target 'JspatchPro' do
pod 'JSPatchPlatform'
end

pod install 出现 Include of non-modular header inside framework module 解决方法 先把出现问题的pod 删除 执行 pod install 然后在写入 再次 pod install解决

pod repo update 更新远程pod

资源

http://blog.cnbang.net/archives/

制作动态库

新建工程frameWork 真机模拟器分别编译

合并framework中的库

lipo -create 真机 模拟机 路径 -output 路径

lipo -info 路径 查看信息

ios 音视频被打断通过设置AVAudioSessionInterruptionNotification来监听


 [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleAudioSessionInterruption:)
                                                 name:AVAudioSessionInterruptionNotification
                                               object:nil];


- (void)handleAudioSessionInterruption:(NSNotification*)notification {
    __weak typeof(self)weakSelf = self;

    NSNumber *interruptionType = [[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey];
    NSNumber *interruptionOption = [[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey];
    
    
    switch (interruptionType.unsignedIntegerValue) {
        case AVAudioSessionInterruptionTypeBegan:{
            // • Audio has stopped, already inactive
            // • Change state of UI, etc., to reflect non-playing state
            [weakSelf leaveStreaming];

        } break;
        case AVAudioSessionInterruptionTypeEnded:{
            // • Make session active
            // • Update user interface
            // • AVAudioSessionInterruptionOptionShouldResume option
            if (interruptionOption.unsignedIntegerValue == AVAudioSessionInterruptionOptionShouldResume) {
                // Here you should continue playback.
                [[AVAudioSession sharedInstance] setActive:YES error:nil];
              
             }
        } break;
        default:
            break;
    }
}

开启itunnes 共享

Application supports iTunes file sharing YES

苹果文档

https://developer.apple.com/library/content/navigation/#section=Resource Types&topic=Guides

原文地址:https://www.cnblogs.com/keyan1102/p/7197767.html