iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

iOS 4.3 changed transformation on UIImagePickerController's camera overlay view

After testing my App on iOS 4.3 I noticed that the camera overlay of my UIImagePickerController has an added transformation that stretched the content extremely. Pre iOS 4.3 everything shows up correctly. Here is what I do imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; cameraOverlay = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, […]

Attempt to present ViewController whose view is not in the windows hierarchy

I meet a strange problem: I made 2 view controllers for wich I can switch the view with code: var currentViewController:UIViewController=UIApplication.shared.keyWindow!.rootViewController! func showController() { let ViewControllernew1 = UIStoryboard(name: “Main”, bundle: nil).instantiateViewController(withIdentifier: “viewController2”) currentViewController.present(ViewControllernew1, animated: true, completion: nil) } My app open correctly to the first view controller, then, when I click on the button created […]

How can I add auto indentation to UITextView when user type new line?

How can I add auto indentation to UITextView when user type new line? Example: line1 line2 <user has typed “Enter”> <cursor position> line3 <user has typed “Enter”> <cursor position>

Swift TyphoonBlockComponentFactory Error in XCTest

i’m using Swift with Typhoon and Cocoapods. Everything worked well until i started to write an Integrationtest (according to the Typhoon-Example-App Test) for my Typhoon component. I wanted to setup the TyphoonFactory in the Test setUp() method in the same way as i did in the AppDelegate. When i execute the test i always get […]

Return Type of -application:didFinishLaunchingWithOptions:

When developing for iOS, the first entry point for your app is the -[AppDelegate application:didFinishLaunchingWithOptions:]. The return type of this method is a BOOL. By default, the return type of this method is YES. Here is the code automatically generated by Xcode. – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; […]

C style for statement removed from swift 3.0, successor() is unavailable

Can anyone please help me update this for loop to swift 3.0. help appreciated. Thank you! for var index = trimmedString.startIndex; index < trimmedString.endIndex; index = index.successor().successor() { let byteString = trimmedString.substringWithRange(Range<String.Index>(start: index, end: index.successor().successor())) let num = UInt8(byteString.withCString { strtoul($0, nil, 16) }) data?.appendBytes([num] as [UInt8], length: 1) }

Download file to downloads folder ios/android using phonegap

I am getting a JSON response from a web service that returns a file in either binary or base64 . I want to save this file to the fileSystem. I wanted to know the ideal (default/industry standard ) location to download these files for IOS/ ANdroid on the file system. IF there is no ideal […]

Make UIViewController a singleton?

During the use of my app, the user should be able to start, stop, forward background music. (Across several UIViewControllers). For this, I made my MusicPlayer a singleton (NSObject). If I create the controls in every view for itself it works, but what I want is basically one view which handles the music player class […]

Objective-C: Find consonants in string

I have a string that contains words with consonants and vowels. How can I extract only consonants from the string? NSString *str = @”consonants.”; Result must be: cnsnnts

GoogleMaps SDK for iOS – SWIFT 3: When hiding a marker and then adding the map view back, the cpu gets stuck at 100%

Scenario UIViewController sets self.view as GMSMapView in viewDidLload A method will create markers and store them in self.markers and set to the self.view as! GMSMapView So far the app behaves well Later, another method after some action (looking to toggle those markers) sets all to nil Up to here all goes well and […]