Title
|
Description
|
Explanation
|
Link
|
Application Security. | Application Security Musts for every iOS App. | 1. Don’t store sensitive in UserDefaults.
| |
Create UILabel view outside viewDidLoad class | Create UILabel view outside viewDidLoad class and then add that view to your main view in viewDidLoad method. |
1) Create UILabel view outside viewDidLoadclass and then add that view to your main view in viewDidLoad method.
lazy var myLabel: UILabel = {
let label = UILabel(frame: CGRect(x: 10, y: 50, width: 230, height: 21))label.translatesAutoresizingMaskIntoConstraints = false label.text = "This is label view." label.font = UIFont.systemFont(ofSize: 12) return label
}()
2) And then add that view in viewDidLoad()
override func viewDidLoad() {super.viewDidLoad() view.addSubview(myLabel) } | |
Variables creation
|
Let text: String
var response: String?
var temperature = 32.0
var width = 0.0, height = 0.0
let red, green, blue: Double | ||
Call a function after some time | Option 1. ======= DispatchQueue.main.asyncAfter(deadline: .now() + 5.0) { self.yourFuncHere() } //Your function here func yourFuncHere() { ======= perform(#selector(yourFuncHere2), with: nil, afterDelay: 5.0) @objc func yourFuncHere2() { print("this is...") } ======= Timer.scheduledTimer(timeInterval: 5.0, target: self, selector: #selector(yourFuncHere3), userInfo: nil, repeats: false) @objc func yourFuncHere3() { ======= sleep(5) ======= usleep(1000000)// will sleep for 1 sec usleep(2000)//Will slepp 0.002 milliseconds | ||
Open URL | if UIApplication.shared.canOpenURL(url) { // UIApplication.shared.open(url, options: [:], completionHandler: nil) //If you want handle the completion block than UIApplication.shared.open(url, options: [:], completionHandler: { (success) in print("Open url : \(success)") } | ||
init() { } | //Initializers //Init example 1 struct Fahrenheit { var temperature: Double init() { temperature = 32.0 } } //Init example 2 struct Fahrenheit2 { var temperature = 32.0 } //Init example 3 struct Celsius { var temperatureInCelsius: Double temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } init(fromKelvin kelvin: Double) { temperatureInCelsius = kelvin - 273.15 } } //Init example 4 struct Color { let red, green, blue: Double init(red: Double, green: Double, blue: Double) { self.red = red self.green = green self.blue = blue } init(white: Double) { red = white green = white blue = white } } //Init example 5 struct Celsius2 { var temperatureInCelsius: Double init(fromFahrenheit fahrenheit: Double) { temperatureInCelsius = (fahrenheit - 32.0) / 1.8 } init(fromKelvin kelvin: Double) { temperatureInCelsius = kelvin - 273.15 } init(_ celsius: Double) { temperatureInCelsius = celsius } } //Init example 6 class SurveyQuestion { var text: String var response: String? init(text: String) { self.text = text } //Function func ask() { print(text) } } //In ViewDidLoad //Init example 1 let f = Fahrenheit() print("The default temperature is \(f.temperature)° Fahrenheit") // Prints "The default temperature is 32.0° Fahrenheit" print(Fahrenheit2().temperature) let boilingPointOfWater = Celsius(fromFahrenheit: 210.0) // boilingPointOfWater.temperatureInCelsius is 100.0 print(boilingPointOfWater) let freezingPointOfWater = Celsius(fromKelvin: 270.15) // freezingPointOfWater.temperatureInCelsius is 0.0 print(freezingPointOfWater) let magenta = Color(red: 1.0, green: 0.0, blue: 1.0) print(magenta) let halfGray = Color(white: 0.5) print(halfGray) let bodyTemperature = Celsius2(37.0) // bodyTemperature.temperatureInCelsius is 37.0 print(bodyTemperature) let cheeseQuestion = SurveyQuestion(text: "Do you like cheese?") cheeseQuestion.ask() // Prints "Do you like cheese?" cheeseQuestion.response = "Yes, I do like cheese." | ||
FBSDK Integration tutorial | https://www.spaceotechnologies.com/integrate-facebook-sign-in-button-ios-app/ | ||
Get FB contacts list code | https://stackoverflow.com/questions/29428478/facebook-friends-list-api-for-swift-ios | ||
Twitter Integration tutorial | https://www.brewit9.com/2017/10/twitter-login-integration-in-ios-using.html | ||
LinkedIn Integration tutorial | https://www.appcoda.com/linkedin-sign-in/ | http://www.theappguruz.com/blog/integrate-linkedin-sdk-in-ios | |
Push notifications tutorial | https://medium.com/ios-os-x-development/learn-master-%EF%B8%8F-ios-remote-push-notifications-in-2018-in-under-10-minutes-825ca6bee092 | ||
How to use two versions of Xcode’s tutorial | https://medium.com/@hacknicity/working-with-multiple-versions-of-xcode-e331c01aa6bc | ||
SafeAreaLayout tutorial | https://medium.com/@kahseng.lee123/how-to-solve-the-most-common-interface-problems-when-adapting-apps-ui-for-iphone-x-44c0f3c80d84 | https://medium.com/@kahseng.lee123/creating-custom-navigation-bar-tab-bar-for-iphone-x-f03b1e1827d3 | |
https://customersupport.doubledutch.me/hc/en-us/articles/360008823394-iOS-Client-Distribution-Process-for-New-Apps | |||
UIView animations | https://www.journaldev.com/22104/ios-uiview-animations | ||
Friday, 3 May 2019
iOS Topic wise code
Subscribe to:
Post Comments (Atom)
Difference between == and ===
Difference between == and === https://stackoverflow.com/questions/24002819/difference-between-and == operator checks if their ...
-
Upload image to server in Swift 4.1 and Xcode 9.4.1 Here i'm posting only Upload image code. In this below code you need to ...
-
UIPageViewController This is your story board file I have 3 types of VC's , 1st Vc, 2nd VC is PageViewController with 3 pag...
-
Best tutorial in swift https://www.letsbuildthatapp.com/course_video?id=2242 http://vasundharavision.com/blog/ios/expandable-table...
Thanks for sharing such a great blog... I am impressed with you taking time to post a nice info.
ReplyDeleteiPad App Development Company
Hybrid App Development Services