iossinger / sgnetobserver Goto Github PK
View Code? Open in Web Editor NEWiOS完美的网络状态判断工具
License: MIT License
iOS完美的网络状态判断工具
License: MIT License
在后台运行一会儿(三五分钟),在切换进App就会崩溃,崩溃地方是scoket sendto 方法问题。
UIView *statusBar = [app valueForKeyPath:@"StatusBar"];
在iPhone X, 手机系统是12 beta5 上 崩溃了,请问大神怎么解决 知道不?
我用了之后碰到一个问题, 先说我的用法,我在基类控制器中添加监听网络,dealloc中移除监听,出现的问题是,随便进入项目中的一个页面,此刻锁屏,再解锁的时候,出出现异常,-[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] ** unhandled action ->{,黑屏,百度了下说是锁屏会导致项目中一些异步任务失败,然后我把基类中监听代码注释掉,锁屏之类的问题就没有,此种情况出现在iOS9,iOS10中 会锁屏 解锁有应用有时候重新启动,有时候正常显示在原来锁屏前的页面, 楼主,这种情况不知道你碰到过没有
wifi和4g切换的时候 状态没有改变
隐藏状态栏真的还可以获取到网络状态 ,我隐藏后networkView是nil
你这两个方法写的一样啊, 都是 start
- (void)startNotifier{
[self.hostReachability startNotifier];
[self.pinger startNotifier];
}
- (void)stopNotifier{
[self.hostReachability startNotifier];
[self.pinger startNotifier];
}
还有就是我想检测当前手机能不能连接到 google, 然后给我返回只是 wifi 网络, 并没有告诉我是不是通
- (SGNetObserver *)netObserver {
if (!_netObserver) {
_netObserver = [SGNetObserver observerWithHost:@"www.google.com"];
}
return _netObserver;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if ([[BONLocationManager manager] isChina]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(networkStatusChanged:)
name:SGReachabilityChangedNotification
object:nil];
[self.netObserver startNotifier];
}
}
- (void)networkStatusChanged:(NSNotification *)notify{
NSLog(@"notify-------%@",notify.userInfo);
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:SGReachabilityChangedNotification
object:nil];
[self.netObserver stopNotifier];
}
现在2g 给写成未知了,5g 也无法支持,能支持一下吗
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.