Here is how you can call method or function in FirstViewController.swift from another Class called SecondViewController.swift in your iOS or macOS project within Xcode

Here is situation in your Xcode project that you want to call method from another class swift file to your original class of swift file.

 
Let’s call your original swift class file ‘FirstViewController’ which has ‘UIViewController’ as super class.

 
Second swift that you want to call function from we will assume that it has ‘SecondViewController’ as class name & it has ‘UIViewController’ as super class.

 
You have written function called ‘printSomething()’ in your ‘SecondViewController’ that would be triggered when somebody taps on button present on ‘FirstViewController’ as IBAction called ‘printThis(sender: UIButton)’

 
So you will write printThis function as follows:

Continue reading “Here is how you can call method or function in FirstViewController.swift from another Class called SecondViewController.swift in your iOS or macOS project within Xcode” »

Continue Reading Post

Here is how to set a background color in UIimage using Swift Programming Language while developing app for iOS in Xcode. With addition to this here is list of UIColor predefined / preset component values in Xcode that you can use using dot operator

I will explain below how to set background color to UIimage while developing app for iOS.

 

Assumptions: I assume that you have already created Xcode project for iOS app development & you are using storyboards for developing the same. Also you have dragged UIimage View to your current ViewController.

 
Step 01: Now connect your UIimage View to your ViewController.swift file with code something like this

 

@IBOutlet weak var selectImage: UIImageView!

 
Step 02: Now in your desired function set your UIimage’s background color with following code using dot operator

Continue reading “Here is how to set a background color in UIimage using Swift Programming Language while developing app for iOS in Xcode. With addition to this here is list of UIColor predefined / preset component values in Xcode that you can use using dot operator” »

Continue Reading Post

How to Change iOS Device’s (iPhone, iPad and iPod touch) Status Bar text colour using Swift Development Language in Xcode

Let’s get started & know what is the exact requirement before we proceed for solution.

 

Assumption: I assume that you want to have Status Bar text colour to be white as your Navigation Bar background is in dark colour. I also assume that you are developing your iOS app with latest version of iOS 9 or higher & latest version Swift & Xcode

 
Step 01: Click on your Project icon in your ‘Project Navigator’ tab in your respective projects left panel ‘Navigator’ tab.

 
Step 02: Select your project title under ‘Targets’

 
Step 03: Select ‘Info’ tab

Continue reading “How to Change iOS Device’s (iPhone, iPad and iPod touch) Status Bar text colour using Swift Development Language in Xcode” »

Continue Reading Post

How to programmatically change iOS app’s global tint colour, Navigation / Toolbar / Tab Bar’s tint (i.e. Text & Icon Colour) & bar tint colour (i.e. Background colour) using Swift Language while developing app in Xcode

Let’s get to the root of this topic,

 
Case: A case where you are developing your iOS app & you want to use your custom colour to colorise global tint colour for text & icon in your respective app & you also want to change tint & bar tint colour for Navigation Bar / Tab Bar / Tool Bar in your app.

 

Assumption: I assume you are well worse with iOS development in Xcode, You have embedded navigation controller to your app storyboard’s respective view controller & you have added tab bar view controller or dragged toolbar to your app’s view controller. I also assume you are using Swift as your programming language.

 
Solutions:

 

Note: You will have to copy following code in your iOS App’s AppDelegate.swift file’s ‘didFinishLaunchingWithOptions’ function while developing the same app in Xcode.

Continue reading “How to programmatically change iOS app’s global tint colour, Navigation / Toolbar / Tab Bar’s tint (i.e. Text & Icon Colour) & bar tint colour (i.e. Background colour) using Swift Language while developing app in Xcode” »

Continue Reading Post

How to disable or remove close, minimise, resize button from Mac OSX App’s title bar while developing the same app in Xcode

While developing OSX App in Xcode you may want your Apps Window Controller should be without either close, minimise & resize button or all, Here is how to do it easily within Xcode.

 

Assumption: I assume you are using Storyboards while developing app in Xcode.

 
Step 01: Select Storyboard in left panel ‘Project Navigator’,

Continue reading “How to disable or remove close, minimise, resize button from Mac OSX App’s title bar while developing the same app in Xcode” »

Continue Reading Post

How to fix iTunes store operation failed, App Sandbox not enabled error that you get while validating and uploading Mac OSX app to iTunes Connect via Xcode

After you are done with coding Mac OSX App you may want to upload the same to iTunes Connect to distribute it through Mac AppStore.

 

While validating your app archive before uploading it to iTunes Store you will get following error something like this stating: Archive validation failed due to the issue listed below. iTunes Store operation failed. App Sandbox not enabled. The following executable must include the “com.apple.security.app-sandbox” entitlement with a Boolean value of true in the entitlement property list.

 
iTunes store operation failed app sandbox not enabled

Continue reading “How to fix iTunes store operation failed, App Sandbox not enabled error that you get while validating and uploading Mac OSX app to iTunes Connect via Xcode” »

Continue Reading Post

Disable a IBAction (id) sender button programatically in Xcode while developing app for iOS & OSX

While developing apps for OSX or iOS you will be wondering how to disable IBAction button programatically.

 
Here is how to do it.

 

Assumption: I assume you are using Storyboards for developing your apps within Xcode.

 
Step 01: Drag UIButton (iOS) or NSButton (OSX) on Storyboard. I Also assume that you have dragged three buttons on storyboard & you have named it as Start, Pause & Reset.

Continue reading “Disable a IBAction (id) sender button programatically in Xcode while developing app for iOS & OSX” »

Continue Reading Post

How to programmatically set image to UIImageView or NSImageView in Xcode?

Here is how to programmatically set image to UIImageView in Xcode,

 
Step 01: In your Xcode project in storyboard drag UIImageView from object library (located at Xcode right utilities sidebar). Give it definite size & now note down it’s size on paper to create same size image in you choice of image editor.

 
Step 02: Connect UIImageView to respective header file with name e.g. imageView

 
Your code will look something like this:

Continue reading “How to programmatically set image to UIImageView or NSImageView in Xcode?” »

Continue Reading Post

Here is how to set the text in an NSTextField programatically in Xcode while developing applications for OSX?

Here is step wise how to set text in NSTextField programatically,

 
First,
If you are using storyboards for app development.
Connect button storyboard to code class file i.e. .h header & .m method file or incase of swift class file of source code

 
Second,
Let assume that you have connected your NSTextField / Label as:

 

@property (nonatomic, assign) IBOutlet NSTextField *namedTextField;

 
Third,
So you will use dot operator called .stringValue & Here is how it can be done two ways:

Continue reading “Here is how to set the text in an NSTextField programatically in Xcode while developing applications for OSX?” »

Continue Reading Post

How to Fix Xcode Organiser error, ‘ERROR ITMS-4238: “Redundant Binary Upload. There already exists a binary upload with build version ‘1.0.1’ for train ‘ 1.0.1’” at SoftwareAssets/PreReleaseSoftwareAsset’

With updated new iTunesConnect for Apple Developers comes with many features one which is prerelease or TestFlights for External Testers. It allows App Developer to distribute it’s unreleased app to selected beta testers so that developer can get reviews & bug reports from them. One of this feature is that you can upload multiple copies of same app to iTunesConnect i.e. ITC.

 
When you try to do that you get following error

 
xcode organiser ERROR ITMS-4238 Redundant Binary Upload. There already exists a binary upload with build version

Continue reading “How to Fix Xcode Organiser error, ‘ERROR ITMS-4238: “Redundant Binary Upload. There already exists a binary upload with build version ‘1.0.1’ for train ‘ 1.0.1’” at SoftwareAssets/PreReleaseSoftwareAsset’” »

Continue Reading Post