• 2020-02-23
  • 2020-06-30

How To Configure the project with Xcode to support Apple Notarization Service

March 6, 2020  In “How confirm the program satisfied requirements”, --strict option was missing, added it. There are some way to support Apple Notarization Service. From February 3, 2020, if the app want to be notarized, the app need to meet the original notarization prerequisites. This article describe that how to configure the project with Xcode. Notarization Prerequisites Notarization Prerequisites are following: All Executables are need to be code signed. Enable Hardened Runtime of all of the applications and the command line tools (CLI). Use “Developer ID Application Certificate”, “Developer ID Kernel Extension Certificate” or “Developer ID Installer Certificate” to code signing. Include a secure time stamp. “com.apple.security.get-task-allow” or variations are not contained in the entitlement. Linked to macOS 10.9 SDK or later SDK. Code Signing to Executables Configure to sign the executable. Configuration of the application target and the CLI target Set the “Code Signing Identity” to “Developer ID Application” certificate. If you manage the certificate by yourself, set the “Code Signing Style” to “Manual”, “Development Team” to the empty and “Provisioning Profile” to “none”. Configure to sign on copy In the application target configuration, configure to sign on copy frameworks. METHOD 1 : Configure in the General tab […]

  • 2020-02-22
  • 2020-03-02

The UI Testing of the Mac App – Test the Dialog

This article says about the test of the dialog with the UI Testing. Wait until appear The dialog will be opened when you click the button, launch the application, select the menu item and so on. The dialog will be appeared by many ways. However, there is a common thing, waiting until appear. The time interval is slightly changed by the machine spec or the state of the machine. To wait until the dialog appeared without effects from them, the code can be following:

  • 2020-02-21
  • 2020-02-21

Change the mock object with a command line argument

The UI Testing is powerful function that Xcode has. The UI Testing is the one of the unit test, it generate events such as the mouse down event or a key down event, the application responds to them same as user operations. It tests the user interface such as a window content. How ever, it is hard for me. For example, the mock. The mock is used to test functions that are hard to automatically test. For example, the function to communicate with a web server or the real devices. The mock returns results that the application want without real communication with the real servers or devices.. You need to test functions that are replaced with the mock, but it is not important when you test the user interface. To use the mock, the application use a protocol instead of a real class. For example, when the application communicates with the web server which has APIs, create the API protocol, the real class is adopt to this protocol. Also, the mock is adopt to this protocol, then you can use the mock when you test. There is a problem. How to replace with the mock? Use a command line argument […]

  • 2020-02-20
  • 2020-02-20

Time Representation in Audio and Video Programming

There are some way to represent time in the computer. With C language, the “time_t” type or “Epoch Time” came to me first. It is also called “Unix Time”. The Epoch Time is a number of seconds from January 1, 1970, 00:00:00. It is easy to understand. However, it is not suitable for the audio video programming. In the audio video programming, a second is long time. For example, in the High Res Audio 96 KHz Sampling Data, there are 96000 samples are available in a second. The interval of each samples is 1 / 96000 = 0.000010416666667 second = About 0.01 ms. To express it, use following form in the audio video programming: Time Value (The index of a sample data) / Time Scale For example, to express a second in 96 KHz audio use next form: 96000 / 96000 With this form, the number of datas can express a time. If you convert this to a floating value to understand, a deviation will be made. The precision of the data is different. In the audio video programming, we should not use floating seconds directly, use only to display string.

  • 2020-02-19
  • 2020-02-19

What is Rust? How to install it? Introduction to Rust.

Talking with a friend and became a topic of “Rust”. I heard that it seems to be an interesting language, and I love C/C++, which is likely to be my favorite language. This article says that: What is Rust? How to Install it. How to compile and run. What is Rust? The Rust is a programming language. It is a system language and have been developed by Mozilla Foundation. It is usually supposed to be used for developing software that requires high performance such as written in C/C++, and the goad is to replace C/C++. The Rust has a compiler and export the native executable binary, so the Rust is not needed when the developed software runs. The official web site is here: Rust Programming Language The latest version is 1.36.0. (at this article was written) Installing Rust It is easy to install tools to develop with Rust, and a guide in the official is also simple. Do following in terminal on Unix Compatible OS such as macOS and Linux. $ curl https://sh.rustup.rs -sSf | sh On Windows, download the installer from next page. Install Rust – Rust Programming Language First Step To Rust First, add the path to tools, […]

  • 2020-02-18
  • 2020-02-27

(Swift|ObjC) How to replace UIWebView with WKWebView

On December 23 2019, the following article was post to the Developer News And Updates: Updating Apps that Use Web Views According to that, the App Store will no longer accept the app using UIWebView. I also post the following article: From now, WKWebView and SFSafariViewController are recommended. This article describes how to replace UIWebView with WKWebView. Load the web page From URL The code to load the web page from the specified URL with UIWebView is following: // Swift // With UIWebView func load(url: URL) { let request = URLRequest(url: url) uiWebView.loadRequest(request) } // Objective-C // With UIWebView - (void)loadWithURL:(NSURL *)url { NSURLRequest *request = [NSURLRequest requestWithURL:url]; [self.uiWebView loadRequest:request]; } With WKWebView, the code is following. It is very similar. // Swift // With WKWebView func load(url: URL) { let request = URLRequest(url: url) wkWebView.load(request) } // Objective-C // With WKWebView #import <WebKit/WebKit.h> - (void)loadWithURL:(NSURL *)url { NSURLRequest *request = [NSURLRequest requestWithURL:url]; [self.wkWebView loadRequest:request]; } From Local HTML The code to load the local HTML which is presented by the string with UIWebView is following: // Swift uiWebView.loadHTMLString(html, baseURL: baseURL) // Objective-C [self.uiWebView loadHTMLString:html baseURL:baseURL]; With WKWebView is following. The difference between them is whether the result value is […]

  • 2020-02-18
  • 2020-02-18

Which class is better? WKWebView or SFSafariViewController?

In general, The WKWebView class is better choice when you replace the UIWebView class. However, in some cases, the SFSafariViewController can be better choice. Better class is decided by the requirements Which class is better? You may want to consider following: An app want to do something when read the web page. An app want to know the URL of the web page. An app want to execute the JavaScript on the page. If your app fit to above, your app should use WKWebView. SFSafariViewController can’t do above. Is the requirements really needed? “My app want to do “Something” when read the page”. Is it really needed? For example, your app want to open the specified URL, or want to execute JavaScript to only close the view? It may be enough that by placing the close button on the navigation bar. In some cases, An app display the login page, and received the specified URL, an app close the view. In this case, especially with the OAuth2, you can set the redirect URL to the custom URL Scheme (Deep Link), UIApplicationDelegate can respond to it. You can use SFSafariViewController in this case. Is opening the browser really good UX? Your […]

  • 2020-02-18
  • 2020-02-28

UIWebView will be no longer accepted

To use the embedded web browser in an iOS App, you have three choices: UIWebView Class WKWebView class SFSafariViewController class The long time past since the UIWebView class have been deprecated, now, The AppStore will be no longer accept apps that are using the UIWebView class. Updating Apps that Use Web Views According to above post, the AppStore will be no longer accept new apps are using UIWebView class as of April 2020, app updates using UIWebView class as of December 2020. The way to replace UIWebView to WKWebView, review following article. What to do? Basically you need replace UIWebView with WKWebView, but in some case, you can use SFSafariViewController. For example, if your app simply show the support web site or the login page which is using OAuth2, you can use SFSafariViewController. SFSafariViewController has a feature of Safari. When you display login page are using OAuth2, you set the redirect URL to app deep link URL. The SFSafariViewController can be hidden, your app may hides SFSafariViewController and shows the progress indicator. If you are not sure which class is better, see the next article:

  • 2020-02-18
  • 2020-02-18

How to create the Apple ID for Development

To develop the iOS App, you need the Xcode which is IDE (= Integrated Development Environment). You can freely download it from the Mac App Store. The Mac App Store needs Apple ID. You can also create Apple ID free. It is better that create the Apple ID for Development You can use Apple ID that you using usually to download Xcode. I have been using usually Apple ID to purchase apps. However, it is better that you create the Apple ID for development to register to the Developer Program than using usual Apple ID. For example, To avoid problems from beta OS, especially from iCloud. If your native language is other than English, it is better that name, address and so on are written in English than your native language to avoid unexpected bugs. How to create the Apple ID You can create the Apple ID by follow these steps: Open the Apple Web Site. ( https://www.apple.com/ ) Click “Support” link. Click “Apple ID” link. Click “Go to your Apple ID account page” link. Click “Create your Apple ID” link. Follow to the page.

  • 2020-02-18
  • 2020-02-27

How to setup old macOS as guest on the Parallels Desktop

Sometimes, long-lived product have been support too old macOS. Parallels Desktop is useful to test these product. It supports too old macOS such as OS X 10.5 Leopard Server as guest. There are some tips to setup OS X 10.15 Leopard Server as guest. If you want to set up old macOS as guest, this article will help you. The Problem The problem is that the Parallels Tools can’t be installed on the OS X 10.5.0 Leopard Server. The bad application icon was appeared. It seems that the Parallels Tools doesn’t support OS X 10.5.0. We need update to OS X 10.5.7 or later somehow. The support document says Parallels Desktop 15 have support OS X 10.5 Leopard Server as guest. What happens if you don’t install the Parallels Tools on the guest? If you couldn’t install the Parallels Tools, appropriated drivers will not be installed. It may be cause of following problems: Too low display resolution Too cheap performance Lost network How to resolve You can resolve this problem by updating to OS X 10.5.7 Server or later. “How to update to OS X 10.5.7 without network?” You may think so, but Parallels Desktop has a solution. Download combo […]

>現役のプログラマーが書くプログラミング情報

現役のプログラマーが書くプログラミング情報

日々の開発の中での学びや分かったこと、調べたことなどを書いていくブログです。

CTR IMG