miércoles, 12 de julio de 2017

iOS: Unit testing

1) Make sure your podfile looks like this:

platform :ios, '10.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

def common_pods
    // your pods here
end

target 'MyApp' do
    common_pods
end

target 'MyApp Tests' do
    common_pods

end

2) Your test files should include:

import XCTest
@testable import MyApp

3) Configuration:





viernes, 7 de julio de 2017

iOS: Google maps markers

Google maps marker view's icon view is placed as shown on the image


That is, the icon view's bottom center is placed in the (lat, lng) provided. All the drawing has to be done inside the icon view, the marker will ignore the value of "clipToBounds" and will always take it as if it were true.

You can change the "groundAnchor":

The ground anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
This point is specified within the continuous space [0.0, 1.0] x [0.0, 1.0], where (0,0) is the top-left corner of the image, and (1,1) is the bottom-right corner.
If the image has non-zero alignmentRectInsets, the top-left and bottom-right mentioned above refer to the inset section of the image.