Recently I tried to use this method for my development in iOS10. By the way the function isn’t work in iOS10. It always returns false
value.
I hope that Apple fixs it as soon as possible.
If you manually create a parent and child relationship between two view controllers, the child view controller might not have a navigation bar in this case. So you might be wondered why the navigation item of the child view controller doesn’t effect on the navigation bar. But you need to understand that the navigation bar on the child view controller is not the child view controller’s navigation bar. Because the child view controller is embedded into the parent view controller. So you need to create a LeftBarButtonItem
on the parent’s navigation bar and customize the button with a target and an action pattern in the parent view controller.
2:27 PM
dispatch, dispatch_group, GCD, loop, Swift, thread
No comments
A completion Handler in iOS takes a thread to asynchronously get it done. So it means that we can’t know an exact point which the tasks finish. For example, if we use a for loop to execute several tasks in the background, how could we know all the task are done?
In this case you can use dispatch_group.
dispatch_group_create()
.dispatch_group_enter(groupname)
.dispatch_group_leave(groupname)
.dispatch_group_notify
.If you want to see a concrete example for it, please refer this.
1:46 PM
CoreData, Migration, PersistentStoreCoordinator
No comments
If you change a scheme of your CoreData such as adding a new attribute, you can easily migrate it with options below.
do {
try persistentStoreCoordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: storeURL, options: [NSMigratePersistentStoresAutomaticallyOption: true , NSInferMappingModelAutomaticallyOption: true])
} catch {
fatalError("Error migrating store: \(error)")
}
4:58 PM
Apple Watch 2, AppleWatch, Fitbit charge 2, New Fitbit Flex 2
No comments
Fitbit launched Fitbit Flex 2 which put a new function to track a swimming activity. It is similar to Misfit Shine.
It tracks…
If it is compared to Misfit Shine’s Swimmer’s edition, Misfit Shine tracks everything which Fitbit Flex2 supports.
I think that Misfit Shine is more customized to track a swimming activity. Misfit Shine supports a unique feature calling ‘Swim Time Countdown’.
Both of them support 50 meters water resistance.
Several features which you should notice.
Now I wonder that the upcoming Apple Watch 2 supports more tracking features which Fitbit leads with their new products.
Apple released a new coding font which calls San Francisco mono. I have used Source Code Pro which Adobe created. But I would like to test and use Apple’s one in Xcode7.
Basically San Francisco mono font is pre-installed in Xcode8 beta. So here is the way to use it in Xcode7.
Install Xcode8 and find the location of the font.
Copy them into your font directory in macOS. I used ~/Library/Fonts
Launch Xcode7 and configure it as a coding font. (Xcode7 has a bug that you can’t select font collections in your macOS system. If you meet the problem, run the command below in Terminal and try it again.)
defaults write -app Xcode NSFontPanelAttributes -string "1, 0"
3:54 PM
dataTaskWithURL, iOS Networking, NSURLSession
No comments
If you use dataTaskWithURL , your intention might be getting a data from server and display the data to your UI. But, sometimes it makes a problem that the resulted data is nil.
To solve this issue, first of all you must recognize that dataTaskWithURL
runs asynchronously. Conversely UI stuffs runs on the main thread on iOS. So the time that you get a data from the server might not be synced with the time you display the data to your UI. So in this case you might see a strange nil value on it.
You can simply think that I can run it sychronously. But, it would cause a bad user experience. So here is a solution which is creating another completionHandler to run it asynchronously. And then if you want to update your UI , remember that the task should be taken on main queue.
5:47 AM
modal transition, modalTransitionStyle, presented view controller, presenting view controller
No comments
In iOS the default transition between presenting view controller and presented view controller is .CoverVertical
. But sometimes you might want to change it to a different animation style.
If you setup a presented view controller , it has a property which calls modalTransitionStyle
and you can choose one of styles below,
CoverVerticial
(Default)FlipHorizontal
CrossDissolve
PartialCurl
I recently created an account in a2hosting to host a wordpress website. And then I need to point a domain in Godaddy to a2hosting account.
This video helped me to get it done.
By the way a2hosting’s default option doesn’t provide a public IP address for the account. I use a2hosting’s Shared Hosting Swift product. They charge the additional fee $4 for it.
3:21 PM
AnchorPoint, CALayer, iOS, Layer, Position, View
No comments
I felt difficult to understand the relationship between AnchorPoint and Position in Layer. So I found this in stackoverflow. And it helped me a lot to understand it.
Through my testing I got some principle.
If a layer’s frame is already defined , the anchorpoint doesn’t affect the position of the layer.
If you change an anchorPoint of a layer which already has a frame and a position , the origin of the layer’s frame will be changed by the setting of anchorPoint.
let view = UIView(frame: CGRectMake(0,0,400,400))
view.backgroundColor = UIColor.grayColor()
let label1 = UILabel(frame: CGRectMake(100,100,100,20))
label1.text = "Label1"
print("AnchorPoint: \(label1.layer.anchorPoint) , Frame: \(label1.layer.frame)")
print("Position: \(label1.layer.position)")
label1.backgroundColor = UIColor.whiteColor()
view.addSubview(label1)
view
// AnchorPoint to (1,1)
label1.layer.anchorPoint = CGPoint(x: 1.0, y: 1.0)
label1.text = "Label1"
print("AnchorPoint: \(label1.layer.anchorPoint) , Frame: \(label1.layer.frame)")
view.addSubview(label1)
view
If you set up a layer’s anchorPoint before you set up the frame of the layer, the position of the layer will be affected by setting of the anchorPoint.
let label2 = UILabel()
label2.layer.anchorPoint = CGPoint(x: 1.0, y: 1.0)
label2.frame = CGRect(origin: CGPoint(x: 100,y: 100), size: CGSize(width: 100.0, height: 20.0))
print("AnchorPoint: \(label2.layer.anchorPoint) , Frame: \(label2.layer.frame)")
print("Position: \(label2.layer.position)")
let label3 = UILabel()
label3.layer.anchorPoint = CGPoint(x: 0.0, y: 0.0)
label3.frame = CGRect(origin: CGPoint(x: 100, y: 100), size: CGSize(width: 100.0, height: 20.0))
print("AnchorPoint: \(label3.layer.anchorPoint) , Frame: \(label3.layer.frame)")
print("Position: \(label3.layer.position)")
4:05 PM
Circle Animation, iOS Circle Drawing Animation, UIBezierPath
No comments
When you draw a circle by using core animation , you might use CAShapeLayer and UIBezierPath to draw it.
UIBezierPath(arcCenter: view.center, radius: view.bounds.width / 2, startAngle: startAngle, endAngle: endAngle, clockwise: true).CGPath
The code above there are startAngle
and endAngle
parameters which affect where your animation start and end. So if you want to draw the circle from a specific position to another position, I recommend this link.
If you want to start from the top of the circle , your startAngle
should be M_PI + M_PI_2
.
1:48 PM
htaccess, Wordpress, xmlrpc attack, xmlrpc.php
No comments
I like to post an article to wordpress through Byword or Ulysses. And those tools use wordpress’s xmlrpc.php
.
By the way if you use xmlrpc.php
with your own server , you might face up to infinite attacks which target xmlrpc.php
. And I horribly experience it.
If you want to independently operate your wordpress blog on your own server , I recommend to block xmlrpc.php
access from anonymous users with the code below.
<FilesMatch "xmlrpc\.php$">
order deny,allow
deny from all
allow from [Your IP address] // Allow the only your ip address
</FilesMatch>
Put the code above into your .htaccess
file in the root folder of wordpress.
Upthere is a kind of new concept of cloud service such as iCloud, Dropbox, Google Drive. Mostly cloud services save your data in both local and cloud. It could be beneficial for someone who wants to back up their data.
iPhone 16GB model has been criticized by users because it isn’t enough to fully use. The storage is too small to install bunch of applications from Appstore. Also the size of photos and videos taken by users is getting bigger and bigger.
Upthere provides a solution for it. It doesn’t take much space in your phone or notebook. It just saves thumbnails of photos or videos which are much smaller than fully saving them. So you can save your space with it.
The problem that I faced with Upthere is organizing my documents in it. It suggests Loop as a tool for organizing. But, it isn’t enough to replace the conventional folders. Even they don’t provide tags to organize my files. So I hope that they provide a way for making it better.
9:38 PM
AppleScript, Automation, Delegated Task, Omni Focus
No comments
Here is an AppleScript that you can recreate a task based on an initial task. It is useful when you send someone a mail and need to wait for the mail. So in this case you will have a delegated task in accordance to David Allen’s GTD rule.
So Curt Clifton who is a developer in Omni Group created the AppleScript above to process the case.
7:47 PM
iOS9, StatusBar, StatusBar Color, StatusBar White, UIBarStyle
No comments
Sometimes I am a little irrated by making the statusbar white in iOS development. It looks simple. But, the way to do it is a little complicated.
Put the code below into your controller file or AppDelegate file.
self.navigationController?.navigationBar.barStyle = UIBarStyle.Black
When you type it, you might get serveral options for UIBarStyle
. But BlackOpaque
and BlackTranslucent
were deprecated. So don’t be hesitated to choose one of them. If you want to make your statusbar
white, choose UIBarStyle.Black
. That’s simple.
2:36 AM
NSReuglarExpression, Regular Expression, Swift
No comments
6:51 PM
Core Data, NSBatchUpdateRequest, NSBatchUpdateRequest Relationship
No comments
NSBatchUpdateRequest allows that you can directly store and modify your records rather than with an object graph.
By the way it seems that it doesn’t support updating or modifying a relationship in a core data.
If you want to learn how to use NSBatchUpdateRequest, here is a great and recent tutorial that I found.
So NSBatchUpdateRequest is essential that you handle with lots of data by using Core Data.
2:09 PM
Bottom Margin, Margin, Padding, Top Margin, UIEdgeInsets, UIEdgeInsetsInsetRect, UITextField
No comments
In iOS development you can put a padding into a UITextField with a code below.
First of all , you can create a customized UITextField class for giving it an inset . And then you can put a code below into the class inherited UITextField class.
let padding = UIEdgeInsets(top: 7, left: 0, bottom: 7, right: 0)
override func textRectForBounds(bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}
override func placeholderRectForBounds(bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}
override func editingRectForBounds(bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, padding)
}
UIEdgeInsets is defining a inset distnaces for views. You can easily customize your insets for a view with this type. Positive values will shrink the view and negative value will expand the view.
UIEdgeInsetsInsetRect adjusts a rectangle by the given edge insets. In this code you can adjust a rectangle for textfield’s text and etc with UIEdgeInsetsInsetRect. It receives UIEdgeInsets structure type as a parameter.
I hope that Apple provides a function or an interface that we can easily adjut insets through the interface builder.
9:18 PM
how to use keynote, keynote, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote tutorial character style, what is keynote
No comments
7:55 PM
how to use keynote, keynote, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote tutorial text shadow, what is keynote
No comments
4:05 PM
how to use keynote, keynote, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote tutorial sound effect, what is keynote
No comments
2:39 PM
how to use keynote, keynote, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote tutorial text format, what is keynote
No comments
6:42 AM
Pathfinder, Time machine, time machine error, Timemachine
No comments
can’t connect to a current time machine backup diskSo I tried to fix it by rebooting my mac and it doesn’t work. I thought that the networking wouldn’t be an issue to cause this problem. because my time machine was wired to my iMac through thunderbolt.
2:26 PM
how to use keynote, keynote animation, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote tutorial text outline, what is keynote
No comments
1:00 AM
how to use keynote, keynote, keynote animation, keynote app, keynote presentation, keynote presentation examples, keynote software, keynote tutorial, keynote update, what is keynote
No comments
7:05 PM
Framer, iStart, Principle, Principle for Mac, UI Animation, User Interface, UX Animation
No comments
Principle for Mac was developed by the previous Apple engineer ‘Daniel Hooper’. And I think that he made such a remarkable application which easily animates your Sketch design.
We already know that there are various prototyping animation tools. Framers, Flinto, UXPin, Invisionapp and so on… But, I think that Principle for Mac has a potentional to be populated among designers.
First, Principle makes a great quality animation based on your design. You might think Framer as one of the best UI animation tool in this area. I agree with it. By the way Principle seems that it doesn’t fall behind Framer in the race. Look at the animation that I created with Principle below.
Second, Principle is really easy to learn and use. I think that the weakness of Framer is not to easy. You have to learn Javascript or Coffeescript to create an animation. If you already have an experience to code, it could be no problem. But, I guess that mostly designers wouldn’t be good at coding. Designers are normally reactive to visible things or objects. Photoshop, illustrators and Sketch, those tools which desingers use everyday follows that notion.
Therefore Principle for Mac tries a different approach from Framer. Principle for Mac has almost same interface like Sketch which UI designers mostly use in these days. So you don’t need to learn the interface of Principle.
Also, Principle’s way to animate between artboards is like using Magic Move on Keynote. Let me say that it just works!
Third, Principle has various options to share your animation. Principle can export an animation work to an independent Mac app. So even though an user doesn’t have Principle for Mac, he or she can open and run it on his/her Mac. And it can also export animations to video or animated GIF file. I love this feature. I can share animations from Principle through all kind of channels, Facebook, Messanger, Twitter, Dribble, etc.
I think Principle team strategically put this into Principle for marketing.
Principle recently released version 1.2. And I think that they are rapidly updating Principle in the near future.
Through my experience I come up with several ideas for Principle.
I think that LG tries to be the best. It finally found their own path to innovate.
LG succeeded to put a finger print sensor into their smarthphone’s screen.
According to this What is Apple going to do with their iPhone7? I hope that Apple does this thing,too.
11:06 PM
google glass, offline conversion tracking, smart lense
No comments
Google always wants to build a platform for advertising. By the way Google’s territory has been limited to online ads.
Let’s us think about a display ad on offline. Sometimes you might see a special offer which is advertised on a shop’s external display and then you visit the shop to look around what their product or service is. In this case a conversion was created by the offline display ad. But, Google can’t track this so far.
If you wear smart lenses, Google might be able to track what you see on the offline and then Google can track how a conversion is created on the offline. So Google’s advertising service could be expanded to the offline.
Recently Google got succeeded to develop a smart lense. If this is commercialized, the case above could be happend in the near future.
12:39 AM
Apple Pencil, iPad Pro, Keynote with Apple Pencil
No comments
Apple has been struggled to boost iPad’s sales. The recent Apple’s earning call also warned that the sales of iPad are getting difficult to boot even though Apple launched a brand new product calling iPad Pro.
So I would like to suggest that Apple should focus on popularizing iPad Pro’s Apple Pencil to normal users.
What if you can draw a rectangle on Apple Keynote software on iPad Pro? It could be a seeling point of iPad Pro to normal users.
The combination of Keynote app on iPad Pro + Apple Pencil would be better than Keynote app on Mac. Because drawing functionality will attract normal users into Keynote for iOS.
So I hope that Apple is already preparing an update of Keynote for iOS which is fully compatible with iPad Pro and Apple Pencil. And I think that the pencil drawing function should be added to Keynote for iOS.
I have beein Keynote user since 2005. And if the update that I described above is released, I will definately buy iPad Pro with Apple Pencil to change my presentation device from Mac.
12:38 AM
Desktop Video Firmware Updater, Mac, macOS
1 comment
One day I found a process named Desktop Video Firmware Updater
which has an ugly icon on the system activity app on Mac and then I figured out it was from Blackmagic Design software which I installed at the past time. But, I don’t use it now.
I tried to kill the process, but, I couldn’t do it. So I found the location of the execution file at the link below,
/Library/Application Support/Blackmagic Design/Blackmagic DeckLink/Desktop Video Firmware Updater.app/Contents/MacOS/Desktop Video Firmware Updater
After removing it I finally can’t see it on the activity window. If someone has used Blackmagic Design software on Mac, please refer this post to clean up your processes on Mac.
12:38 AM
Launch Center Pro, OmniFocus Perspective, OmniFocus Review
No comments
At every night I have a time to review OmniFocus’s perspectives. But, it has been painful to tap another view back and forth in OmniFocus.
So I thoguht how I can make a flow of it. And which one would be the best tool to implement this?
My requirements are below,
To achieve the second one, I picked up Launch Center Pro as a right choice. Because the callback function calling lc-callback
can give me a time to review a perspective in OmniFocus.
If you use x-callback-url
, it automatically goes back to the origin app. So I wouldn’t have a time for reviewing a perspective.
So here is my lcp action.
[list:Daily Check|Daily Check=[action:131]|Deferred=omnifocus:///perspective/{{Deferred}}?lc-callback=[action:129]|Delegated=omnifocus:///perspective/{{Delegated}}?lc-callback=[action:129]|Next=omnifocus:///perspective/{{Next Actions}}?lc-callback=[action:129]|Dayone=dayone://?lc-callback=[action:129]]
[action: 131] : It shows the daily check routine perspective that I made in OmniFocus. [action: 129] : It should be the action itself.
I considered using Workflow which is one of my favorite apps in iOS. But, in this case Launch Center Pro did a great job.
I love the way that Notesy pursues. Because it perfectly syncs with nvAlt on the mac through Dropbox.
But, the way that Drafts explains is not appropriate for me. It takes more steps to sync with nvAlt on Mac.
Notesy looks that their update is getting slower. And I like the power of Drafts actions.
The only thing I miss on Drafts for iOS is the way that syncs with nvAlt on Mac.
Set is different from Array. Array is ordered. By the way Set isn’t. Another different thing is Array can have same elements.
For example,
let ar1 = [1, 1, 1, 1]
The code above is possible in Array. But you can’t do it in Set.
Set could be similar to Dictionary. Because each element in Set must be unique like Dictionary’s key value. Set conforms Hashable protocol in order to have unique elements.
The different thing between Set and Dictionary is that Set doesn’t have Key value.
Let me organize everything above.
Collection Type | Ordered | Unique | Stores |
---|---|---|---|
Array | Yes | No | Elements |
Dictionary | No | Keys | Key-value pairs |
Set | No | Elements | Elements |
Recently I tried to write a custom URL action on Launch Center Pro. The goal of this action is opening and searching a keyword into multiple map apps. The first app is Google Maps and second one is Daum Maps which is popular in Korea.
So my action sequence is below,
To achieve these actions above, I wrote a custom URL like below.
launch://x-callback-url/clipboard?text=[prompt: Type a keyword]&x-success={{comgooglemaps-x-callback://x-callback-url?q=[clipboard]&x-success={{daummaps://search?q=[clipboard]}}}}
The actions are fine until 3rd steps above. But, the url action following after second x-success
which tries to open and search on Daum Maps app doesn’t work.
I think that the code looks fine to work. But, I don’t know why it doesn’t automatically switch to Daum Maps and search the keyword on the app.
If you know a solution on it, please let me know.
12:34 AM
Application, iOS, iOS Development, States
No comments
There are three questions for distinguishing app states.
State | Code Execution | Visibility | Receiving Events |
---|---|---|---|
Not Running | No | No | No |
Active | Yes | Yes | Yes |
Inactive | Yes | Mostly | No |
Background | Yes | No | No |
Suspended | No | No | No |
Google’s Eric Schmidt is in South Korea to participate in the challenge which is between Sedol Lee and AlphaGo.
In the challenge place Eric Schmidt took out his iPhone6s to take a photo. It’s quite interesting that the chair man of Google is using iPhone. And I guess that it is unprecedented.
By changing the topic AlphaGo did a remarable job yesterday. And I was a little afraid of the advanced speed of the AI.
12:32 AM
Fitbit Alta, Fitness, Practical User, Wearable
No comments
Today Fitbit launched Fitbit Alta which is a new wearable device. It looks like Microsoft Smart band.
But, the price got cheaper and it is more functional. So someone who thinks Fitbit has too much premium on their device might think that it’s time to try Fitbit as a primary wearable device.
But, still I am not sure how Fitbit is going to compete with Xiami’s Mi band which is much cheaper than Fitbit.
12:32 AM
Errors on Apple Watch Development, WatchOS
No comments
I have struggled to set up iOS and Apple Watch app’s code signing. And I wrote something that you have to remember before doing it.
First, you have to create each app id for them. Create iOS app’s App ID, Watchkit app’s App ID and Watchkit extension’s App ID. Totally you need three App IDs. I think that it’s really complicated at the beginning.
Second, the bundle identifiers are really important!
I have met several errors based on WatchOS 2.1. So here are the bundle identifer naming convention which works fine.
I am not sure that there are a strict rule on it. But, the configuration above is the only thing which works fine for me.
Third, the provisioning file is frustrating. In the general pane I have met a lot of errors which says ‘Code Sign error: No codesigning identities found’. If you are sure that your configuration is okay, quit your Xcode and re-launch it. It normally sovles the issue.
Fourth, Carefully Look info.plist files. Your provisiong files are correct and no error on Code signings. But, you might get an error that is related to a bundle identifier. In my case I solved my issue through this thread
I hope that this article is helpful for you.
12:31 AM
Block Registering Wordpress, CleanTalk, Spambot, Wordpress
No comments
I have used many kind of spam filtering plugins. I also operate woocommerce based wordpress website and then the problem I met on it was spambots to try registering my website.
So I tried some free plugins which use CAPTCHA. But, I couldn’t be satisfied with it, because it wasn’t capatible with my wordpress theme.
Also, it wasn’t perfect to block spams. So I had to manually remove those spam users.
After that I tried to find an alternative plugin and I chose CleanTalk which is great. Through the trial period it perfectly blocked spams and I haven’t got any frustration through it. Additionally it is fully compatible with my wordpress theme.
If you have had a bad experience on spambots which tries to register your wordpress website, I recommend CleanTalk plugn.
I love Byword for Mac to write something by using Markdown. But, recently I have got a bad experience on it.
When I write an article which exceeded over 300 words in Korean, Byword for Mac became slow to type. It made me frustrated and I felt my productivity of writing was being decreased.
The reason why I bought Byword is that it’s the best writing tool for increasing the productivity. But, this experience isn’t one that I expected.
So I hope that Byword team fixs this as soon as possible.
12:29 AM
CSS, HTML, Programming, unknow space between vertical divs
No comments
Recently when I write a HTML code, I suddenly met an unknown space between vertical divs.
The reason that the issue happens is because each browser has different default css. To solve this, you can reset the margin and padding of divs.
* {
margin: 0px;
padding: 0px;
}
The simple code can solve it. Now and then you can customize the divs with your own css.
I love to use nvalt for writing a draft. And I thought how I can smoothely work with nvalt through Alfred.
So I made an Alfred workflow which helpes you to find a note or create a note in nvALT based on Notational Velocity’s URL schemes
To download and install this workflow, click a link.
10:30 PM
Parallax, Parallax Effect, Parallax Effect Video Tutorial
No comments
In these days we can easily experience a parallax scrolling effect in many websites. A core concept of parallax effect is using multiple layers with different speed in accordance to the scrolling position.
So here is a best video tutorial that I found for understanding that concept.
11:55 AM
launchcenterpro, omnifocus, omnifocus perspectives
No comments
Launch Center Pro has its own callback function which calls lc-callback
. The feature of this is that user should touch a button to go back to Launch Center Pro app after the success of a custom url action.
On the other hand, x-callback-url can automatically redirect you to Launch Center Pro app in a same case. So probably you might think that x-callback-url is a good choice because you can reduce a step.
At the end of every day I usually take a review of several perspectives in OmniFocus. So I would like to create a list of perspectives in Launch Center Pro to easily and quickly view them.
By the way if I use x-callback-url, I can’t have a time to review each perspective that I selected. So in this case lc-callback of Launch Center Pro is right fit.
So I implemented a custom url action below,
[list:Daily Review|Daily Check=omnifocus:///perspective//{{Daily Check}}?lc-callback=[action:129]|Deferred=omnifocus:///perspective/{{Deferred}}?lc-callback=[action:129]|Delegated=omnifocus:///perspective/{{Delegated}}?lc-callback=[action:129]]
Additionally I like setting up a notification in Launch Center Pro which can inform me when I should review the perspectives through the custom url action above.
As a result, my workflow to review OmniFocus’s perspectives became much simple. So I hope that you might get an idea from a custom url action above.