So for that go to your project directory where you have installed git and use sudo git add * to update all changes from a terminal. This happens because sometimes your git repo is conflicting your change in local file.
Group Image Like Skype
We are using Skype and we have noticed that they have added multiple images in one image. So it’s very simple to implement in our project Just Add UIImageview(mainImg) and add multiple UIImageview(subImg) with different frame to UIImageview with proper frame.
iBeacon work’s in background/kill state
When we are using iBeacon use location requestAlwaysAuthorization, by setting this it will always check your location and when you enter’s in a particular region it will fire notification. For that, we have to make following code while we are defining our beacon region. CLBeaconRegion *beacon_Region …
How mobile number to be displayed as (XXX)-(XXX)-XXXX as the user types?
Code given below will help you to format mobile number like (XXX)-(XXX)-XXXX you just need to call this method in your shouldChangeCharactersIn method like this, func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { // phonenumber write in specific formate if …
Get date before year
public func getDateBeforeYear(year : Int) -> Date{ let gregorian: NSCalendar = NSCalendar(calendarIdentifier: NSCalendar.Identifier.gregorian)! let currentDate: Date = Date() let components: NSDateComponents = NSDateComponents() components.year = -year return gregorian.date(byAdding: components as DateComponents, to: currentDate, options: NSCalendar.Options(rawValue: 0))! }
RecyclerView space between items expanding when scrolling
We need to change row child item layout parent properties android:layout_height=”match_parent” to android:layout_height=”wrap_content”
UILable Text Spacing
extension UILabel{ func setTextSpacing(spacing: CGFloat){ let attributedString = NSMutableAttributedString(string: text!) if textAlignment == .center || textAlignment == .right { attributedString.addAttribute(NSKernAttributeName, value: spacing, range: NSRange(location: 0, length: attributedString.length-1)) } else { attributedString.addAttribute(NSKernAttributeName, value: spacing, range: NSRange(location: 0, length: attributedString.length)) …
Image got hide while switching Xcode 7.3 to 8.0
To overcome that issue go to xib/ storyboard File Inspector – identity and type tab, move to interface builder document just select open in Xcode 7.1. Please find attached for more detail.
Use iPhone as Server Using CocoaAsyncSocket Framework
CocoaAsyncSocket provides easy-to-use and powerful asynchronous socket libraries for Mac and iOS. The classes are described below. The CocoaAsyncSocket library comes into play when we have to deal with sockets, ports, and connections. It also helps us with sending data from one end of the …
Username Validation without space and max length
Call function from text field delegate method and get valid username. let USERNAMERANGE = “ABCDEFGHIJKLMONPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.” let KALERTVALIDUSERNAME = “Username can only use letters, numbers, underscore and periods.” public func setUsernameFormate(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String)-> Bool{ var strUserName = textField.text! as …