When using python as matlab like tool. jupyter or voila are necessary to be installed via pip.
be reminded that if the OS is linux, the tolls which are installed via pip (or pip3) are stored in "~/.local/bin"
so you need to add the path.
for example edit .bashrc
PATH="$HOME/.local/bin:$PATH"
I am using WSL and noticed that it's default ~/.profile has the bellow line
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
it means when bash is loaded, it checks if there is .local/bin, if so add the directory to the PATH, if not don't do anything.
My .local was created first time after using pip. so the Path was not set.
so without restart the terminal,
$source ~/.profile
would also add pip toll path
2020年2月15日土曜日
2020年2月11日火曜日
2020年2月8日土曜日
Disable Darkmode programmatically on Swift . iOS 13
Darkmode was introduced on iOS13 and it add the cool appearance on the iOS
however when you don't want to implement the darkmode because of some design conflict, ui conflict, here is how to disable dark mode.
add following code on viewDidLoad for each viewController as explained
There is the other solution to make light style as a default for all view, which is to add key on info.plist. but this solution is not recommended by apple.
for more information, see the link
however when you don't want to implement the darkmode because of some design conflict, ui conflict, here is how to disable dark mode.
add following code on viewDidLoad for each viewController as explained
override func viewDidLoad() {
super.viewDidLoad()
// Always adopt a light interface style.
overrideUserInterfaceStyle = .light
}
There is the other solution to make light style as a default for all view, which is to add key on info.plist. but this solution is not recommended by apple.
you can temporarily opt out by including theUIUserkey (with a value ofInterface Style Light) in your app’sInfofile. Setting this key to.plist Lightcauses the system to ignore the user's preference and always apply a light appearance to your app.
Important
Supporting Dark Mode is strongly encouraged. Use the UIUser Interface Style key to opt out only temporarily while you work on improvements to your app's Dark Mode support.for more information, see the link
2020年2月7日金曜日
2020年2月1日土曜日
How to open picture with UiImage in Swift playgroud.
How to open picture with UiImage in Swift playgroud.
- Open navigator side panel.
- See there are Sources and Resources folder. select Resources
- click + button at the bottom and choose add file to Resources
- choose the image file
- use it on playground . ex
let uiImage = UIImage(named: "testImage.jpg")
2020年1月31日金曜日
ios 13, how to change the text field placeholder color from storyboard
How to change text field placeholder color from storyboard .
- select the UITextfiled of which you want to change the color. if there are several text fields, you have to do the same procedure for each.
- open the identity inspector. see the pic.
- Find the User Defined Runtime Attributes and click + button.
- Type a new row with Key Path placeholderLabel.textColor. be reminded that this is for iOS13, Swift 5.0. if it is for lower version, type _placeholderLabel.textColor instead.
- choose Type color and select the color as your choice.
2020年1月28日火曜日
Swift on iOS13, UIView present
The change on iOS13, UIView.present default style is card presentation
card presentation
to make it full screen is easy.
solution
to set .fullscreen or .overFullScreen to
.overFullScreen
card presentation
to make it full screen is easy.
solution
to set .fullscreen or .overFullScreen to
modalPresentationStyle
for example
let viewCon = SampleViewController2(nibName: "SampleViewController", bundle: .main)
viewCon.modalPresentationStyle = .fullScreen
self.present(viewCon, animated: true, completion: nil)
.fullScreen
Discussion
The views belonging to the presenting view controller are removed after the presentation completes.
.overFullScreen
Discussion
The views beneath the presented content are not removed from the view hierarchy when the presentation finishes. So if the presented view controller does not fill the screen with opaque content, the underlying content shows through.
登録:
投稿 (Atom)



