Skip to content

Instantly share code, notes, and snippets.

View gali8's full-sized avatar

Daniele - mokapp.com gali8

View GitHub Profile
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
rm -frd ~/Library/Developer/Xcode/DerivedData/*
rm -frd ~/Library/Caches/com.apple.dt.Xcode/*
#to print Build settings type on terminal: xcodebuild -project MyProject.xcodeproj -target "MyTarget" -showBuildSettings
#PROJECT_DIR = /Users/daniele/Desktop/MyProjectFolder
project_content_folder="MyProject"
storyboard_file="Main.storyboard"
storyboard_file_orig="Main_orig.storyboard"
storyboard_file_backup="Main_bk.storyboard"
storyboard_dir="${PROJECT_DIR}/${project_content_folder}/Base.lproj"
#to print Build settings type on terminal: xcodebuild -project MyProject.xcodeproj -target "MyTarget" -showBuildSettings
#PROJECT_DIR = /Users/daniele/Desktop/MyProjectFolder
project_content_folder="MyProject"
storyboard_file="Main.storyboard"
storyboard_file_orig="Main_orig.storyboard"
storyboard_file_backup="Main_bk.storyboard"
storyboard_dir="${PROJECT_DIR}/${project_content_folder}/Base.lproj"
@gali8
gali8 / ConfaloGenerics.swift
Last active February 15, 2018 09:45
ConfaloGenerics
//: Playground - noun: a place where people can play
import UIKit
class PFObject: Any {
}
let objsA: [PFObject] = []
let objsB: [[String: Any]] = [[:]]
@gali8
gali8 / XCode10TesseractFix
Last active August 23, 2019 10:41
libstdc++ is removed in iOS 12 simulator but it remains in the iOS 12.0 (device)
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'TesseractOCRiOS'
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
header_phase = target.build_phases().select do |phase|
phase.is_a? Xcodeproj::Project::PBXHeadersBuildPhase
end.first
//
// AppDelegate.m
// Gap
//
// Created by Daniele on 02/04/13.
// Copyright (c) 2013 Daniele Galiotto - www.nexor.it. All rights reserved.
//
#import "AppDelegate.h"
https://samples.openweathermap.org/data/2.5/forecast/daily?q=München,DE&appid=b6907d289e10d714a6e88b30761fae22
https://openweathermap.org/forecast16#name16
http://openweathermap.org/img/w/
import UIKit
extension String {
func html(font: UIFont) -> NSAttributedString? {
do {
let modifiedText = String(format: "<span style=\"font-family: \(font.fontName); font-size: \(font.pointSize)\">%@</span>", self) as String
let attrStr = try NSAttributedString(
data: modifiedText.data(using: String.Encoding.unicode, allowLossyConversion: true)!,
options: [.documentType: NSAttributedString.DocumentType.html, .characterEncoding: String.Encoding.utf8.rawValue],
import UIKit
class LabelTappable: UILabel {
let layoutManager = NSLayoutManager()
let textContainer = NSTextContainer(size: CGSize.zero)
let tapGesture = UITapGestureRecognizer()
var textStorage = NSTextStorage() {
didSet {