Posts

cllocationdegrees to double iOS swift

Solution: I had tried to convert the cllocation to double using the below code.But it shows warning.Use the below code to avoid the warning                     lat =  Double ( LocationSingleton . share dInstance . lastLocation ?. coordi nate . latitude  ??  0 )

updater frameInterval depricated in iOS swift

Solution: The below code is depricated in iOS 13.0.              updater . frameInterval  =  1 We can use after iOS 13.0 try the below code              updater . preferredFramesPerSe cond  =  1

Add 30 minutes to the date in iOS swift

Solution: The below code is used to add the 30 minutes to the current date and time. let date = startDate . addingTimeInterval ( 30 * 60 )

iOS Swipecellkit editaction close swift || swipe collectionviewcell going blank white swift

Problem: While i had tried to call edit actions in swipe cell kit after navigation to other screen came back to collectionView cell data hides and it shows as blank. Solution: If you are tried to editaction after that you call the below method then the above problem solves.Because if you are called the edit action you must have to resign the edit action.              let  cell = collectionView. cellForItem (at: indexPath)  as !  NoteCollectionCell             cell. hideSwipe (animated:  true , completion:  nil ) You have to call the above function in the below method.      public   func   collectionView ( _  collectionView:  UICollectionView , editActionsForItemAt indexPath:  IndexPath , for orientation:  SwipeActionsOrientation ) -> [ SwipeAction ]? { }

Alternative to carousalView iOS swift

Solution: In iOS it had an alternative for carousal View with google MDCTabBar.You can use mdc tab bar with projection like carousalView.

CVCalender blank but no issues

Solution: It has not the cvcalender issue it's hide because of constraint issues.So check the constraints for the calenderView and set it to correct it will works good...If it was the major problem for you then avoid cvcalender and use MDCalender in cocoapods...It works good...

Create navigation bar with title and subtitle

Solution: You can easily set the title and subtitle using the below method.Just call the below method to set the subtitle to the navigationBar.      func setsubTitle (titleStr: String , subStr: String ,viewControl: UIViewController ) {         let rect = CGRect (x: 0 , y: 0 , width: UIScreen . main . bounds . width , height: 50 )         let titleSize: CGFloat = 20         let subtitleSize: CGFloat = 15         let titleLabel = UILabel (frame: rect)         titleLabel. backgroundColor = . clear         titleLabel. numberOfLines = 2         titleLabel. textColor = . white         let text = NSMutableAttributedString ()         text. append ( NSAttributedString (string: titleStr, attributes: [. font : UIFont . boldSystemFont (ofSize: titleSize)]))         text. appe...