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.
iPhone
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() …
Group Joining Xmpp : Getting all messages every-time after joined group.
Hello, After deep look on group joining method of XMPP, we found one solution is describe here: let objXmppStream = XMPPStream() let objGroup = “YourGroupname@YourXMPPHOST” let roomStorage = XMPPRoomMemoryStorage() let roomJID = XMPPJID.jidWithString(objGroup) let objXmppChatRoom = XMPPRoom(roomStorage: roomStorage, jid: roomJID, dispatchQueue: dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)) objXmppChatRoom.activate(XMPPHelper.sharedInstance.objXmppStream) objXmppChatRoom.fetchConfigurationForm() let …
Use closure when doing some heavy operation in app
its better to use closure because its work in background but it stores strong reference of object so whenever operation finish you get data back and also after that you make an operation on data. Example code func retrivingData(completion : (()->())){ // do opearation completion(data) } …
UILabel with text of two different colors
Problem: I want to display a string like this in a UILabel: Where the number 5 is red in color and the rest of the string Solution: NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithAttributedString: label.attributedText]; [text addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(10, 1)]; [label setAttributedText: text]; OR NSMutableAttributedString …
Get orientation from video or thumb obtained with AVAssetImageGenerator
Solution: Need to add following line under above method generator.appliesPreferredTrackTransform=true
Merge Audio with Video
To create app like Dubsmash. <https://itunes.apple.com/in/app/dubsmash/id918820076?mt=8> I have merged audio file of any dialogue or song with captured video. Check method to merge video with audio :- // MARK: – Merge Video func mergeVideoWithAudio() { let mutableComposition = AVMutableComposition() var mutableCompositionVideoTrack …
Swift : Nil Collision Operator ,Save Your iPhone app from random crashes.
Nil-Coalescing Operator: The nil-coalescing operator (a ?? b) unwraps an optional a if it contains a value, or returns a default value b if a is nil. The expression a is always of an optional type. The expression b must match the type that is …
Generating an NFT Dataset from the Digital Image.
Generate Artoolkit Marker you have to follow step Step 1: open terminal Step 2: reach folder where genTexData script located using cd command ex. cd /Desktop/bin/….(path) Step 3: ./genTexData pinball.jpg Step 4: Select extraction level for tracking features from 0,1 or 3 Step 5: Select …
Application is being rejected by Apple due to “LEGAL: INTELLECTUAL PROPERTY – APPLE PRODUCTS”
Under the apple review guidelines section 5.2.3 Audio/Video Downloading: Apps should not facilitate illegal file sharing or include the ability to save, convert, or download media from third party sources (e.g. Apple Music, YouTube, SoundCloud, Vimeo, etc.) without explicit authorization from those sources. Streaming of …