Posts

Showing posts from December, 2019

How to remove cocoapods from project iOS swift? || xcode remove pods from project

Image
Solution: 1. Open the terminal app from applications. 2. Goto the project path in terminal.Just drag and drop the project folder to terminal 3. In terminal use the code be like. cd yourprojectfolderpath After that execute the below code step by step to deintegrate the cocoapods in your project.             $s udo g em i nstall c ocoapods- d eintegrate cocoapods- c lean             $p od d eintegrate             $p od c lean              $r m P odfile

Update the cocoapods in MACOS

Solution: Goto terminal and use the below command to update the cocoapods in macOS. sudo gem install cocoapods

How to update Xcode on OSX version in mac?

Solution: You can easily update the xcode version in mac. Goto applications in MAC or otherwise it will be placed on desktop doc panel. Click the top right corner updates button. It will show you the updates available for mac. Find the xcode on the list and select update.XCode will be updated.

Xcode error. Could not find developer disk image when try to run to iPhone

Solution: If your device contains latest os version and your xcode is old then the above error will be occurs. Download the latest xcode version and install it and run it. Right click on your xcode in applications and select show package contents -> Content ->Developer ->Platform ->iphoneOS.Platform ->Device support .If it will contains the folder with your phone os version then only it will works.Download and install to happy coding.....

Develop iOS apps in windows machine

Solution: It is definitely possible but you must have high configuration machine with you. First you have to install wine app in your windows machine. After that you must install the macOS inside your wine.Then install xcode on mac after that you can easily develop the iOS apps.

How to disable the tableView selection in iOS swift

Solution: You can disable the did select option in tableView iOS swift.             myTable.allowsSelection = false It will disable selection for entire tableView.Didselect delegate method never works when added the above code.Inside the cell if you had any buttons then the action will work.But cell selection tableView only not work.

Image icons for iOS

Solution: If you are using common images then you can easily download in the web.Use the below link. https://material.io/resources/icons/?style=baseline Use search to search the icon.If you want filled,outlined or rounded select based on your requirement. Click select icon In dropdown select iOS and select white or empty background and download. extract the zip file and it will show you 18,24,32,48 icons.Drag on that and drop into your assets folder then use it in your app.

iOS huge image load issue lagging

Solution: If you are downloading huge amount of images and display in your view then don't load the view in for loop based on the count. Must use the tableView to load the images.So it will be smoothly loading.Cells are reused so memory issue also solved. Note: If you are using if loop inside cell loading then it must be having else loop.Like if you are setting one image in if loop then must use else loop to set the alternative image.Otherwise it will show you wrong images.

How to avoid null pointer exception in swift iOS

Solution: If you are getting the value from server or if you don't know the type of data type then use the below code. The below code is used for get the string value.If the datatype is string then only inside of the code executes.So if the value came as nil then no issues we can handle.         if let nameString = namStr as ? String {             //use the nameString         }

iOS superView navigation button actions wants to be disable when adding popoverController

Solution: 1. When presenting or adding one subview then hide the navigation bar before presenting the view. 2. After completion of all steps when calling the delegate method to the superView then visible the navigation bar is a better option for that.

iOS UITextfield disable editing for typing swift

Solution: 1. Set the textfield inputview to UIView and set the user interaction to be enabled. 2. If you set the user interaction disabled you cannot be able to change the text as bold font style and change the background color.         myTxtField . inputView = UIView () If you want to change that to disable then use the below code          myTxtField .inputView = nil

Download Xcode DMG or XIP file || xcode versions || xcode download

Solution: You can find and download the Xcode dmg file from apple developer website with valid login of apple developer account. https://developer.apple.com/download/more/ Goto the above url and login with the valid userID and download the dmg files. Xcode 11.3 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_11.3/Xcode_11.3.xip Xcode 11.2.1 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_11.2.1/Xcode_11.2.1.xip Xcode 11.1 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_11.1/Xcode_11.1.xip Xcode 11 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_11/Xcode_11.xip Xcode 10.3 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_10.3/Xcode_10.3.xip Xcode 10.2.1 https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_10.2.1/Xcode_10.2.1.xip Xcode 10.1 https://devel

Add existing framework in Xcode 4

Image
Solution: 1.In left side of  your Xcode project navigator select you project after that select your target 2.select the build phases tab. 3.Expand link binaries with libraries. 4.Click + and select that you want to add that had been downloaded.

Xcode find not working for shuffle or search to top

Solution: In Xcode search option called Find -> Text -> containing or  Find -> Text -> Matching use containing option for better  sub keyword results. Containing will show you like if your keyword is "view" then it will find and show "viewcontroller" also.But matching only show the particular key.

Split the string based on space iOS swift || Split string and save in an array iOS swift

Solution: We can easily split the string value based on space and save it into an array using the split function like below   In swift:         var namStr = "First Middle last"         var nameArr = s plit(namStr) {$0 == " " }         nameArr[0]// First         nameArr[1]// Middle         nameArr[2]// last In swift 2:          var  namStr =  "First Middle last"         let nameArrVal = namStr. c haracters . split {$0 == " " }. map ( String . i nit )

this class is not key value coding-compliant for the key string iOS exception swift

Error: [<UIViewController 0x3927310> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key string.' Solution: 1. If your storyboard Viewcontroller contains wrong class name then the error will came. 2. If you had wrong outlet connections in your class then the error occurs 3.If your class filename not selected for target membership it will came

Swift for loop and for index element in an array iOS

Solution:   The below code is used for looping with index and value from one array. arr is an array with set of values i - index value - data at particular index         var a rr = NSMutableArray ()         for (i,value) in arr. enumerated (){             print ( "index value =" ,i)             print ( "data value =" ,value)         }

How to set the html string to the textView iOS swift

Solution: You can easily get the html string and set that to textview.In textview it had an option called attributed text to set the string with attributes like bold ,italic ,underline etc .. The below code is used for set the html properties based text to the textView Code: import UIKit class ViewController: UIViewController {     @IBOutlet weak var myTxtView: UITextView !     override func viewDidLoad() {         super . viewDidLoad ()         var h tml =  "<b><i>text</i></b>"         myTxtView . attributedText = html. htmlToAttrString         // Do any additional setup after loading the view, typically from a nib.     }     override func didReceiveMemoryWarning() {         super . didReceiveMemoryWarning ()         // Dispose of any resources that can be recreated.     } } extension String {     var htmlToAttrString: NSAttributedString ? {         guard let data