geek-is-stupid
  • About Me
  • Tools

geek-is-stupid


iOS, Objective-C, Swift tricks and more...

How to show version in an iOS application?

Posted on July 25, 2016

Let make your code be complicated… [Read More]
Tags: swift, xcode, ios, version, UIApplication

How to handle a response with `success` and `error` cases in only one completion block handler by using Swift?

Posted on July 21, 2016

Nowaday, there are a lot of solution to handle response which has multiple states. [Read More]
Tags: swift, xcode, ios, response, enum

How to make an animation within an UIImageView from a list of images by using Swift?

Posted on June 15, 2016

If you have some images like this: [Read More]
Tags: swift, xcode, ios, UIImageView, UIImage, animations

How to adjust custom fonts vertical alignment - Xcode

Posted on May 1, 2016

Some time when you custom font in your project, and the font display not correctly, so how to fix that: [Read More]
Tags: swift, xcode, ios, uifont, alignment

What are differences between Content Hugging and Content Compression Resistance Priority - Cocoa Autolayout?

Posted on December 21, 2015

Summary: [Read More]
Tags: swift, xcode, ios, Content Hugging, Content Compression Resistance Priority, Cocoa Autolayout

Quick qay to add new Auto Layout Constraints by using Swift

Posted on December 13, 2015

What you will do when you wanna add some spaces between a label and a button? Or add width for a label? [Read More]
Tags: swift, xcode, ios, auto layout, constraints, NSLayoutConstraint

How to debug UIWebView in iOS?

Posted on December 11, 2015

If you’re using iOS >= 6 and you have mountain lion (10.8) or Safari >= 6, you can just: [Read More]
Tags: swift, xcode, ios, debug, uiwebview

How can I use 'guard', 'where' statements in Swift2.0? Is it powerful?

Posted on December 9, 2015

Good way to optimize your code :P [Read More]
Tags: swift, xcode, ios, guard, where, let, var

How to manage the errors in your iOS app by using Swift?

Posted on December 1, 2015

I used to got huge mistaken with handle a lot of errors, and almost the errors from after you call REST API or networks, I just print(error): [Read More]
Tags: swift, xcode, ios, error

map(), flatMap() in Swift, Its So Fantastic

Posted on November 25, 2015

Array [Read More]
Tags: swift, xcode, ios, map, flatMap, array, collection

CocoaPods Install Rase Warning "This Can Be the Result of a Merge and the Unknown UUID Is Being Discarded."

Posted on November 17, 2015

Have you ever get some warnings like this? [Read More]
Tags: swift, xcode, ios, cocoapods, install, warnings, merge, unknown, uuid, PBXGroup

How to Localise a String With Enum by using Swift?

Posted on October 27, 2015

Fist thing, please don’t use localized string with dynamic text, it doesn’t work How it works: [Read More]
Tags: swift, xcode, ios, NSLocalizeString, string, localise

How to Add iOS UI Test in Xcode 7?

Posted on September 23, 2015

1. Create simple project: Click on a button and then get the text in textfield for the label [Read More]
Tags: swift, xcode, ios, uitest, xctestcase

How Did You Manage Constants in Your iOS App?

Posted on August 23, 2015

The reason to manages the Constants in app is: We have a lot of static values and which makes easier to know where they are when you wanna reuse them. [Read More]
Tags: swift, xcode, ios, constants

How to Calculate the Height of the Text Depends on Width and Font by using Swift?

Posted on July 16, 2015

The height of the text depends on the font, width and especially it has multiple lines. [Read More]
Tags: swift, xcode, ios, text height, uilabel, uitextview, string

How to organize folders in your iOS applications?

Posted on June 5, 2015

With my experiences, here are my persional ideas to apply for MVVM pattern. [Read More]
Tags: swift, xcode, ios, ornanize, folders

How to hide status bar by repss an uibutton in iOS 9 by using Swift?

Posted on May 9, 2015

With animations: [Read More]
Tags: swift, xcode, ios, status, bar, animations, uibutton, press

How to press on a link to open iOS application by using Swift? Universal Links in iOS 9

Posted on April 7, 2015

In iOS 9, your app can register to open web links (using https or http) directly, bypassing Safari. Here is the process to add Universal Links: [Read More]
Tags: swift, xcode, ios, universal links, deeplinks, handoff, json

How to Manage All Localized Strings in Your Project - Xcode?

Posted on March 21, 2015

Using ‘genstrings’ tool from Apple which included into Xcode [Read More]
Tags: swift, xcode, ios, localized strings, Localizable.strings, languages

How to Capture an Image From MKMapView and MKPolyline Using Objective C?

Posted on December 21, 2014

[MKMapSnapshotter takeSnapShotOfTargetSize:CGSizeMake(320, 150) withPolyline:(MKGeodesicPolyline *)polyline completion:^(UIImage * image, CGFloat height) { self.polylineImageView.image = image; }];
Tags: swift, xcode, ios, uiimage, mkmapview, mkpolyline
  • ← Newer Posts
  • Older Posts →
  • GitHub
  • Twitter
  • Email me

levantAJ  •  2023  •  https://geek-is-stupid.github.io/