Posts

iOS constraint guidelines

Solution: Constraint are very easy if you understand that with logically.First you have to think your need for design then proceed that. It had an alignments that with left,right,top,bottom also width,height and center of the view. If your view wants to be aligned left then first set the left,top and bottom.If the width varies based on the view then don't set the width.Also height too... If your two views or buttons wants to be the same width.then select both the views and select that option called equal width. If you wants that view wants to be aligned vertically or horizontally to the superview then select the view and check the options.

iOS tab bar did select in second time image goes to smaller in tab Bar controller

Solution: If you are setted the insets in storyBoard you want to set in both sides.Like if you set the inset in bottom 2 then set the top to -2 (or) if you set the left to 2 then set right to -2. It will solve your problem.Also check that if you set the image in didselect then it might be the problem.So check carefully to set the different image when select the tab bar. Also check the constraints.

Create IPA in Xcode

Solution: Apple had a magic technics for distribution.They had the tool named testFlight with internal and external testers to review the app and testing purpose. If you want to distribute an app with other then you have to export the IPA file with it's provisioning profiles and upload it to Diawi or some other sites then send the link to the customer or tester. And one more if you had a enterprise account it's very easy you can export the app and upload it to your website and send the link to the tester.

Change the dictionary Value in an array iOS swift

Solution: In NSDictionary you cannot be able to change the value.If you can convert the NSDictionary to NSMutableDictionary then you can change the value in it.              var dic =  dataArray . object (at: 0 ) as ! NSDictionary             let mute = NSMutableDictionary ()             mute. addEntries (from: dic as ! [ AnyHashable : Any ])                  mute. setValue ( "value" , forKey: "keyValue" )             self . dataArray . replaceObject (at: 0, with: NSDictionary (dictionary: mute))

Set the slider value based on the AVAudiosession volume || mobile system volume based slider change in iOS swift

Solution: If you are adjusting the volume in your phone volume button based on slider change you can follow the below steps     override func viewDidDisappear( _ animated: Bool ) {         AVAudioSession.sharedInstance().removeObserver( self , forKeyPath: "outputVolume" )         do { try AVAudioSession.sharedInstance().setActive( false ) }         catch { debugPrint( " \ ( error )" ) }     }          func listenVolumeButton() {         let audioSession = AVAudioSession.sharedInstance()         do {             try audioSession.setActive( true )         } catch {             print( "some error" )         }         audioSession.addObserver( self , forKeyPath: "outputVolume" , opt...

How to disable the selection in TableView iOS swift?

Solution: If you want to disable the selection for entire tableView then use the below code for that. tableView.allowsSelection = NO; Or you can use the below code cell.selectionStyle = UITableViewCellSelectionStyle.None If you want to disable the selection for particular row you can do that in cell for row function disable the userinteraction for the cell. Cell. UserInteractionEnabled = false

How to embed custom font in iPhone application?

Solution: Xcode 10 or greater if you add the font files into the project and it will be added directly when you try to set font in storyboard it will be listed. But in previous time it was not possible.First you have to add the font file to your project. After that open the Info.plist file and set the key named  UIAppFonts change the datattype to array and set the each fontfilename into that you had added already. Save the Info.plist file [UIFont fontWithName:@"CustomFontName" size:12]   Then use the font as above.