Found 13 Articles for IPhone

How to create multiple styles inside a TextView on iOS App?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

334 Views

To create multiple styles inside a textview we need to use attributed string. The text view in ios has a property attributedText which can be used to style the text inside a text view. We’ll see this with help of an example.First, we’ll create an attributelet attributeOne : [NSAttributedString.Key : Any] = [NSAttributedString.Key(rawValue: NSAttributedString.Key.font.rawValue) : UIFont.systemFont(ofSize: 16.0), NSAttributedString.Key(rawValue: NSAttributedString.Key.foregroundColor.rawValue) : UIColor.blue]Then we’ll create an attributed string with the attribute we createdlet string = NSAttributedString(string: "Text for first Attribute", attributes: attributeOne)Similarly, we’ll create another string with different attribute. Then we’ll initialize the text of textView with the attributed string.Now the whole ... Read More

What is "Processing Symbol Files" message in Xcode?

Rishi Rathor
Updated on 30-Jul-2019 22:30:24

168 Views

Processing symbol files is a message displayed on xcode when we create a project’s build. When this message appears, in background Xcode downloads files and symbol files for specific device and a specific processor on which build shall be installed.The symbol files contains debug symbols which are used to debug on specific processor and iOS version and when some crash or error occurs, those symbols are used to create crash reports. Once processing symbols is done a new folder with device symbols is created in the library, usually under “~/Library/Developer/Xcode/iOS DeviceSupport/ “.Sometimes our system might get stuck on this step ... Read More

Check if string contains special characters in Swift

Anvi Jain
Updated on 29-Jun-2020 14:04:33

2K+ Views

To check if a string contains a special character in swift we can use conditionals like if else or switch but that would need a lot of conditions to be executed, making programming as well as execution time consuming. So in this example we’ll see how to do the same task with regular expressions and another method that swift provides to check if some character exists in a character set.Method 1 − Using regular expressionLet’s create an extension of String and add the following code into thatextension String {    var containsSpecialCharacter: Bool {       let regex = ... Read More

Advertisements