Posts

Showing posts from June, 2023

NavigationController app allow from left swipe to back,How to disable iOS swift

Solution:  In Navigation controller by default it allows for slide from left to right to back action.If you want to disable it then use the code. code: self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false

Invalid bundle error while upload the app to the app Store

Image
Problem:  Invalid bundle. The “ UIInterfaceOrientationLandscap eLeft, UIInterfaceOrientationLandscap eRight, UIInterfaceOrientationPortrait ” orientations were provided for the UISupportedInterfaceOrientatio ns Info.plist key in the com.myapp bundle, but you need to include all of the “ UIInterfaceOrientationPortrait , UIInterfaceOrientationPortrait UpsideDown, UIInterfaceOrientationLandscap eLeft, UIInterfaceOrientationLandscap eRight” orientations to support iPad multitasking. For details, visit:  https://developer.apple.com/ documentation/bundleresources/ information_property_list/ uisupportedinterfaceorientatio ns . (ID: something) Solution: In the above image you have to check the full screen option enabled.If not then enable and upload it will works.

Create a view that will be below 30% of the screen in y axis iOS swift

 Solution: I want to create a view that will be below 30% from the top of the screen.Then i will set the view constraints with center from y axis then add the below code. Code:          view . centerYAnchor . constraint ( equalTo :  self . view . topAnchor ,  constant :  UIScreen . main . bounds . height  * 0.3). isActive  =  true

Tab bar appearance for iphone and ipad for both image and text color in normal and selected mode iOS swift

 Solution: You can able to change the bar appearance for iphone and ipad for both image and text color in normal and selected mode           let  tabBarAppearance =  UITabBarAppearance ()          let  tabBarItemAppearance =  UITabBarItemAppearance ()         tabBarItemAppearance. normal . ic onColor  =  color         tabBarItemAppearance. normal . ti tleTextAttributes  = [ NSAttributedString . Key . foregr oundColor :  color ]         tabBarAppearance. stackedLayout Appearance  = tabBarItemAppearance          self . tabBar . standardAppearance  = tabBarAppearance The above code will works for iphone But in ipad you want to add the below code         tabBarAppearance. inlineLayoutA ppearance  = tabBarItemAppearance

How to set the tab bar selected item color in swift?

 Solution: If you want to change the selected item color in swift then use the below code.          self . tabBar . tintColor  = color

tabbar color with gradient in iOS swift

 Solution: Code:          let  gradientLayer =  CAGradientLayer ()         gradientLayer. colors  = [ color1 . cgColor ,  color2 . cgColor ]         gradientLayer. startPoint  =  CGPoint ( x : 0,  y : 0.5)         gradientLayer. endPoint  =  CGPoint ( x : 1,  y : 0.5)         gradientLayer. frame  =  CGRect ( x : 0,  y : 0,  width :  tabBar . bounds . width ,  height :  tabBar . bounds . height )              tabBar . layer . insertSublayer ( gradientLayer,   at : 0)

UISearchbar textfield clear button hide iOS swift

 Solution: If typing in the textfield in search bar by default it will show clear button at the end.But if you want to disable the clear button then use the code below.          searchBar . searchTextField . cl earButtonMode   = . never

Pod init error in iOS swift

 Problem: File not found: /Applications/Xcode.app/ Contents/Developer/Toolchains/ XcodeDefault.xctoolchain/usr/ lib/arc/libarclite_ iphonesimulator.a Solution: post_install do |installer| installer.generated_projects. each do |project| project.targets.each do |target| target.build_configurations. each do | config | config .build_settings[ ' IPHONEOS_DEPLOYMENT_TARGET' ] = '13.0' end end end end

iOS build upload failed error Invalid bundle

 Problem: Invalid bundle. Apps that support Multitasking on iPad must provide the app’s launch screen using an Xcode storyboard, or using UILaunchScreen if the app’s MinimumOSVersion is 14 or higher. Verify that the UILaunchStoryboardName key is included in your com.myapp.name bundle if you’re using a storyboard. Solution: Select the target and goto general -> select above main interface iphone and ipad shown select the ipad and check the require full screen option..After that clean the derived data and upload it.It will works