Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olddonkey/ODUIThreadGuard
A guard to help you check if you make UI changes not in main thread
https://github.com/olddonkey/ODUIThreadGuard
Last synced: about 1 month ago
JSON representation
A guard to help you check if you make UI changes not in main thread
- Host: GitHub
- URL: https://github.com/olddonkey/ODUIThreadGuard
- Owner: olddonkey
- License: mit
- Created: 2016-12-23T06:38:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T00:46:19.000Z (over 7 years ago)
- Last Synced: 2024-12-01T22:03:39.829Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 734 KB
- Stars: 682
- Watchers: 8
- Forks: 24
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - ODUIThreadGuard - A guard to help you check if you make UI changes not in main thread. (Code Quality)
- awesome-ios-star - ODUIThreadGuard - A guard to help you check if you make UI changes not in main thread. (Code Quality)
README
# ODUIThreadGuard
>ODUIThreadGuard is a guard to help check if you make UI changes not in main thread.>As Xcode 9 embedded this function into Xcode, there is no reason to maintain this project in the feature, Happy Coding.
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
![CocoaPods Support](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg)
![Swift Version](https://img.shields.io/badge/Swift-3.0-orange.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)ODUIThreadGuard is a guard to help check if you make UI changes not in main thread.
Highly recommend you add this file to your project as early as possible.![ScreenShot](DemoScreenShot.jpeg)
## Features
- [x] Passive implementation
- [x] Throw an assertion if setNeedsDisplay, setNeedsLayout, or setNeedsDisplayInRect: is called for instantiation of any UIView
- [x] Get the thread stack to help you locate where you make the mistake## Usage
No matter which way you use ODUIThreadGuard, no need to import any files, it is a extension of UIView, so it will work automatically.
#### CocoaPods
You can use [CocoaPods](http://cocoapods.org/) to install `ODUIThreadGuard` by adding it to your `Podfile`:```ruby
platform :ios, '8.0'
use_frameworks!
pod 'ODUIThreadGuard'
```Then drop ODUIThreadGuard.swift into your porject.
#### Carthage
Create a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/YourLibrary.framework` to an iOS project.```
github "olddonkey/ODUIThreadGuard"
```
#### Manually
1. Download and drop ```ODUIThreadGuard.swift``` in your project.
2. Congratulations!You can change the pre compile flag to change the setting, in default, this only runs in DEBUG mode, so won't affect users in Release.
## Requirements
- iOS 8.0+
- Swift 3The main development of ODUIThreadGuard is based on Swift 3.
### Contact
Follow and contact me through email: [email protected]. If you find an issue, just [open a ticket](https://github.com/olddonkey/ODUIThreadGuard/issues/new) on it. Pull requests are warmly welcome as well.
### License
ODUIThreadGuard is released under the MIT license. See LICENSE for details.