Skip to content

Instantly share code, notes, and snippets.

View yefga's full-sized avatar
🌕
Working from anywhere

yefga

🌕
Working from anywhere
View GitHub Profile

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@yefga
yefga / CoreDataHelper.swift
Created February 14, 2023 10:06
Core Data helper
//
// CoreData.swift
// Themez (iOS)
//
// Created by yepz on 09/02/23.
//
import Foundation
import CoreData
@yefga
yefga / embedInScroll.swift
Created June 19, 2022 14:02
Embed all UIViews inside UIScrollView
extension Array where Element: UIView {
func embedInScroll(after view: UIView) {
let scrollView = UIScrollView()
view.addSubview(scrollView)
scrollView.translatesAutoresizingMaskIntoConstraints = false
scrollView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true