Skip to content

Instantly share code, notes, and snippets.

@giacaglia
Last active November 9, 2016 21:03
Show Gist options
  • Save giacaglia/acc637814376ff60835d8c095978b77d to your computer and use it in GitHub Desktop.
Save giacaglia/acc637814376ff60835d8c095978b77d to your computer and use it in GitHub Desktop.

UIColors

.blueColor() to UIColor.blue

.clearColor() to UIColor.clear

.darkGrayColor() to UIColor.darkGray

.lightGrayColor() to UIColor.lightGray

.redColor() to UIColor.red

.whiteColor() to UIColor.white

Uppercase to Lowercase

.Add to .add

.AllowFragments to .allowFragments

.ActionSheet to .actionSheet

.Auto to .auto

.Any to .any

.AlwaysTemplate to .alwaysTemplate

.Bottom to .bottom

.BottomUp to .bottomUp

.Cancel to .cancel

.Center to .center

.CGColor to .cgColor

.CurveEaseInOut to .curveEaseInOut

.Compact to .compact

.Default to .default

.Left to .left

.Equal to .equal

.Fixed to .fixed

.FlexibleWidth to .flexibleWidth

.FlexibleHeight to .flexibleHeight

.HTTPBody to .httpBody

.HTTPMethod to .httpMethod

.Horizontal to .horizontal

.HorizontalSizeClass to .horizontalSizeClass

.Invalidate to .invalidate

.Plain to .plain

.PrettyPrinted to .prettyPrinted

.Ratio to .ratio

.ScaleAspectFill to .scaleAspectFill

.ScaleAspectFit to .scaleAspectFit

.Middle to .middle

.Normal to .normal

.Orientation to .orientation

.Right to .right

.Section to .section

.Top to .top

.Popover to .popover

.Vertical to .vertical

NS to Objects

NSBundle to Bundle

NSIndexPath to IndexPath

NSUTF8StringEncoding to String.Encoding.utf8.rawValue

NSURLSessionConfiguration.defaultSessionConfiguration() to URLSessionConfiguration.default

NSURLSessionConfiguration to URLSessionConfiguration

NSJSONReadingOptions to JSONSerialization.ReadingOptions

NSOperationQueue to OperationQueue

NSTimeInterval to TimeInterval

NSTimer to Timer

NSQualityOfService to QualityOfService

Add cell at the beginning of functions

countForExampleStepperBrickCell( to countForExampleStepperBrickCell(cell:

collectionViewContentSize() to collectionViewContentSize

configureLabelBrickCell( to configureLabelBrickCell(_

changeWidth( cell) to changeWidth(reload: cell)

textImageBrickProfile( to textImageBrickProfile(cell:

textImageBrickName( to textImageBrickName(cell:

textImageBrickImage( to textImageBrickImage(cell:

textImageBrickText( to textImageBrickText(cell:

textImageBrickAtTag( to textImageBrickAtTag(cell:

whoToFollowImage( to whoToFollowImage(cell:

whoToFollowTitle( to whoToFollowTitle(cell:

whoToFollowDescription( to whoToFollowDescription(cell:

whoToFollowAtTag( to whoToFollowAtTag(cell:

Dipatch events

dispatch_async(dispatch_get_main_queue()) { to DispatchQueue.main.async {

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT to DispatchQueue.global().async

URL changes

stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) to addingPercentEncoding( withAllowedCharacters: .urlQueryAllowed)

stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet()) to addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)

URLByAppendingPathComponent to appendingPathComponent

API changes

addIndex( to add(

addOperationWithBlock to addOperation

dequeueReusableCellWithReuseIdentifier( to dequeueReusableCell(withReuseIdentifier:

animateTransition( to animateTransition(using

animateWithDuration( to animate(withDuration:

attributesDidUpdate(attributes: to attributesDidUpdate(

brickLightFont( to brickLightFont(size:

containerView() to containerView

cellForItemAtIndexPath(NSIndexPath(forItem to cellForItem(at: IndexPath(item:

CGSizeZero to CGSize.zero

dismissViewControllerAnimated( to dismiss(animated:

enumerate() to enumerated()

forIndexPath: to for:

.hidden to .isHidden

insertSegmentWithTitle( to insertSegment(withTitle:

invalidateLayoutWithContext( to invalidateLayout(with:

invalidateItemsAtIndexPaths( to invalidateItems(at:

joinWithSeparator( to joined(separator:

layoutAttributesForItemAtIndexPath( to layoutAttributesForItem(at:

numberOfItemsInSection( to numberOfItems(inSection:

renderInContext( to render(in:

UIApplication.sharedApplication() to UIApplication.shared

UIDevice.currentDevice() to UIDevice.current

UIEdgeInsetsZero to UIEdgeInsets.zero

UIScreen.mainScreen() to UIScreen.main

uppercaseString to uppercased()

updateScrollDirection( to updateScrollDirection(scrollDirection:

mainQueue() to main

NSIndexPath(forItem: to IndexPath(item:

presentViewController( to present(

preferredLayoutAttributesFittingAttributes( to preferredLayoutAttributesFitting(

popViewControllerAnimated( to popViewController(animated:

reloadItemsAtIndexPaths( to reloadItems(at:

setBricksHidden( to setBricksHidden(hidden:

scheduledTimerWithTimeInterval( to scheduledTimer(timeInterval:

userInteractionEnabled to isUserInteractionEnabled

transitionDuration( to transitionDuration(transitionContext

viewControllerForKey( to viewController(forKey:

NSURLSession.sharedSession().dataTaskWithURL( to URLSession.shared.dataTask(with:

Adding underscore at the beginning of functions

configureLabelBrickCell( to configureLabelBrickCell(_

@IBAction to @IBAction with _ after

Other changes

Change methods on StickyLayoutBehaviorDataSource to public

All brickDataSource function should have a cell at the function call

Needs to double check

shared() -> sh.redColor (Arrumar isto)

offsetLayoutBehavior(_ behavior: OffsetLayoutBehavior, originOffsetForItemAtIndexPath

Change .textField to guard let as UITextField

update SDWebImageManager.shUIColor.red to SDWebImageManager.shared()

From () on top of a class to @objc()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment