Skip to content

Instantly share code, notes, and snippets.

🦆
Living, learning & making Apps better day by day

Alex Artemev bartleby

🦆
Living, learning & making Apps better day by day
Block or report user

Report or block bartleby

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bartleby
bartleby / ProfileView.m
Created Jan 31, 2015
Random Image Generator
View ProfileView.m
- (NSArray *)imageURLs
{
if (!_imageURLs)
{
NSMutableArray *imageURLs = [NSMutableArray array];
for (NSInteger index = 0; index < 100; ++index)
{
[imageURLs addObject:[NSString stringWithFormat:
@"http://dummyimage.com/200/%06X/%06X&text=%ld",
@bartleby
bartleby / UIViewController+Ext.swift
Last active Jul 8, 2018
Get the current visible viewController.
View UIViewController+Ext.swift
extension UIViewController {
func topMostViewController() -> UIViewController {
if let presented = self.presentedViewController {
return presented.topMostViewController()
}
if let navigation = self as? UINavigationController {
return navigation.visibleViewController?.topMostViewController() ?? navigation
}
View LinearScale.swift
open class LinearScale {
var domain: [CGFloat]
var range: [CGFloat]
public init(domain: [CGFloat] = [0, 1], range: [CGFloat] = [0, 1]) {
self.domain = domain
self.range = range
}
View iOS URL Schemes
URL Schemes
Apple
 
Apple Music     — music://geo.itunes.apple.com/us/albums/<albumID>
                – music://geo.itunes.apple.com/us/artists/<artistID>
 
Apple News      — applenews://
App Store       — itms-apps://itunes.apple.com/app/<appID>
Apple TV        — videos://
You can’t perform that action at this time.