public func isValidPassword(strPassword : String) -> Bool{ let charactersetspecialcharacter = CharacterSet(charactersIn: “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLKMNOPQRSTUVWXYZ0123456789”) if strPassword.rangeOfCharacter(from: charactersetspecialcharacter.inverted) == nil { return false } let capitalLetterRegEx = “.*[A-Z]+.*” let textcapitallattertest = NSPredicate(format:”SELF MATCHES %@”, capitalLetterRegEx) …
Technology
Image Caching With AFNetworking causes memory warning in UICollectionView
We have use SDWebImage instead of AFNetworking to handle memory warning. You can find swift code from below link. here is below code: [imageView sd_setImageWithURL:[NSURL URLWithString:@”http://www.domain.com/path/to/image.jpg”] placeholderImage:[UIImage imageNamed:@”placeholder.png”]]; // Some time may possible that this cause memory warning than use below code to overcome(This causes …
UIView Extension with support CornerRadius, borderWidth, borderColor, roundCorners, shadowColor, shadowOpacity, shadowOffset, shadowRadius.
While we want to set uiview property (like CornerRadius, borderWidth, borderColor, roundCorners, shadowColor, shadowOpacity, shadowOffset, shadowRadius) at that time we use code or user defined runtime attribute for that but using this extension we can esily update property from attribute inspector. code support SWIFT 3.0 …
Switching View controller
Issue: I have three View Controller class and also have one navigation Controller . I have push from second view controller class to third view controller class and when back form third view controller that time it is every time pop to second view controller …
GPUImage New Distortion Filter
Touch Moved Method in our View Controller -(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { if (TouchEnable) { UITouch *touch = [touches anyObject]; CGPoint touchPoint = [touch locationInView:_img_view]; @autoreleasepool { double dx = fabs(BeginPoint.x – touchPoint.x); …
Openurl freezes app for approx 10 seconds
We have resolved this issue using performselector and inside that method use dispatch_async. [self performSelector:@selector(methodToRedirectToURL) withObject:url afterDelay:0.1]; -(void)methodToRedirectToURL{ dispatch_async(dispatch_get_main_queue(), ^{ [[UIApplication sharedApplication] openURL:url]; }); }
Memory Warning in UICollectionView (with high resolution images)
We have generated thumbnail images for UICollectionView. When we want to show the large image at that time only we are loading the full-size image, it will reduce memory load and your app will work smoothly.
Not getting all albums using ALAsset library in iOS-8 and above
– Use photos framework instead of ALAsset library. – You will get all albums in smartAlbums & userCollections. – If you want the albums which contain at least 1 photos refer below code. – This code will work on swift. var arrAlbums: [PHCollection]! = Array() …
Openfire offline notification through PHP
Question We have installed Openfire 3.10.2 on Ubuntu 12.04. Chat is working fine and for offline message management I have installed the CallbackOnOfflineplugin. When the recipient is offline, a url is called. The plugin loads the url from the plugin.callback_on_offline.url property, adds ‘to’ and ‘from’ …
Get last Last Logout details openfire using REST API
Problem :- We do have functionality for offline group push notification from server end. Application is open and go to the group message tab. Now send a message to the group so, other users of group will get message i sent. By closing (kill or …