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
The reuse identifier is associated with a UITableViewCell object that the table-view’s delegate creates with the intent to reuse it as the basis (for performance reasons) for multiple rows of a table view. It is assigned to the cell object in initWithFrame:reuseIdentifier: and cannot be changed thereafter. A UITableView object maintains a queue (or list) of the currently reusable cells, each with its own reuse identifier, and makes them available to the delegate in the dequeueReusableCellWithIdentifier: method. |
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
AutoLayout, set frame within code. |
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
use below code. | |
+ (NSString*)currentDate | |
{ | |
NSDate *now = [NSDate date]; | |
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:now]; | |
NSDate *today = [calendar dateFromComponents:components]; | |
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setDateFormat:@"yyyy-MM-dd"]; |
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
actually there is no bug |
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
With "atomic", the synthesized setter/getter will ensure that a whole value is always returned from the getter or set by the setter, regardless of setter activity on any other thread. That is, if thread A is in the middle of the getter while thread B calls the setter, an actual viable value -- an autoreleased object, most likely -- will be returned to the caller in A. | |
In nonatomic, no such guarantees are made. Thus, nonatomic is considerably faster than "atomic". |
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
It should be use below code. | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]]; | |
self.alert.text = @"Thanks"; | |
}); |
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
Use: | |
NSURLSessionConfiguration:backgroundSessionConfiguration: | |
instead of | |
NSURLSessionConfiguration:defaultSessionConfiguration | |
From the NSURLSessionConfiguration:backgroundSessionConfiguration: documentation: | |
Upload and download tasks in background sessions are performed by an external daemon instead of by the app itself. As a result, the transfers continue in the background even if the app is suspended, exits, or crashes. | |
So in your case, change: |
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
// You have a very very large video file you need to upload to a server while your app is backgrounded. | |
// Solve by using URLSession background functionality. I will here use Alamofire to enable multipart upload. | |
class Networking { | |
static let sharedInstance = Networking() | |
public var sessionManager: Alamofire.SessionManager // most of your web service clients will call through sessionManager | |
public var backgroundSessionManager: Alamofire.SessionManager // your web services you intend to keep running when the system backgrounds your app will use this | |
private init() { | |
self.sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) | |
self.backgroundSessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.background(withIdentifier: "com.lava.app.backgroundtransfer")) |
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
Serial Keys: | |
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD | |
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD | |
GV7N2-DQZ00-4897Y-27ZNX-NV0TD | |
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0 | |
GZ3N0-6CX0L-H80UP-FPM59-NKAD4 | |
YY31H-6EYEJ-480VZ-VXXZC-QF2E0 | |
ZG51K-25FE1-H81ZP-95XGT-WV2C0 | |
VG30H-2AX11-H88FQ-CQXGZ-M6AY4 |
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
// Based on https://web.dev/mediastreamtrack-insertable-media-processing/ | |
// Uses Webcodecs API, which is supported only in Chrome as of November 2021 | |
function convertI420AFrameToI420Frame(frame) { | |
const { width, height } = frame.codedRect; | |
// Y, U, V, Alpha values are stored sequentially. Take only YUV values | |
const buffer = new Uint8Array(width * height * 3); | |
frame.copyTo(buffer, { rect: frame.codedRect }); | |
const init = { | |
timestamp: 0, |
OlderNewer